SceneController
-
@androbot said:
I'm suspecting this is due to the "setVariableIfChanged" nature of the code in conjunction with the split V_SCENE_ON/V_SCENE_OFF messages. In other words, it's not a single variable that is toggling, it's two separate ones.
This most surely is the problem! I will have to make a mental note of it and fix it the next time I mess with the Vera plugin code.
-
I tried this out last night and discovered an interesting issue. A scene will activate once and deactivate once, but all subsequent changes are not applied. I confirmed in my Vera logs that the messages make it through to the unit, but the subsequent application of scene never happens after the first time.
I'm suspecting this is due to the "setVariableIfChanged" nature of the code in conjunction with the split V_SCENE_ON/V_SCENE_OFF messages. In other words, it's not a single variable that is toggling, it's two separate ones.
@androbot said:
I'm suspecting this is due to the "setVariableIfChanged" nature of the code in conjunction with the split V_SCENE_ON/V_SCENE_OFF messages. In other words, it's not a single variable that is toggling, it's two separate ones.
Nice spottet!
Change line 182 in L_Arduino.lua from
if ((value ~= curValue) or (curValue == nil)) thento:
if ((value ~= curValue) or (curValue == nil) or (serviceId == "urn:micasaverde-com:serviceId:SceneController1")) thenSo the sl_SceneActivated/sl_SceneDeactivated variables are updated unconditionally
-
@androbot said:
I'm suspecting this is due to the "setVariableIfChanged" nature of the code in conjunction with the split V_SCENE_ON/V_SCENE_OFF messages. In other words, it's not a single variable that is toggling, it's two separate ones.
Nice spottet!
Change line 182 in L_Arduino.lua from
if ((value ~= curValue) or (curValue == nil)) thento:
if ((value ~= curValue) or (curValue == nil) or (serviceId == "urn:micasaverde-com:serviceId:SceneController1")) thenSo the sl_SceneActivated/sl_SceneDeactivated variables are updated unconditionally
-
Hi
After the Node and Scenecontroller shows up in the Vera UI you have to create a scene and then asign the scenecontroller as a trigger:

For button 1 the scene number is 0
for button 2 the scene number is 1 and so on.Hope is helps ;-)
-
@Dalhoj is it possible to have one button stop/start the same scene, as an on/off switch for a light for example?
-
@Dalhoj is it possible to have one button stop/start the same scene, as an on/off switch for a light for example?
-
I dont know if you can have a 1 sec press!
but i uses LUUP and a simple ex could be turn on a lamp and if the lamp if on turn it off:
local relay1 = 114 --Light ID
local relay1_status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", relay1) --Status of Light
if (relay1_status == "0") then
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" }, relay1)
else
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" }, relay1)
endOr you can use a toggle from the advanced scene menu:
That is how I do it.
-
I dont know if you can have a 1 sec press!
but i uses LUUP and a simple ex could be turn on a lamp and if the lamp if on turn it off:
local relay1 = 114 --Light ID
local relay1_status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", relay1) --Status of Light
if (relay1_status == "0") then
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" }, relay1)
else
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" }, relay1)
endOr you can use a toggle from the advanced scene menu:
That is how I do it.
-
@Dalhoj said:
I dont know if you can have a 1 sec press!
I mean that the Arduino checks if user presses button for one sec and send the SCENE_OFF. You probably shouldn't let Vera handle this.
@hek said:
I mean that the Arduino checks if user presses button for one sec and send the SCENE_OFF. You probably shouldn't let Vera handle this.
I would make the Arduino send ie. for button 1 send scene ID 0 at short press and scene ID 1 for long press and so on.
@Nuubi Here is two of my scene controllers:
The first one is installed in my bedtable
and is a combination of a scenecontroller and a relaysensor for controling the 3 leds.
The 2. is installed in the living room, and is a 8 button scenecontroller.
It controlles- the lights in the living room
- Blinds Open / Close
- a power outlet On/Off
- pause/plays my XBMC Medie Center
- starts my Yamaha reciver and starts playing net radio
- stops the radion again and turn of the reciver
- turns up / down the volume on the reciver
That is what I use it for at the moment.
-
@hek said:
I mean that the Arduino checks if user presses button for one sec and send the SCENE_OFF. You probably shouldn't let Vera handle this.
I would make the Arduino send ie. for button 1 send scene ID 0 at short press and scene ID 1 for long press and so on.
@Nuubi Here is two of my scene controllers:
The first one is installed in my bedtable
and is a combination of a scenecontroller and a relaysensor for controling the 3 leds.
The 2. is installed in the living room, and is a 8 button scenecontroller.
It controlles- the lights in the living room
- Blinds Open / Close
- a power outlet On/Off
- pause/plays my XBMC Medie Center
- starts my Yamaha reciver and starts playing net radio
- stops the radion again and turn of the reciver
- turns up / down the volume on the reciver
That is what I use it for at the moment.
-
Its a danish enclosure: http://www.lk.dk/produkter/afbrydermateriel-lk-fuga/lk-fuga/antibakteriel/underlag/baseline-2-modul-346dd488/ for the button one and: http://www.lk.dk/produkter/afbrydermateriel-lk-fuga/lk-fuga/antibakteriel/underlag/baseline-1-modul-hvid/ for the top one.
Its a danish department of Schneider Electric called LK(Lauritz Knudsen)