EDL21 - add update interval

To adapt the update interval of the EDL21 integration, it would be helpful to add a variable to the configuration, like:

update_interval: 30
[default could be 60 seconds]

That setting would be perfect. Is there currently another possibility to adjust the query interval?

This is quite old, but it looks like it still has not been resolved.
I have the Hichi USB IR reader and it does work in Home Assistant with the EDL21 integration, but it updates very slowly which makes it less than ideal for reading current power consumption or solar excess energy.
Having it updating every 5 Seconds would be ideal, but it seems there is no way to configure the update rate?
I am currently using a Powerfox Poweropti to get data from my electricity meter, and it can update every 3 Seconds…however, since it sends the data to a server and then reads it from there and the Server seems to be out of order pretty much every week at the moment and doesn’t get fixed…I need a more reliable option…

In context of an other component i found the following information for polling integrations:

    scan_interval: 10

Maybe this parameter is available in EDL21 too. I haven’t checked it …

Sadly it is not.

I checked the source code if the interval is configurable - and in line 42 https://github.com/home-assistant/core/blob/0941ed076ccafe36e2e8ffbdc480cea4f8fa5650/homeassistant/components/edl21/sensor.py the timing is hard coded to 60 seconds:

MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)

I am not a python developer - but it should be very easy to add an optional configuration value scan_interval to set the timing in seconds - similar to line 48:

vol.Optional(CONF_NAME, default=""): cv.string,

So an example configuration that sets the update interval to 10 seconds could look like this:

sensor:
  - platform: edl21
    serial_port: /dev/ttyUSB0
    scan_interval: 10

Would be great for many users who need to track energy peaks to get this tiny little feature in one of the next updates :slight_smile:
THANX in advance to you developers!

2 Likes

I fear such a configuration option will not be added, please read PR Decrease edl21 sensor min time between updates by luchaf · Pull Request #81117 · home-assistant/core · GitHub for more details on the discussion.
The EDL21 integration needs a full rework to support at least config flow. A decrease of polling intervall was also declined.

it would be great, if there were this option because adding scan_interval: 10 doesn´t work for EDL21.
even a fix of the scan_interval platform option would help

Hello everyone!
In the meantime, is there a solution to change the query interval?

1 Like