本帖最后由 shadowba 于 2021-12-23 14:25 编辑
使用方法,建议8266直接使用仪表内的3.3v、rx、tx、gnd接上后即可,省去485转换具体如下图,严防触电!!!其它类的ttl电平设备可参考接入
esphome:
name: ddsf1352
platform: ESP8266
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: " "
wifi:
ssid: " "
password: " "
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "ddsf1352"
password: "1234567890"
web_server:
port: 80
captive_portal:
uart:
id: mod_bus
tx_pin: 4
rx_pin: 5
baud_rate: 9600
stop_bits: 1
time:
- platform: sntp
timezone: "Asia/Shanghai"
id: sntp_time
servers: "time.windows.com"
modbus:
flow_control_pin: 2
id: modbus1
modbus_controller:
- id: epever
## the Modbus device addr
address: 0x1
modbus_id: modbus1
setup_priority: -10
sensor:
- platform: wifi_signal
name: "WiFi Signal ddsf1352"
update_interval: 60s
- platform: modbus_controller
modbus_controller_id: epever
id: input_voltage
name: "Voltage"
icon: "mdi:alpha-v-circle"
address: 0xB
unit_of_measurement: "V" ## for any other unit the value is returned in minutes
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: epever
id: input_current
name: "Current"
icon: "mdi:alpha-a-circle"
address: 0xC
unit_of_measurement: "A" ## for any other unit the value is returned in minutes
register_type: read
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: input_factor
name: "Factor"
icon: "mdi:alpha-f-circle"
address: 0x10
unit_of_measurement: "Cos φ" ## for any other unit the value is returned in minutes
register_type: read
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.001
- platform: modbus_controller
modbus_controller_id: epever
id: frequency
name: "Frequency"
icon: "mdi:current-ac"
address: 0x11
unit_of_measurement: "Hz" ## for any other unit the value is returned in minutes
register_type: read
value_type: U_WORD
accuracy_decimals: 0
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: array_rated_reactivepower
name: "Reactivepower"
icon: "mdi:alpha-w-circle"
address: 0xE
unit_of_measurement: "Var"
register_type: read
value_type: U_WORD
accuracy_decimals: 0
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: epever
id: array_rated_apparentpower
name: "Apparentpower"
icon: "mdi:alpha-s-circle"
address: 0xF
unit_of_measurement: "VA"
register_type: read
value_type: U_WORD
accuracy_decimals: 0
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: epever
id: Power
name: "energy_power"
icon: "mdi:ev-station"
address: 0xD
unit_of_measurement: "W"
register_type: read
value_type: U_WORD
accuracy_decimals: 0
filters:
- multiply: 1
- platform: modbus_controller
modbus_controller_id: epever
id: ENERGY_Total
name: "energy_energy_total"
icon: "mdi:alpha-t-circle"
address: 0x0
register_type: read
value_type: U_DWORD
accuracy_decimals: 2
filters:
- multiply: 0.01
unit_of_measurement: kWh
- platform: total_daily_energy
name: "Total Daily Energy"
power_id: Power
accuracy_decimals: 2
filters:
- multiply: 0.001
unit_of_measurement: kWh
|