thanks, it is.
just cooked it up for OP.
right.
Motion Based Light EXCEPT when Manually turned On
You are DA MAN! I have two more questions:
- I assume it only works with booleans, correct?
- Does it also work on globals?
Thanks to all the posters above; Iâve taken the examples for inspiration and adjusted for my use case:
I wanted the physical switch to pretty much continue to operate as a âdumbâ switch; but also add some motion controlled smarts for general use. Iâm using the Aeotec Nano Dimmer (as Iâm in the UK and the switches donât work with my wiring).
The physical switch operates as an override to the motion detection, so if you switch it off, motion detection is ignored for the next hour. Operating the physical switch while it is in override mode just drops it back to motion detection controlled. This way if âsomeoneâ forgets to turn the light off in override mode it will still eventually turn itself offâŚ
I had a hard time understanding the logic in the first example post, as I didnât realise that the âprogrammaticâ variable was actually a workaround to the piston not being able to differentiate âphysicalâ and âprogrammaticâ. All in all good practice and a learning experience. Very open to any suggestions on how to optimise my code
I love this idea but would like some help with my situation. What I would like is for my motion to turn on my bulbs for 5 minutes and then turn off if no activity. If the light is manually (ST) turned on, then remain on until manually turned off. I have a âSleep Switchâ that I use that basically disables the motion during sleeping time (so the light doesnât come on when we go to the bathroom and wake the other person up). In a strange way (timer set for 8 hours) I have the sleep switch turn off - thus the motion is reactivated. I also have a different piston that is supposed to turn on these same lights when my alarm goes off.
How can I incorporate all that into 1 (or 2) pistons? I canât get my mind to think in combining so I have a ton of pistons running and I think they are getting as confused as I am.
The problem you are going to run into is that it is very difficult to discern the switch turning on based on motion and the switch turning on manually. Also, if your motion sensor is in the room, and so is the switch, wonât it ALWAYS turn on by motion first? And now that the switch is on, you canât turn it on again physically. Itâs already on. So, to turn it on, you have to turn it off first. What you need is a second switch or button device to use as a manual override. MUCH simpler.
not really. this is already handled in the pistons in the first post in this thread.
this off course depends on the placement of the motion sensor. you could also always turn the switch off and on for manual override mode.
Then that would be a LOT simpler than what you have here. If motion is active and the light turn off followed by within X seconds turns back on, then set manual override. Much simpler, IMHO.
Isnât that a lot easier and more reliable?
how does it get set to false?
once you type out the whole piston ⌠it wont be any easier or any more reliable.
It gets set to false when you turn the lights off manually. Because they wonât be shut off by the motion sensor, because that is the whole point of the piston.
Alternatively, you could use this function to set a longer waiting period for the motion sensor to turn off the lights instead of the shorter one. Then when the lights turn off, you reset to the lower value of waiting for no motion.
The point is, I think that this is a way to get to the end goal. Iâm not saying yours doesnât work. I just think this is an alternative method that might be a little easier for others to be able to implement themselves.
Respectfully, I disagree.
well ⌠share a working piston that does all of the same but is lot easier and more reliable.
without that there is nothing to compare to.
yeah see that now.
the original is 50 lines of code and this one is 55 lines of code without the setLevel. how is that any simpler?
have you tried it ⌠does it work?
Why are you so eager to try to maintain that yours is the only solution? I didnât say yours wouldnât work. In fact I said the exact opposite. I just said that this was a different way to accomplish the same thing. And is a lot easier to follow, to me. So, why the hostility? I didnât say your idea was bad or wrong or anything. But you seem hell bent to be the only one with the right answer. And I donât understand that.
And on that noteâŚIâm done with this thread. I really couldnât care any less what you think or believe. Obviously itâs important to you that no one provide any alternative ideas, so I wonât.
when did i say mine was the only solution? or that your idea was bad or wrong? asking questions does not have to mean hostility - does it?
my last question was - does it work?
if you have tested it and if it does work i will be happy to share your example from the main post.
Why believe me? Why donât you try it out for yourself. That way youâll know for sure.
There is a piston that I have that does something a little different that Iâve been using for years and uses no variables at all. This is more complicated because itâs setting different levels based on location mode but it doesnât rely on variables to be set at all. And the best partâŚbecause of the LEDs in my bathroom lights, 85% is indistinguishable by the naked eye from 100%. So, setting them to 100% has no appreciable difference in the lighting and acts as a bypass, without have to set variables and set them back. So, hereâs a 3rd way to do it.
And boiled down to JUST the motion sensing part.
Tell me THATâs not simpler? That works 100% of the time.
Hi,
I am using your smart switch, dumm light version with a Fibaro dual relay switch in my kitchen with 2 different lights, seen as independent z wave devices.
I am not managing to make this work, as if I enter both switches as necessary (and) in the logical expressions, the lights do not turn off.
Can you please help?
Thank you
Miltos Vidalis
I had the similar problem using the first version (edsh2). I didnât make any changes except the sensors and lights. I have the Hue bulbs with dumb switch. The lights were turned on with the motion but stayed longer and I had to manually turn them off. This happened three times in the last few days.