本帖最后由 share0808 于 2024-8-3 01:13 编辑
各位大佬好,之前看到有人用485把正泰DDSU666电表接入了HA。所以我就抄了下作业,但是发现一个问题,在HA能源界面没有办法把实体加进去。希望各位大佬帮忙解惑一下!
sensors:
- name: "A相电压"
unit_of_measurement: V # 单位
slave: 1 # modbus硬件地址
slave_count: 2 # 寄存器长度
address: 0x2000 # 寄存器地址
data_type: float32 # 数据类型
device_class: voltage # 设备类型,会根据设备类型提供一个预设的icon
input_type: holding # 寄存器类型 默认也是这个 具体可以看官网
precision: 1 # 数据精度 (保留几位小数)
- name: "A相电流"
address: 0x2002
slave: 1
slave_count: 2
precision: 2
scale: 1
unit_of_measurement: A
data_type: float32
unique_id: "2023062822"
- name: "瞬时总有功功率"
address: 0x2004
slave: 1
slave_count: 2
precision: 2
scale: 1000
unit_of_measurement: W
data_type: float32
unique_id: "2023062823"
- name: "瞬时总功无功功率"
address: 0x2006
slave: 1
slave_count: 2
precision: 2
scale: 1000
unit_of_measurement: W
data_type: float32
unique_id: "2023062824"
- name: "瞬时总视在功率"
address: 0x2008
slave: 1
slave_count: 2
precision: 2
scale: 1000
unit_of_measurement: W
data_type: float32
unique_id: "2023062825"
- name: "总功功率因数"
address: 0x200A
slave: 1
slave_count: 2
precision: 2
scale: 1
unit_of_measurement: dim
data_type: float32
unique_id: "2023062826"
- name: "电网频率"
address: 0x200E
slave: 1
slave_count: 2
precision: 2
scale: 1
unit_of_measurement: Hz
data_type: float32
unique_id: "2023062827"
- name: "有功总电能"
address: 0x4000
slave: 1
slave_count: 2
precision: 2
scale: 1
unit_of_measurement: KWh
data_type: float32
unique_id: "2023062828"
input_type: holding
device_class: energy
state_class: total_increasing
|