We have moved at community.getvera.com

Author Topic: Dim up/down function Scene  (Read 2114 times)

Offline Axling

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Dim up/down function Scene
« on: August 04, 2016, 04:19:39 am »

Is it possible to make a scene that dims the light up or down when i hold a button?

I have the ZRC-90 Scene controller and a Fibaro 2 dimmer. All connected to Vera Plus
At the moment I am able to activate scenes with the scene controller, but I see no function for dim up/down while i press and hold a button.



Offline Slartibartfast

  • Hero Member
  • *****
  • Posts: 856
  • Karma: +378/-367
Re: Dim up/down function Scene
« Reply #1 on: August 04, 2016, 01:04:00 pm »
A scene can set a specific dimming level but not work as a standard dimmer.
To do as you wish you need a device which supports association.
Devon UK 240V 50Hz
Now on Homeseer

Offline kigmatzomat

  • Sr. Member
  • ****
  • Posts: 377
  • Karma: +23/-0
Re: Dim up/down function Scene
« Reply #2 on: August 04, 2016, 10:31:33 pm »
Yes if you dive into luup. Wont work on button hold but each press can change the brightness a fixed amount. I took these scenes out because I wasn't using them and repurposed the remote so this is from old notes; I can't guarantee it works as is. It SHOULD dim a bulb in 10% increments and if the light is off kick to 100%

local device=40

local mindim=0
local maxdim=100

local switchOnOff = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", device)
local lightLevel =luup.variable_get("urn:upnp-org:serviceId:Dimming1", "LoadLevelTarget", device)

      --Switch is on
if (switchOnOff == "1") then
 -- Set new brightness target dimmer
              lightLevel =lightLevel-10
               luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = lightLevel}, device)                 
--switch was off
         lightLevel =100 
        luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = lightLevel}, device)