I have a sensor (SDM_meter) displaying in a Dashboard Gauge. The only way I have found to get the gauge to update is to leave esphome log window open in one HA session while the gauge is showing in another HA session?
The log seems (to me) to be sending/receiving traffic every 10 second as programmed but as mentioned above, unless the log is running, the gauge does not update. I am sure that when I first wrote this .yaml that it worked as expected!
My .yaml
esphome:
name: "esp32-sdm230m"
platform: esp32
board: esp32doit-devkit-v1
# Enable logging
logger:
baud_rate: 0
level: VERBOSE
api:
ota:
password: !secret ota_password
id: my_ota_pw
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
uart:
- id: uart_2
# RX/TX are swopped to make PCB layout easer.
tx_pin: GPIO16 #marked as RX2 on DOIT DEVKIT V1
rx_pin: GPIO17 #marked as TX2.
baud_rate: 9600
stop_bits: 1
parity: none
modbus:
uart_id: uart_2
id: modbus1
#No flow control required because using UART/RS485 module
#flow_control_pin: GPIO18 #marked as D18 on DOIT DEVKIT V1
modbus_controller:
- id: sdm230m
address: 0x01
modbus_id: modbus1
update_interval: 10s
sensor:
- platform: sdm_meter
phase_a:
current:
name: "ESP32.SDM230M Current"
voltage:
name: "ESP32.SDM230M Voltage"
active_power:
name: "ESP32.SDM230M Active Power (P)"
force_update: true
apparent_power:
name: "ESP32.SDM230M Apparent Power (S)"
reactive_power:
name: "ESP32.SDM230M Reactive Power (Q)"
power_factor:
name: "ESP32.SDM230M Power Factor"
phase_angle:
name: "ESP32.SDM230M Phase Angle"
frequency:
name: "ESP32.SDM230M Frequency"
total_power:
name: "ESP32.SDM230M Total Power"
import_active_energy:
name: "ESP32.SDM230M Import Active Energy"
export_active_energy:
name: "ESP32.SDM230M Export Active Energy"
import_reactive_energy:
name: "ESP32.SDM230M Import Reactive Energy"
export_reactive_energy:
name: "ESP32.SDM230M Export Reactive Energy"
update_interval: 10s
switch:
- platform: restart
name: "ESP32_SDM230m Restart"
… and a log sample:
INFO ESPHome 2023.5.5
INFO Reading configuration /config/esphome/esp32-sdm230m.yaml...
INFO Starting log output from esp32-sdm230m.local using esphome API
INFO Successfully connected to esp32-sdm230m.local
[07:41:26][I][app:102]: ESPHome version 2023.5.5 compiled on Jun 11 2023, 07:30:34
[07:41:26][C][wifi:505]: WiFi:
[07:41:26][C][wifi:363]: Local MAC: EC:62:60:9D:B3:48
[07:41:26][C][wifi:364]: SSID: 'myAP1'[redacted]
[07:41:26][C][wifi:365]: IP Address: 192.168.0.136
[07:41:26][C][wifi:367]: BSSID: 44:E9:DD:6E:71:6C[redacted]
[07:41:26][C][wifi:368]: Hostname: 'esp32-sdm230m'
[07:41:26][C][wifi:370]: Signal strength: -62 dB ▂▄▆█
[07:41:26][V][wifi:372]: Priority: 0.0
[07:41:26][C][wifi:374]: Channel: 6
[07:41:26][C][wifi:375]: Subnet: 255.255.255.0
[07:41:26][C][wifi:376]: Gateway: 192.168.0.1
[07:41:26][C][wifi:377]: DNS1: 192.168.0.1
[07:41:26][C][wifi:378]: DNS2: 0.0.0.0
[07:41:26][C][logger:301]: Logger:
[07:41:26][C][logger:302]: Level: VERBOSE
[07:41:26][C][logger:303]: Log Baud Rate: 0
[07:41:26][C][logger:305]: Hardware UART: UART0
[07:41:26][C][uart.arduino_esp32:124]: UART Bus 0:
[07:41:26][C][uart.arduino_esp32:125]: TX Pin: GPIO16
[07:41:26][C][uart.arduino_esp32:126]: RX Pin: GPIO17
[07:41:26][C][uart.arduino_esp32:128]: RX Buffer Size: 256
[07:41:26][C][uart.arduino_esp32:130]: Baud Rate: 9600 baud
[07:41:26][C][uart.arduino_esp32:131]: Data Bits: 8
[07:41:26][C][uart.arduino_esp32:132]: Parity: NONE
[07:41:26][C][uart.arduino_esp32:133]: Stop bits: 1
[07:41:27][C][modbus:143]: Modbus:
[07:41:27][C][modbus:145]: Send Wait Time: 250 ms
[07:41:27][C][modbus:146]: CRC Disabled: NO
[07:41:27][C][modbus_controller:275]: ModbusController:
[07:41:27][C][modbus_controller:276]: Address: 0x01
[07:41:27][C][modbus_controller:278]: sensormap
[07:41:27][C][modbus_controller:284]: ranges
[07:41:27][C][sdm_meter:087]: SDM Meter:
[07:41:27][C][sdm_meter:088]: Address: 0x01
[07:41:27][C][sdm_meter:093]: Phase A
[07:41:27][C][sdm_meter:094]: Voltage 'ESP32.SDM230M Voltage'
[07:41:27][C][sdm_meter:094]: Device Class: 'voltage'
[07:41:27][C][sdm_meter:094]: State Class: 'measurement'
[07:41:27][C][sdm_meter:094]: Unit of Measurement: 'V'
[07:41:27][C][sdm_meter:094]: Accuracy Decimals: 2
[07:41:27][C][sdm_meter:095]: Current 'ESP32.SDM230M Current'
[07:41:27][C][sdm_meter:095]: Device Class: 'current'
[07:41:27][C][sdm_meter:095]: State Class: 'measurement'
[07:41:27][C][sdm_meter:095]: Unit of Measurement: 'A'
[07:41:27][C][sdm_meter:095]: Accuracy Decimals: 3
[07:41:27][C][sdm_meter:096]: Active Power 'ESP32.SDM230M Active Power (P)'
[07:41:27][C][sdm_meter:096]: Device Class: 'power'
[07:41:27][C][sdm_meter:096]: State Class: 'measurement'
[07:41:27][C][sdm_meter:096]: Unit of Measurement: 'W'
[07:41:27][C][restart:068]: Restart Switch 'ESP32_SDM230m Restart'
[07:41:27][C][restart:070]: Icon: 'mdi:restart'
[07:41:27][C][restart:091]: Restore Mode: always OFF
[07:41:27][C][mdns:108]: mDNS:
[07:41:27][C][mdns:109]: Hostname: esp32-sdm230m
[07:41:27][V][mdns:110]: Services:
[07:41:27][V][mdns:112]: - _esphomelib, _tcp, 6053
[07:41:27][V][mdns:114]: TXT: version = 2023.5.5
[07:41:27][V][mdns:114]: TXT: mac = ec62609db348
[07:41:27][V][mdns:114]: TXT: platform = ESP32
[07:41:27][V][mdns:114]: TXT: board = esp32doit-devkit-v1
[07:41:27][V][mdns:114]: TXT: network = wifi
[07:41:27][C][ota:093]: Over-The-Air Updates:
[07:41:27][C][ota:094]: Address: esp32-sdm230m.local:3232
[07:41:27][C][ota:097]: Using Password.
[07:41:27][C][api:138]: API Server:
[07:41:27][C][api:139]: Address: esp32-sdm230m.local:6053
[07:41:27][C][api:143]: Using noise encryption: NO
[07:41:35][V][modbus:199]: Modbus write: 01.04.00.00.00.50.F0.36 (8)
[07:41:35][V][modbus_controller:158]: Updating modbus component
[07:41:35][V][modbus:042]: Modbus received Byte 1 (0X1)
[07:41:35][V][modbus:042]: Modbus received Byte 4 (0X4)
[07:41:35][V][modbus:042]: Modbus received Byte 160 (0Xa0)
[07:41:35][V][modbus:042]: Modbus received Byte 67 (0X43)
[07:41:35][V][modbus:042]: Modbus received Byte 107 (0X6b)
[07:41:35][V][modbus:042]: Modbus received Byte 202 (0Xca)
[07:41:35][V][modbus:042]: Modbus received Byte 143 (0X8f)
[07:41:35][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:35][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:35][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:35][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:35][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:35][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:35][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:35][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:36][V][modbus:042]: Modbus received Byte 62 (0X3e)
[07:41:45][V][modbus:199]: Modbus write: 01.04.00.00.00.50.F0.36 (8)
[07:41:45][V][modbus_controller:158]: Updating modbus component
[07:41:45][V][modbus:042]: Modbus received Byte 1 (0X1)
[07:41:45][V][modbus:042]: Modbus received Byte 4 (0X4)
[07:41:45][V][modbus:042]: Modbus received Byte 160 (0Xa0)
[07:41:45][V][modbus:042]: Modbus received Byte 67 (0X43)
[07:41:45][V][modbus:042]: Modbus received Byte 108 (0X6c)
[07:41:45][V][modbus:042]: Modbus received Byte 26 (0X1a)
[07:41:45][V][modbus:042]: Modbus received Byte 51 (0X33)
[07:41:45][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:45][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:45][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:45][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:45][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:45][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:45][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:45][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:45][V][modbus:042]: Modbus received Byte 62 (0X3e)
[07:41:46][V][modbus:042]: Modbus received Byte 47 (0X2f)
[07:41:46][V][sensor:043]: 'ESP32.SDM230M Frequency': Received new state 49.902534
[07:41:55][V][modbus:199]: Modbus write: 01.04.00.00.00.50.F0.36 (8)
[07:41:55][V][modbus_controller:158]: Updating modbus component
[07:41:55][V][modbus:042]: Modbus received Byte 1 (0X1)
[07:41:55][V][modbus:042]: Modbus received Byte 4 (0X4)
[07:41:55][V][modbus:042]: Modbus received Byte 160 (0Xa0)
[07:41:55][V][modbus:042]: Modbus received Byte 67 (0X43)
[07:41:55][V][modbus:042]: Modbus received Byte 108 (0X6c)
[07:41:55][V][modbus:042]: Modbus received Byte 15 (0Xf)
[07:41:55][V][modbus:042]: Modbus received Byte 197 (0Xc5)
[07:41:55][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:55][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:55][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:55][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:55][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:55][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:56][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:56][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:41:56][V][modbus:042]: Modbus received Byte 61 (0X3d)
[07:41:56][V][sensor:043]: 'ESP32.SDM230M Voltage': Received new state 236.061600
[07:42:05][V][modbus:199]: Modbus write: 01.04.00.00.00.50.F0.36 (8)
[07:42:05][V][modbus_controller:158]: Updating modbus component
[07:42:05][V][modbus:042]: Modbus received Byte 1 (0X1)
[07:42:05][V][modbus:042]: Modbus received Byte 4 (0X4)
[07:42:05][V][modbus:042]: Modbus received Byte 160 (0Xa0)
[07:42:05][V][modbus:042]: Modbus received Byte 67 (0X43)
[07:42:05][V][modbus:042]: Modbus received Byte 108 (0X6c)
[07:42:05][V][modbus:042]: Modbus received Byte 218 (0Xda)
[07:42:05][V][modbus:042]: Modbus received Byte 200 (0Xc8)
[07:42:05][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:05][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:05][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:05][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:05][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:05][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:05][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:05][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:06][V][modbus:042]: Modbus received Byte 62 (0X3e)
[07:42:15][V][modbus:199]: Modbus write: 01.04.00.00.00.50.F0.36 (8)
[07:42:15][V][modbus_controller:158]: Updating modbus component
[07:42:15][V][modbus:042]: Modbus received Byte 1 (0X1)
[07:42:15][V][modbus:042]: Modbus received Byte 4 (0X4)
[07:42:15][V][modbus:042]: Modbus received Byte 160 (0Xa0)
[07:42:15][V][modbus:042]: Modbus received Byte 67 (0X43)
[07:42:15][V][modbus:042]: Modbus received Byte 109 (0X6d)
[07:42:15][V][modbus:042]: Modbus received Byte 6 (0X6)
[07:42:15][V][modbus:042]: Modbus received Byte 111 (0X6f)
[07:42:15][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:15][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:15][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:15][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:15][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:15][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:15][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:15][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:15][V][modbus:042]: Modbus received Byte 62 (0X3e)
[07:42:16][V][modbus:042]: Modbus received Byte 156 (0X9c)
[07:42:25][V][modbus:199]: Modbus write: 01.04.00.00.00.50.F0.36 (8)
[07:42:25][V][modbus_controller:158]: Updating modbus component
[07:42:25][V][modbus:042]: Modbus received Byte 1 (0X1)
[07:42:25][V][modbus:042]: Modbus received Byte 4 (0X4)
[07:42:25][V][modbus:042]: Modbus received Byte 160 (0Xa0)
[07:42:25][V][modbus:042]: Modbus received Byte 67 (0X43)
[07:42:25][V][modbus:042]: Modbus received Byte 109 (0X6d)
[07:42:25][V][modbus:042]: Modbus received Byte 19 (0X13)
[07:42:25][V][modbus:042]: Modbus received Byte 156 (0X9c)
[07:42:25][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:25][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:25][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:25][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:25][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:25][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:25][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:25][V][modbus:042]: Modbus received Byte 0 (0X0)
[07:42:26][V][modbus:042]: Modbus received Byte 62 (0X3e)
Any suggestions to help understand/resolve the problem, eagerly accepted
Regards, Martin