I’m trying to get an Eastron SDM72 energy meter working in ESPHome.
I’m using a wemos d1 mini and a RS485 to TTL converter(connected to Tx/Rx of the d1 mini).
The Tx led on the converter is blinking but seems like i’m not getting any reply from the meter, the rx led on the converter stays off.
Checked already the following:
Swapped rx/tx on the D1 mini
Swapped A/B on the RS485 side
Doublechecked parity, baudrate settings on the energy meter
Used another rs485/TTL converter
To verify the modbus connection, i connected the RS485 output of the converter pcb to an USB to an rs485 dongle and verified the incoming data in a terminal, seems like the data is sent correctly.
Just got my SDM630, works immediately.
I also see simular behaviour on both the SD630-SDM72 when measuring the differential voltage between A/B.
So it seems like the RS485/modbus of my SDM72 is still working fine, maybe the addresses are different.
Will investigate this further when i have some more time, for now the SDM630 will be used.
Hi guys, I have a 630 and 72 I can’t get them to work… Can you please share your configurations and what you adjusted manually?
I have this converter. Which converters are you using? I connected the RX from the ESP to TX of the converter. B- to B- of the meter.
Nothing shows up on the UART.
Down below is my minimal example. I set the stop bits to 2 manually in the meter. Messed around with different values, nothing seems to work.
Converter RX LED is blinking every 3 seconds so signal is coming through. Does the converter need the same Ground as the ESP? The ESP is connected independently via a USB power brick and a microUSB cable.
I got the SDM630 working with the same converter board as in your picture.
Powered it with 5Vdc.
Txd and Rxd to GPIO 1 and GPIO3 of the D1 mini. (hardware uart)
A of the converter to A of the SDM.
B of the converter to B of the SDM.
I used a 120Ohm resistor between A and B on the SDM side, not sure if this is needed.
I didn’t connect the ground on the converter or SDM.
I use the default settings of the sdm630(address = 1, parity = none, baudrate = 9600, stopbits = 1)
Below is SDM part of my code:
esphome:
name: "warmtepomp-sdm"
esp8266:
board: d1_mini
# Enable logging
logger:
level: verbose
baud_rate: 0 # <--- must be disabled because gpio1/3 are used for modbus
#serial port
uart:
id: mod_uart
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
stop_bits: 1
modbus:
send_wait_time: 500ms
uart_id: mod_uart
id: mod_bus
#modbuscontroller to read SDM630
modbus_controller:
- id: sdm
address: 0x0001
modbus_id: mod_bus
update_interval: 15s
sensor:
- platform: modbus_controller
modbus_controller_id: sdm
name: "Warmtepomp Total active energy"
id: total_energy
# address: 0x156 --> zie sdm630 manual
# register_type: "read"
## reimplement using custom_command
# 0x1 : modbus device address
# 0x4 : modbus function code
# 0x1 : high byte of modbus register address
# 0x56: low byte of modbus register address
# 0x00: high byte of total number of registers requested
# 0x02: low byte of total number of registers requested
custom_command: [ 0x1, 0x4, 0x1, 0x56,0x00, 0x02]
value_type: FP32
unit_of_measurement: kWh
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: sdm
name: "Warmtepomp Total system power demand"
id: total_system_power
# address: 0x034 zie SDM630 manual
# register_type: "read"
## reimplement using custom_command
# 0x1 : modbus device address
# 0x4 : modbus function code
# 0x1 : high byte of modbus register address
# 0x54: low byte of modbus register address
# 0x00: high byte of total number of registers requested
# 0x02: low byte of total number of registers requested
custom_command: [ 0x1, 0x4, 0x0, 0x34,0x00, 0x02]
value_type: FP32
unit_of_measurement: W
accuracy_decimals: 1
Both leds of the converter board should be blinking when communication is running.
Thank you @drled!
I will try your setup and report back.
I thought Eastron SDM meters are officially supported: Eastron SDM Energy Monitor — ESPHome
It’s really wierd because these meters are insanely popular.
UPDATE: I replicated exactly your setup, doesn’t work for me, the SDM is not answering.
What does the logger outputs? If the SDM is not responding, you should atleast see the modbus command in the logger output.
Also the tx led on your rs485 converter should blink if the command is sent…
Also check this, i reverted my esphome to version 11.5:
@dried: how did you revert to ESPHome 11.5 ? Been having CRC errors as well on Modbus since the last update (in my case reading my Growat inverter locally via RS485, kind of the same setup you are running)
I went to the “backups” section in home assistant, there i found backups that were taken right before the upgrade of esphome. If you click on one of those it should be possible to restore one of the older versions.
@dried: I remembered I programmed/updated my ESP32’s for the first time from the CLI of my Macbook. So, I checked the version, it was 11.2 (so older than 12.0), reprogrammed/flashed my ESP32 from the CLI and now … everything works again !
So, something in ESPHome 12.0 is messing up the way the GPIO pins read/write the data.
I’m leaving my ESP32 alone for now, it works with 11.2