- 积分
- 214
- 金钱
- 197
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
中级会员
- 积分
- 214
- 金钱
- 197
- HASS币
- 0
|
本帖最后由 qwe7896980 于 2022-11-14 15:18 编辑
请问在MQTT推过来的数据,怎么才可以生成实体设备?
就是我现在在MQTT发送过来HA的,都是只有传感器类型,怎样才可以变成一个设备里面包含这堆传感器呢?
下面是MQTT发送到HA的代码,是发送的少了哪个参数?还是说HA哪里要设置吗?谢谢
传感器1:{"name": "xiaojuzi_dis_inuse", "state_topic": "homeassistant/sensor/xiaojuzi/state", "unit_of_measurement": "%", "dis_inuse": "", "unique_id": "xiaojuzi_dis_inuse", "entity_id": "xiaojuzi", "value_template": "{{ value_json.dis_inuse}}"}
配置:homeassistant/sensor/xiaojuzi_dis_inuse/config
传感器2:{"name": "xiaojuzi_sys_ontime", "state_topic": "homeassistant/sensor/xiaojuzi/state", "unit_of_measurement": "\u5929", "sys_ontime": "", "unique_id": "xiaojuzi_sys_ontime", "entity_id": "xiaojuzi", "value_template": "{{ value_json.sys_ontime}}"}
配置:homeassistant/sensor/xiaojuzi_sys_ontime/config
状态数据路径 homeassistant/sensor/xiaojuzi/state
|
|