I would need your help. Namely, I want to create a single (if that is even possible) automation that will allow me to do everything of the following list. I would like to make the automation as efficient as possible. From what I’ve read in the various URIs, this will also require helpers.
when motion detected → light on
if no motion detected for a short time, light off (use the Aqara Motion Sensors without hardware hack)
light should be switched on only from a certain brightness (about 20 lx)
light should have less brightness in the night than in the evening (evening → 70 %, night → 1 %)
before the light goes out in the evening, dim it to 30 % (when motion is detected, dim it back to 70 %)
Now my question: Is this at all possible in an automation? Does anyone of you possibly already have one or the other automation that goes in this direction? Or would NodeRED be the better choice in this regard, since the Aqara sleep without hack for a minute.
If I try to add it, i get the error: message malformed - expected dictionary. And I don´t have a switch, fan and occupancy sensor atm. Will it work if i change the occupancy sensor to the motion sensor but let the 2 minutes there?
The automation serves as an example for anyone to modify for their own use. Feel free to change it to meet your requirements. If you get errors, review your modifications.
Currently, no. I’ve been running two instances of the automation for over a year.
Light, Motion Sensor, Light Level Sensor. Input boolean ans sun are default available, or am I wrong? i would use a wall switch from philips hue (dim switch). and with switch you mean socket or a switch like my dim switch?
So if I get it right (switch is a switch, no socket and input boolean & sun are default availabe) only the occupancy sensor isn‘t needed in the code. Thank you in advance!
I’ve replaced the example’s entities with the ones you supplied. The example’s occupancy sensor is simply replaced by your existing motion sensor.
What I have not done is adapt it to meet your schedule-based brightness requirements (it simply sets the light to about 50% between sunset and 23:30 and 10% between 23:30 and sunrise). You will need to implement all other modifications to meet your requirements.
Is it possible to use an elseif or elif in the template of brightness? I need a third value (lo for early morning, med for later morning and high for the noon for example). It’s more a general question, but i’m struggelin every time i try to adapt your/such a template with a second condition…
Sorry to bother you, just a last question. With this shorthanded notation (i think it is called {{value if condition else another value}} ) if - elif - else is not possible, right?
Thank you so much, you gave me the missing piece of the puzzle, i now understand the syntax of the shorthanded template (with more than one if in it).
Your answer is really appreciated.