Hi, I wish to arm my System Alarm automatically every night (from 23:30 to 06:00) in “home” mode if my smartphone is connected to my router.
Then I created this automation code… but it do not arm the alarm… why???
What is wrong?
- alias: system alarm home automatic on night
trigger:
- platform: state
entity_id: device_tracker.samsung_s8_wifi
to: 'home'
- platform: state
entity_id: device_tracker.samsung_s8_bt
to: 'home'
condition:
condition: and
conditions:
- condition: time
before: '06:00:00'
after: '23:30:00'
- condition: state
entity_id: alarm_control_panel.ha_alarm
state: 'disarmed'
action:
service: alarm_control_panel.alarm_disarm
data: {"entity_id":"alarm_control_panel.ha_alarm","code":"1234"}
Now I edited it… with two automations
Now in Italy is 11:45
I configured to arm alarm after 11:00 … I restarted home assistant… but it do not arm alarm in home mode
- alias: system alarm home automatic on
trigger:
- platform: state
entity_id: device_tracker.samsung_s8_wifi
to: 'home'
- platform: state
entity_id: device_tracker.samsung_s8_bt
to: 'home'
condition:
- condition: time
after: '11:00:00'
- condition: state
entity_id: alarm_control_panel.ha_alarm
state: 'disarmed'
action:
service: alarm_control_panel.alarm_disarm
data: {"entity_id":"alarm_control_panel.ha_alarm","code":"1234"}
- alias: system alarm home automatic off
trigger:
- platform: state
entity_id: device_tracker.samsung_s8_wifi
to: 'home'
- platform: state
entity_id: device_tracker.samsung_s8_bt
to: 'home'
condition:
- condition: time
after: '06:00:00'
action:
service: alarm_control_panel.alarm_disarm
data: {"entity_id":"alarm_control_panel.ha_alarm","code":"1234"}