本帖最后由 lidicn 于 2018-3-27 09:43 编辑
通过Template Sensor将device_tracker转成友好的Sensor:
sensor:
- platform: template
sensors:
mate7:
friendly_name: '小米mix2'
value_template: "{{ '在线' if is_state('device_tracker.mix2', 'home') else '离线' }}"
mibox:
friendly_name: '小米盒子'
value_template: "{{ '在线' if is_state('device_tracker.mibox3s', 'home') else '离线' }}"
miaisoundbox:
friendly_name: '小爱同学'
value_template: "{{ '在线' if is_state('device_tracker.miaisoundbox', 'home') else '离线' }}"
notebook:
friendly_name: '渣渣笔记本'
value_template: "{{ '在线' if is_state('device_tracker.notebook', 'home') else '离线' }}"
haier_elecboiler_online:
friendly_name: '海尔电热水器'
value_template: "{{ '在线' if is_state('device_tracker.haier_elecboiler', 'home') else '离线' }}"
配置自动化检测在线离线:
参考文档:
- https://home-assistant.io/components/sensor.template/
- https://bbs.hassbian.com/thread-1054-1-1.html
|