Hi
I have some presence detection units which after a period of time of inactivity, switch off devices like lights etc… So far I have 2 automations, 1 for during the day and another for evening times where the rule for how long to wait for inactivity varies between the two.
what I wanted to do is add in more granularity for times across the day to vary this even more.
I have created input_numbers to hold the specific values of change for minutes and seconds for the 5 conditions but it seems the code I have written does not work. Im not sure why as am new to the template scene.
Any pointers on what I can do to achieve the desired output?
Here is what I have now.
type: no_motion
platform: device
device_id: 65ggccc01234kjdvfc60a140900dff
entity_id: binary_sensor.hall_sensor
domain: binary_sensor
for:
hours: 0
{% if is_state('binary_sensor.Morning', 'on') %}
minutes: '{{ states('input_number.hall_noactivity_morning_min')|float }}'
seconds: '{{ states('input_number.hall_noactivity_morning_sec')|float }}'
{% elif is_state('binary_sensor.Late_Morning', 'on')%}
minutes: '{{ states('input_number.hall_noactivity_latemorning_min')|float }}'
seconds: '{{ states('input_number.hall_noactivity_latemorning_sec')|float }}'
{% elif is_state('binary_sensor.Afternoon', 'on')%}
minutes afternoon: '{{ states('input_number.hall_noactivity_afternoon_min')|float }}'
seconds: '{{ states('input_number.hall_noactivity_afternoon_sec')|float }}'
{% elif is_state('binary_sensor.Evening', 'on')%}
minutes evening: '{{ states('input_number.hall_noactivity_evening_min')|float }}'
seconds: '{{ states('input_number.hall_noactivity_evening_sec')|float }}'
{% endif %}
milliseconds: 0
Thanks