Last Update is hours ago?

Hi,
I have a home-built ESPHome sensor that is puzzling me?
If I watch the log output, the changing numbers come through as expected (~ every 10sec). However, if I display those sensors in a dashboard, the updates are VERY few and VERY far apart?
image
Image: Left click on ESPHome | Devices | selected Entities.

Other ESPHome sensors I have built which are along the same lines as this one, update in dashboards perfectly well and are in-line with the default or defined update_interval:

Suggestions or explanations as to why would be will be most helpful.

Regards, Martin

Please post the YAML you have running on this device.

Isn’t this related to the ongoing HA database recorder issues?!

Hi Ben,
This it:

esphome:
  name: "esp32-sdm230m"
  platform: esp32
  board: esp32doit-devkit-v1

# Enable logging
logger:
  baud_rate: 0
  level: VERBOSE

api:

ota:
  - platform: esphome
    password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

#captive_portal:

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 #Use defaults

sensor:
  - platform: sdm_meter
    #update_interval: 10s #use defaults

    phase_a:  
      current:
        name: "ESP32.SDM230M Current"
        force_update: true
      voltage:
        name: "ESP32.SDM230M Voltage"
        force_update: true
      active_power:
        name: "ESP32.SDM230M Active Power (P)"
        force_update: true
        accuracy_decimals: 3
        unit_of_measurement: "kW"
        filters:
        - multiply: 0.001
        

      #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"

 
button:
  - platform: restart
    name: "ESP32_SDM230m Restart Button"

Regards, M.

I don’t know? If this “issue” is recent, then “no”.
As I have been trying to sort this out ever since my PV install (Sept 23).
Regards, M.

1 Like

You have update_interval: commented out so, where is 10s coming from?

Also, I don’t think force_update is meant to work or able to work with every possible sensor. What happens if you just use

update_interval: 10s

and lose all the

force_update: true

Good question…
The update_interval: and force_update: are debug experiments which are not changing the behaviour at all. But back to the “10sec”:

If I rem-out (#) update_interval:, I would have expected to see the default (modbus-controler | update_interval) of 60 seconds. But no, it “seems” to be 10sec (if I accept the log display.
The attached 30sec video is my evidence for this. If you note the timestamp at the yellow warnings lines, it steps in 10 sec increments. 10SecLog.
Does this suggest anything?

Regards, M.

Post your config as it is currently.

Hi Justin,

Yer tiz…

esphome:
  name: "esp32-sdm230m"
  platform: esp32
  board: esp32doit-devkit-v1


#Disable UART logging (WiFi Only)
logger:
  baud_rate: 0
  level: VERBOSE

api:

ota:
  - platform: esphome
    password: !secret ota_password

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
    #update_interval: 10s

    phase_a:  
      current:
        name: "ESP32.SDM230M Current"
        #force_update: true
      voltage:
        name: "ESP32.SDM230M Voltage"
        #force_update: true
      active_power:
        name: "ESP32.SDM230M Active Power (P)"
        #force_update: true
        accuracy_decimals: 3
        unit_of_measurement: "kW"
        filters:
        - multiply: 0.001
        

      #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"

 
button:
  - platform: restart
    name: "ESP32_SDM230m Restart Button"