你好,@xman111- 这有可能巩固事物。
首先,创建一个通知组 - 然后您需要做的就是通知该组,而不是单独通知每个人。将以下内容放在您的configuration.yaml
在下面通知:
(或在您的通知
文件,如果您使用的是),并且不幸的是,没有通知的重新加载,因此您必须重新启动(除非其他人知道一种更简单的方法):
- 平台:组名称:family_devices服务: - 服务:Mobile_app_richelles_s10_mobile_app-服务:Mobile_app_craigs_s20_mobile_app
涉及通知组的参考:Notify Group-家庭19463331伟德国际助理(Home -Assistant.io)
然后,在自动化中,这样的结构:
- alias: Zone Notifications trigger: - platform: zone entity_id: - device_tracker.person_one - device_tracker.person_two - device_tracker.person_three zone: zone.home event: enter - platform: zone entity_id: - device_tracker.person_one - device_tracker.person_two - device_tracker.person_three zone: zone.home event: leave - platform: zone entity_id: - device_tracker.person_one - device_tracker.person_two - device_tracker.person_three zone: zone.school event: enter - platform: zone entity_id: - device_tracker.person_one - device_tracker.person_two -device_tracker.person_three Zone:Zone.School事件:离开操作: - 服务:notify.family_devices数据:> {%if trigger.event ==“ fell”%} {{trigger.zone.attributes.friendly_name}}} {%else%} {{trigger.from_state.attributes.friendly_name}}} entered {{trigger.zone.zone.attributes.tributes.frirlly_name}}} {%endif%} {%endif%} {%endif%} {%
我在自动化中使用了两个“配对” - 一个用于家
还有一个学校
。您可以复制/粘贴这些以在自动化中添加更多区域。我找不到可以将它们组合在一起的地方将其简化为进一步简化的类似(也许将来的更新将解决):
区域: - Zone.Home-区域。学校
这行动
然后是服务
致电您在通知:
配置文件的部分。模板数据
部分只需从触发器
和trigger.entity_id
。请注意,模板是通用的,当您有更多区域到触发部分时,不需要更改。
来干净:我无法完全测试它,但是它确实通过了配置检查…![:crossed_fingers: :交叉手指:](//www.sz-tiancheng.com/community/images/emoji/twitter/crossed_fingers.png?v=9)
让我知道您是否遇到问题!