Hello again,
I´m getting more and more excited about Hassio, so I´m hope I´m not asking to much questions…
I created 2 test automation rules that triggers an notification event with an email:
> - id: '1532328312499'
> alias: auto-test1
> trigger:
> - entity_id: switch.homeserver
> from: 'off'
> platform: state
> to: 'on'
> condition: []
> action:
> service: notify.notifyup
> data:
> title: Homeserver is online
> message: Homeserver is online
> - id: '1532328808479'
> alias: auto-test2
> trigger:
> - entity_id: device_tracker.ipadphilipp
> event: enter
> platform: zone
> zone: zone.home
> condition: []
> action:
> service: notify.notifyup
> data:
> title: Philipp is at home
> message: Philipp is at hone
The first rule sends an email, that is fine. However, the second rule is supposed to send me an email when the ipad arrives at home, but it´s not executed at all, although the logbook says “ipad-philipp is at home”
Is there something wrong with the syntax?
can you format your code correctly please? (Check the blue bar on top of this page)
Also can you confirm how you track your ipad’s location? (Owntracks?HA iOS App, Google, other?)
ok, you can’t use this trigger with this device tracker:
basically this is what you need to read:
Zone triggers can trigger when an entity is entering or leaving the zone. For zone automation to work, you need to have setup a device tracker platform that supports reporting GPS coordinates
you need to amend your automation to be when your ipad’s status is home:
trigger:
platform: state
entity_id: device_tracker.ipadphilipp
to: 'home'
Another thing I´m stuck with my testing: The goal is not just sending an email, but also turning on a specifc power socket for 30 seconds.
But no matter where or how I put the delay, the config check gives me an error: (I just think I havn´t understood the right synax by now)
Invalid config for [automation]: [delay] is an invalid option for [automation]. Check: automation->action->2->delay. (See /config/configuration.yaml, line 184). Please check the docs at https://home-assistant.io/components/automation/
- id: '1532328808479'
alias: auto-test2
trigger:
- entity_id: device_tracker.ipadphilipp
platform: state
to: home
condition: []
action:
- data:
message: Philipp is at home
title: Philipp is at home
service: notify.notifyup
- alias: ''
service: switch.turn_on
data:
entity_id: switch.fritzpowerline01
delay: '00:00:30'
service: switch.turn_off
data:
entity_id: switch.fritzpowerline01
You have 2 occurrences of alias for starter, that should not be there
also you are listing your actions with a dash, you need one for your delay and your last action too
- id: '1532328808479'
alias: auto-test2
trigger:
- entity_id: device_tracker.ipadphilipp
platform: state
to: home
condition: []
action:
- data:
message: Philipp is at home
title: Philipp is at home
service: notify.notifyup
- service: switch.turn_on
data:
entity_id: switch.fritzpowerline01
- delay: '00:00:30'
- service: switch.turn_off
data:
entity_id: switch.fritzpowerline01