本帖最后由 hobodog 于 2024-2-6 13:04 编辑
根据楼主的JSON修改了一份添加了开关的json文件,可以控制卓虎电表的通断,导入node-red后需要修改三个地方的did和两个地方的token为自己在机智云获取到的
修改token的地方
修改did的地方
configuration.yaml添加如下代码
#卓虎智能
mqtt:
switch:
- name: "卓虎电表开关"
unique_id: zhuohu_sw
state_topic: "api/zhuohu/status"
command_topic: "api/zhuohu/switch"
payload_on: "1"
payload_off: "0"
sensor:
- name: "卓虎电表有功功率"
unique_id: p_value_p1
state_topic: "api/zhuohu/p_value_p1"
value_template: "{{ value }}"
unit_of_measurement: "W"
- name: "卓虎电表总电量"
unique_id: e_value
state_topic: "api/zhuohu/e_value"
value_template: "{{ value }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
- name: "卓虎电表功率因数"
unique_id: pf_value_p1
state_topic: "api/zhuohu/pf_value_p1"
value_template: "{{ value }}"
- name: "卓虎电表电压值"
unique_id: u_value
state_topic: "api/zhuohu/u_value"
value_template: "{{ value }}"
unit_of_measurement: "V"
- name: "卓虎电表电流值"
unique_id: i_value_p1
state_topic: "api/zhuohu/i_value_p1"
value_template: "{{ value }}"
unit_of_measurement: "A"
- name: "卓虎电表电源频率值"
unique_id: f_value
state_topic: "api/zhuohu/f_value"
value_template: "{{ value }}"
unit_of_measurement: "Hz"
- name: "卓虎电表无功功率"
unique_id: q_value_p1
state_topic: "api/zhuohu/q_value_p1"
value_template: "{{ value }}"
unit_of_measurement: "W"
|