#day and night - automation
1 messages · Page 1 of 1 (latest)
What do you mean by "switches back and forth between day and night"?
I have created a helper which I have named input_boolean.tagnacht. Now I want to set the helper to True for day and False for night. But I would like to have both in one automation. (This is probably the easiest automation in the world but I can't get it to work)
Gotcha.
The easiest way to do this is with the sun sensor. You could do it without the automation even - just a template sensor that checks it
EG. {{'night' if states('sun.sun') == 'below_horizon' else 'day' }}
A template! Thank you for the obvious solution!!!
No worries 🙂
Of use no helper and use only sun.sun
I need it as a boolean and not as ON / OFF 🙂 how do I have to change the template for this?
My helper now looks like this ... {{ 0 if states('sun.sun') == 'below_horizon' else 1 }} And this is what my knx.yml looks like. ... expose: - type: binary entity_id: binary_sensor.tagnacht address: "14/0/11" Thank you very much