Hi everybody, i’m new to Homeassistant and struggling with my first automation.
I want to turn the light in bedroom on when it’s time for wakeup (well, toggling the light while testing). I’m setting the time on my smarthome where the companion app is installed. The time show up in my dashboard and after a few days reading and trying, i was able to set a datetime helper with an automation script.
But the automation script for turnng the light on is not triggered by the datetime help and i don’t know why.
Please, can someone help me?!
configuration.yaml
default_config:
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor:
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'date_time_utc'
- 'date_time_iso'
- 'time_date'
- 'time_utc'
python_script:
example state: sensor.mi_9_nachster_wecker
Local Time: 'Sat Oct 24 19:56:00 GMT+02:00 2020'
Package: com.vp.alarmClockPlusDock
Time in Milliseconds: 1603562110000
friendly_name: MI 9 Nächster Wecker
icon: 'mdi:alarm'
device_class: timestamp
automation: set datetime helper
alias: Weckzeit einstellen
description: ''
trigger:
- platform: state
entity_id: sensor.mi_9_nachster_wecker
condition: []
action:
- service: input_datetime.set_datetime
entity_id: input_datetime.wecker
data:
datetime: >-
{{ strptime(state_attr('sensor.mi_9_nachster_wecker', 'Local Time'), '%a
%b %d %H:%M:%S %Z%z %Y') }}
mode: single
automation: toggle light
alias: Licht schalten
description: ''
trigger:
- platform: time
at: input_datetime.wecker
condition: []
action:
- type: toggle
device_id: 9a932a9b0b315310b1155884b2c7e3af
entity_id: switch.shelly_sz_licht_relais
domain: switch
mode: single