I’ve been reading on automation’s and looking at example etc.
And I think my configuration should work but it does not, and I don’t understand why. Any help would be appreciated.
I want my MQTT light to turn on at the indicated time.
mqtt:
broker: XXX
username: XXX
password: XXX
sensor:
- platform: time_date
display_options:
- 'time'
light:
- platform: mqtt
name: "Bed Light"
state_topic: bedroom/bedlight/state
command_topic: bedroom/bedlight/command
payload_on: "on"
payload_off: "off"
input_datetime:
bed_light:
name: Start bedlight
has_time: true
automation:
- alias: control bed lights
trigger:
platform: template
value_template: "{{ states('sensor.time') == (states.input_datetime.bed_light.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}"
action:
- service: light.turn_on
data:
entity_id: light.bed_light