Are there any options to recognize if a switch (fibaro) has been manually turned on or if it has been turned on by a scene?
I have a motion sensor and a light. The motion sensor turns on the light and another scene turns it of again after a few minutes. I now want that the light to stay on if it has been manually turned on. What approaches would be possible, any good ideas?
I create one scene that turns the light on when motion is detected. In that same scene, I set a delay of say 10 minutes to turn the light back to the last previous state “the back arrow” above the on button on the device. In the luup section I have the following code:
Pretty much what the code does is that if the light is off, to turn it on, otherwise do nothing. Change 18 to the device number of the corresponding light.
@garrett: OK, that at least prevents that the motion scene turns of the lights when the light is already running. But it is an outdoor light in a seperat little house. So when I leave my main house, the motion sensor outdoor will detect me and turn on the light, so it will always be turned on by the motion sensor. Then I need an option to prevent it from beeing turned off again. But I can’t not just make it dependant from motions since people are nont alwas in the motion sensored area.
@purdue: I know the plugin, but I don’t like it. I am not working with light levels an therefore the plugin does not fit my needs. But I will have a look into the plugin files and see how it is done.
The question is pretty simple (but maybe I am not describing it good enough): Is there any way to detect the difference in between the fibaro-switch beeing turned on from the vera (over zwave) or mechanically/manually on the switch/button itself?
Is it possible to use the fibaro switch as a scenecontroller independant from the light it is connected to? That would a definite solution!
You don’t need to describe the steps in detail, I am a pretty advanced vera user ;D But I am lagging on this one!
i take it you want it to see the difference between switched by motion or switched by wall-switch.
there are 2 (key) switches on the fibaro , the second key/switch can be used for triggering a scene.
it needs some parameters set in the device. not sure how far this is supported by vera.
i try to do the same with the binary sensor that has scene capability for steering 6 scenes , but so far vera doesnt forward the parameters from the device ending up in it being a on/off switch now.
changing parameter 14 to bi-stable switch and parameter 19 to 1
parameter 7 to 1 for device check
the s2 input is connected to group 2, so i take it you need to put some device in group 2 and it would switch with the s2 ?
it doesnt make to much sense to me, but it seems you can use s2 for turning on/off a light or virtual switch separate from s1
for detecting if the hardware switch on s1 is on you could use a fibaro binary sensor and attach a opto-coupler to the input of the binary sensor and the other side to sx and s1 terminal. it has 3v on s1 when switched on. you could also use parameter 17 to 1 so it is used as 3-way switch ( s1 turns on… s2 turns off… another s2 turns on … another s1 turns off… hotel-switch they call it in netherlands)
If there is any type of event in Vera that caused the light to go on you can differentiate those conditions from the light itself being manually initiated. Using sequence expessions in the Program Logic Event Generator
Let’s assume two motions sensors … one light switch
Conditions:
AutoOn = (Motion1;LightSwitch1 < 3) or (Motion2; LightSwitch < 3)
ManualOn = LightSwitch1 and (NOT AutoOn)
You can do something similar for Off Conditions … depending who turns things off.
I am using a variable (plugin Variable Container) to determine if a light is in manual (1) or auto (0) mode.
First I created a scene which gets triggered when the light is turned on and which sets the variable to 1.
Then I created a scene to turn on the light automatically which is triggered by the motion sensor. After a small delay it sets the variable to 0. This same scene also turns the light off, but only if the variable is 0.
[quote=“garrettwp, post:2, topic:172596”]I create one scene that turns the light on when motion is detected. In that same scene, I set a delay of say 10 minutes to turn the light back to the last previous state “the back arrow” above the on button on the device. In the luup section I have the following code:
Pretty much what the code does is that if the light is off, to turn it on, otherwise do nothing. Change 18 to the device number of the corresponding light.
Garrett[/quote]
How would I combine the above with the only at night lua “return luup.is_night ()” in the most condensed code possible?
[quote=“akbooer, post:9, topic:172596”]Not quite sure what drives your search for “the most condensed code possible”, Radjin, but I commend your sentiment.
Note that the code you have previously can neatly be written as:
light = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",18)
return (light == "0") and luup.is_night()
deliver your required result?
AKB[/quote]
Brilliant, thank you. This is what I am looking for if it will check the status of the device and not trigger the scene if the device is already on as well as not trigger during the day.
I am compiling a library of such code with the names of the contributors. Maybe we can update the wiki or post some place so everyone can benefit. Most users will never code but all will at some point need the code to do what the GUI lacks.
[quote=“akbooer, post:9, topic:172596”]Not quite sure what drives your search for “the most condensed code possible”, Radjin, but I commend your sentiment.
Note that the code you have previously can neatly be written as:
light = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",18)
return (light == "0") and luup.is_night()
deliver your required result?
AKB[/quote]
I added this to a scene where the light is triggered by a motion detector in the room, then after a 5 minuet delay shuts off. This however creates the issues where the light blinks off then back on every 5 minuets. How would I add the functionality so that it has a built in timer that shuts off the light in 5 minuets unless the motion is triggered again restarting the 5 minuet countdown? basically what a motion activated light switch would do.
Best Home Automation shopping experience. Shop at Ezlo!