Esphome flooding logs

running latest esphome, I made a change to my yaml (renamed device/hostname)
recompiled and uploaded. now the sensor data (power /wattage) is flooding my screen. “sending state 0.00000 W with 1 decimals of accuracy” about a million times
I changed logger level to INFO and this stopped. but now I don’t see any info at all. if i set to DEBUG, it goes back to the scrolling off the screen of the above mentioned statement.

is this a bug or is there a way to throttle? I don’t recall this behavior with previous versions of esphome.

Yes you can throttle, best to do this as a polled sensor (e.g. send very 30 seconds) with the option to send additional updates if there is a significant change (>> larger then your noise floor).

Share your device config if you want help with this.

fabulous.
Yes please help.


substitutions:
  devname: mylamp

esphome:
  name: $devname
  platform: ESP8266
  board: esp01_1m
  
wifi:
  ssid: redacted
  password: redacted
  domain: redacted
  manual_ip:
    static_ip: redacted
    gateway: redacted
    subnet: 255.255.255.0
    dns1: redacted
    dns2: redacted

web_server:
  port: 80

api:
ota:
  - platform: esphome
 
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: $devname "Power Button"
    on_press:
      - switch.toggle: relay

switch:
  - platform: gpio
    name: $devname "Power1"
    pin: GPIO12
    id: relay
  - platform: restart
    name: $devname "Restart"

logger:
  baud_rate: 0
  level: INFO
uart:
  rx_pin: RX
  baud_rate: 4800

sensor:
  - platform: cse7766
    current:
      name: $devname "Current"
    power:
      name: $devname "Power"

You pressed the wrong button to format your config.

It is this one: Screenshot 2024-07-26 at 13-30-52 Esphome flooding logs - ESPHome - Home Assistant Community

Not this one: Screenshot 2024-07-26 at 13-30-45 Esphome flooding logs - ESPHome - Home Assistant Community

sorry about that… updated the post.
thanks!

sensor:
  - platform: cse7766
    current:
      name: $devname "Current"
      filters:
        - or:
            - throttle: 10s  # periodic update interval
            - delta: 5.0  # will send the value immediately if latest value is more than the last value by this amount
    power:
      name: $devname "Power"
      filters:
        - or:
            - throttle: 10s  # periodic update interval
            - delta: 5.0  # will send the value immediately if latest value is more than the last value by this amount

Make sure you set the delta option to a sensible value. It must be more than the noise between readings, but not so high that it never triggers. It will be different for each of the sensors.

1 Like

Here’s a real world example:

There is about +/- 0.02A noise on the signal. So the delta should be set higher than that. To catch big brief spikes like the one shown, a good setting would be delta: 0.1

Thank you!! appreciate the help

If your data is very noisy a better option might be:

sensor:
  - platform: cse7766
    current:
      name: $devname "Current"
      filters:
        - sliding_window_moving_average:
            window_size: 15
            send_every: 15
            send_first_at: 1
    power:
      name: $devname "Power"
      filters:
        - sliding_window_moving_average:
            window_size: 15
            send_every: 15
            send_first_at: 1
1 Like