dawnlord
(Christer)
February 18, 2018, 4:03pm
1
I want to have an automation triggered by input_select but cant get it to work.
automations.yaml:
alias: ‘God morgon’
initial_state: true
trigger:
platform: template
value_template: ‘{{ states.sensor.time.state == states.input_select.wake_up_time.state }}’
input_selects.yaml:
wake_up_time:
name: ‘Alarm soluppgång’
initial: “07:00”
options:
- “00:00”
- “00:15”
- “00:30”
- “00:45”
sensor.yaml:
platform: time_date
display_options:
‘time’
‘date’
‘date_time’
‘time_date’
‘time_utc’
‘beat’
Oh, best to use the code formatting tool. It’s </> in the comment tool box (select the text and click the </> over it)
Otherwise there’s no way to know if it’s the code formatting or not.
dawnlord
(Christer)
February 18, 2018, 4:48pm
3
#automations.yaml:
- alias: 'God morgon'
initial_state: true
trigger:
- platform: template
value_template: '{{ states.sensor.time.state == states.input_select.wake_up_time.state }}'
#input_selects.yaml:
#alarm / soluppgång
wake_up_time:
name: 'Alarm soluppgång'
initial: "07:00"
options:
- "00:00"
- "00:15"
- "00:30"
- "00:45"
#sensor.yaml:
# time
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'time_date'
- 'time_utc'
- 'beat'
keithh666
(Keith Hull)
February 18, 2018, 5:38pm
4
You would probably be better off reading thru’ this thread…
I didn’t find a component to create an alarm clock for my difficult morning, so i implement that.
It’s composed with simple modules
input_boolean :
reveil:
name: Reveil positionné
initial: off
icon: mdi:alarm
lightreveil:
name: Reveil Naturel
initial: off
icon: mdi:theme-light-dark
We declare 2 input_boolean to turn on the TV and to turn on bedroom’s light
input_select:
choixreveil:
name: "reveil matin"
icon: mdi:alarm
initial: "06:35"
op…
It’s quite long but will help you to understand what’s needed
dawnlord
(Christer)
February 18, 2018, 6:03pm
5
It was actually from that thread i got this
dawnlord
(Christer)
February 18, 2018, 6:09pm
6
I want to replace the static time (07:00) with input_select.
Current working automation:
- alias: 'God morgon'
initial_state: true
trigger:
- platform: time
at: 07:00:00
- platform: state
entity_id: group.all_devices
to: home
condition:
- condition: state
entity_id: group.all_devices
state: home
- condition: state
entity_id: input_select.status_hemma
state: 'Hemma'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
keithh666
(Keith Hull)
February 18, 2018, 9:04pm
7
The following works in the templates editor…
{{ states.sensor.time.state == states.input_select.wake_up_time.state }}
with the …
wake_up_time:
name: Alarm wakeup
options:
- "20:00"
- "20:15"
- "20:30"
- "20:45"
initial: "20:15"
This differs from yours as I specify the hours and the minutes.
dawnlord
(Christer)
February 18, 2018, 11:47pm
8
Still cant figure out why it is not working
Automation:
- alias: 'God morgon'
initial_state: true
trigger:
# - platform: time
# at: 07:00:00
- platform: template
value_template: '{{ states.sensor.time.state == states.input_select.wake_up_time.state }}'
- platform: state
entity_id: group.all_devices
to: home
- plattform: state
entity_id: input_boolean.alarmstatus
state: on
condition:
- condition: state
entity_id: group.all_devices
state: home
- condition: state
entity_id: input_select.status_hemma
state: 'Hemma'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
Input_select:
#alarm / soluppgång
wake_up_time:
name: 'Alarm soluppgång'
initial: "07:00"
options:
- "00:00"
- "00:15"
- "00:30"
- "00:45"
- "01:00"
- "01:15"
- "01:30"
- "01:45"
- "02:00"
- "02:15"
input_boolean:
alarmstatus:
name: Wake Me Up
initial: off
icon: mdi:alarm-check
keithh666
(Keith Hull)
February 18, 2018, 11:52pm
9
It’s because you are specifying two different things an initial state of the input_select as “07:00” and expecting the program to realise that you want to add an offset to the initial state and compare that, well it won’t do that! Did you not read what I posted above?
- “20:00”
- “20:15”
- “20:30”
- “20:45”
dawnlord
(Christer)
February 18, 2018, 11:57pm
10
This two lines arent used if they have hash marks in front?
# - platform: time
# at: 07:00:00
Or are you referring to this line?:
initial: “07:00”
keithh666
(Keith Hull)
February 19, 2018, 12:15am
11
Input_select:
#alarm / soluppgång
wake_up_time:
name: 'Alarm soluppgång'
initial: "07:00"
options:
- "00:00"
- "00:15"
- "00:30"
- "00:45"
- "01:00"
- "01:15"
- "01:30"
- "01:45"
- "02:00"
- "02:15"
This won’t work the way you seem to think it will as above I specified the exact hr and min not an inital start and an offset.
You know you don’t have an action defined, right?
keithh666
(Keith Hull)
February 19, 2018, 12:16am
13
Hmm I assumed that was not there because he didn’t want to clutter the output
1 Like
dawnlord
(Christer)
February 19, 2018, 12:17am
14
I have several actions defined
Which could be true, but then what if the problem with the automation is actually in the action and we could tweak the triggers until we’re old and grey and still get nowhere
keithh666
(Keith Hull)
February 19, 2018, 12:21am
17
easy way to test the actions is to trigger it manually, does it work if you click the automation in the frontend then click trigger?
dawnlord
(Christer)
February 19, 2018, 12:22am
18
I will try and remove the line " initial: “07:00”
All the actions are working with this triggers and conditions:
Automation:
- alias: 'God morgon'
initial_state: true
trigger:
- platform: time
at: 07:00:00
- platform: state
entity_id: group.all_devices
to: home
condition:
- condition: state
entity_id: group.all_devices
state: home
- condition: state
entity_id: input_select.status_hemma
state: 'Hemma'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
keithh666
(Keith Hull)
February 19, 2018, 12:26am
19
The above should be …
Input_select:
#alarm / soluppgång
wake_up_time:
name: ‘Alarm soluppgång’
initial: “07:00”
options:
- “07:00”
- “07:15”
- “07:30”
- “07:45”
- “08:00”
- “08:15”
- “08:30”
- “08:45”
- “09:00”
- “09:15”
etc etc.
Ah, so it’s a secret.
Ok. Is it OK to tell us if you have a time sensor somewhere in your configuration?
Is it OK to tell us if @keithh666 's suggestion worked 3 hours ago?