本帖最后由 ABC 于 2017-8-19 10:36 编辑
已修复场景scene
hassbian的操作方法,其他系统请自己查找homebridge-homeassistant插件的路径 .
脚本打开查看摄像头http://v.youku.com/v_show/id_XMj ... m=a2hzp.8253869.0.0
homebridge-homeassistant插件版本要求:2.1.0 下载附件并把附件解压,得到homebridge-homeassistant文件,并放在homeassistant文件夹里
打开putty,运行
sudo rm -rf /usr/lib/node_modules/homebridge-homeassistant
sudo cp -r /home/homeassistant/.homeassistant/homebridge-homeassistant /usr/lib/node_modules/
sudo nano /var/homebridge/config.json
编辑配置文件,在这里增加了script和automation
- platform: template sensors:
battery_hello:
friendly_name: 'iwatch电量'
unit_of_measurement: '%'
value_template: '{{ states.device_tracker.hello.attributes.battery | round(2) }}'
hello_battery_status:
friendly_name: 'iwatch充电状态'
value_template: '{{ states.device_tracker.hello.attributes.battery_status }}'
device_tracker.hello:
friendly_name: 手表
icon: mdi:watch
homebridge_battery_source: sensor.battery_hello
homebridge_charging_source: sensor.hello_battery_status
重启homebridge
sudo systemctl restart homebridge
同理binary_sensor也可以用这个方法,因为小米的传感器是没有充电状态的,所以只需要写入homebridge_battery_source:
sensor.illumination_286c0788b403: friendly_name: 一楼光感
icon: mdi:white-balance-sunny
homebridge_sensor_type: lightStall
sensor.illumination_f0b429b44b3b:
friendly_name: 二楼光感
icon: mdi:white-balance-sunny
homebridge_sensor_type: lightStall
sensor.waqi_dongguan:
friendly_name: 室外空气
icon: mdi:pine-tree
homebridge_name: 空气质量
homebridge_sensor_type: air_quality
注意,这里也是添加最后一句homebridge_sensor_type: air_quality
重启后可以在homekit中显示
|