Hello, I am now to Home Assistant but already enjoying it. I have some automations set up (for example, lights on when I come home). But the following one doesn’t seem to trigger. It is in the morning when I wake up, that the livingroom lights turn on at a set time (06:30) but only if certain conditions are met. I tried to compare them with the other automations (which do work) but can’t find anything wrong with it.
The slides are set to:
- sl_wu_hr: 6
- sl_wu_mn: 30
configuration section:
binary_sensor:
- platform: workday
name: Workday Morning
country: UK
sl_wu_hr:
name: Wake-up Hrs
min: 0
max: 23
step: 1
sl_wu_mn:
name: Wake-up Min
min: 0
max: 55
step: 5
Automation section:
id: livingroom_lights_on_on_workdays
alias: Livingroom light ON on workdays morning
trigger:
platform: template
value_template: '{{ now.time().strftime("%-H") == states.input_number.sl_wu_hr.state and now.time().strftime("%-M") == states.input_number.sl_wu_mn.state }}'
condition:
condition: and
conditions:
- condition: state
entity_id: 'binary_sensor.workday_morning'
state: 'on'
- condition: sun
before: sunrise
before_offset: "+1:00:00"
- condition: or
conditions:
- condition: state
entity_id: device_tracker.stephan
state: 'home'
- condition: state
entity_id: device_tracker.catherine
state: 'home'
action:
service: homeassistant.turn_on
entity_id: group.lights_livingroom