athom-tech / athom-configs

Athom Technology Official Center
MIT License
199 stars 129 forks source link

Removed update_interval from platform: cse7766 - athom-smart-plug-v2.yaml #35

Closed marcolino7 closed 7 months ago

marcolino7 commented 7 months ago

Removed update_interval from platform: cse7766 due ESPHome braking change

https://github.com/esphome/esphome/pull/6095

FPA-ChrisLaird commented 7 months ago

I'm no expert but if you just remove the update_interval you will get spammed with many samples per second. A suggestion I've seen mentioned, and make use of myself, is to add a 10s filter.

samwiseg0 commented 7 months ago

I'm no expert but if you just remove the update_interval you will get spammed with many samples per second. A suggestion I've seen mentioned, and make use of myself, is to add a 10s filter.

You are correct this will not work properly.

marcolino7 commented 7 months ago

I'm no expert but if you just remove the update_interval you will get spammed with many samples per second. A suggestion I've seen mentioned, and make use of myself, is to add a 10s filter.

Can you post here an example, so I can create e new pull request with this enhancements?

Thanks

rupertbenbrook commented 7 months ago

I'm no expert but if you just remove the update_interval you will get spammed with many samples per second. A suggestion I've seen mentioned, and make use of myself, is to add a 10s filter.

Can you post here an example, so I can create e new pull request with this enhancements?

Thanks

The suggestion in the ESPHome documentation is a throttle or throttle_average filter. I'd be tempted to do exactly the same and add these filters to voltage, current and energy after the existing lambdas, and use the existing update interval timing of 10s. ESPHome CSE7766 documentation

The device sends multiple updates per second, so you will probably want some sort of averaging or throttle filter on the sensors.

sensor:
  - platform: cse7766
    current:
      name: "Sonoff Pow R2 Current"
      filters:
        - throttle_average: 60s
    voltage:
      name: "Sonoff Pow R2 Voltage"
      filters:
        - throttle: 60s
    power:
      name: "Sonoff Pow R2 Power"
    energy:
      name: "Sonoff Pow R2 Energy"
samwiseg0 commented 7 months ago

I'm no expert but if you just remove the update_interval you will get spammed with many samples per second. A suggestion I've seen mentioned, and make use of myself, is to add a 10s filter.

Can you post here an example, so I can create e new pull request with this enhancements?

Thanks

There are already a few PRs. I would suggest closing this one.

marcolino7 commented 7 months ago

I'm no expert but if you just remove the update_interval you will get spammed with many samples per second. A suggestion I've seen mentioned, and make use of myself, is to add a 10s filter.

Can you post here an example, so I can create e new pull request with this enhancements? Thanks

There are already a few PRs. I would suggest closing this one.

Hi, I close this. Can you link repo with this modification so I can use for my device waiting for PR will be merged? Thanks

samwiseg0 commented 7 months ago

These PRs https://github.com/athom-tech/athom-configs/pull/36 https://github.com/athom-tech/athom-configs/pull/38