I have a roof window from Velux which I can control via the Velux KLF200 Gateway. The Problem is, that this Gateway is only supporting Scenes without Feedback, so I have no status.
For the window I solved this with a Window Sensor.
For the Blind/Shutter I have set the following value_template:
Can I extend this to a time dependend rule? Eg. Before Sunrise and After Sunset it shows me âNIGHTâ and in between the Stauts Open and Closed depending on the luminance?
Yes. What you typed out is correct but hard to read without indents. Also, you should use formatting and if you are doing multiline (use the > without quotes):
value_template: >
{% if states.sensor.arbeitszimmer_dach_motion_sensor_luminance %}
{% if states.sensor.arbeitszimmer_dach_motion_sensor_luminance.state < "20" %}
{% if states.sun.sun.state == "below_horizon" %}
Night
{% else %}
Closed
{% endif %}
{% else %}
Open
{% endif %}
{% else %}
N/A
{% endif %}
I tried this config, but I have a very strange behaviour, although I cahnged the threshold from 20 to 20.0
If the luminace is 0.0 or 0.1 it shows Closed
If the lumincane is 0.2 up to 0.9 it shows Open
from 10.0 to 19.9 it is again Closed
from 20.0 it is again Open