automation:
trigger:
platform: state
entity_id: device_tracker.paulus
action:
service: notify.notify
data_template:
message: >
Paulus just changed from {{ trigger.from_state.state }}
to {{ trigger.to_state.state }}
trigger.event 触发事件,下面的例子新设备连入HA将发推送信息
#发现新设备
- alias: Notify for new devices
trigger:
platform: event
event_type: device_tracker_new_device
action:
- service: notify.notifypushbullet
data_template:
message: >
New device:
{{trigger.event.data.host_name}}
({{trigger.event.data.entity_id}})
title: New device