jeppper
(Jeppper)
1
I want to use an input select for time and then trigger an action when this occurs, but nothing happens. Can someone see what is wrong?
input_select:
select_light_time:
name: Light ON at
options:
- "21:35"
- "09:40"
- "08:45"
- "08:50"
- "08:55"
initial: "21:35"
- alias: Light ON 6.30
trigger:
platform: template
value_template: '{{ states.input_select.select_light_time.state }}'
condition:
condition: and
conditions:
- condition: sun
before: sunrise
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: switch.turn_on
entity_id: switch.sonoff_1_light
keithh666
(Keith Hull)
2
I think you are triggering on the state of the input_select changing not the time being at whatever you’ve set in the input_select
jeppper
(Jeppper)
3
okay that sounds plausible but do you know what must be changed to make it work then?
keithh666
(Keith Hull)
4
This what I do for my alarm…
- alias: 'Wake Me Up'
initial_state: 'on'
trigger:
- platform: time
minutes: '/1'
seconds: '0'
condition:
condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.alarmstatus
state: 'on'
- condition: state
entity_id: input_boolean.alarmweekday
state: 'on'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- condition: template
value_template: '{{ now().time().strftime("%R") == states.sensor.alarm_time.state }}'
- condition: and
conditions:
- condition: state
entity_id: input_boolean.alarmstatus
state: 'on'
- condition: state
entity_id: input_boolean.alarmweekday
state: 'off'
- condition: template
value_template: '{{ now().time().strftime("%R") == states.sensor.alarm_time.state }}'
action:
I trigger every minute then check against now().time().strftime("%R") == states.sensor.alarm_time.state