robertsLando / node-red-contrib-m-bus

Node-Red node for M-Bus protocol
MIT License
10 stars 6 forks source link

Slow down Scan & Read #39

Open kickouille opened 7 months ago

kickouille commented 7 months ago

Hello,

First of all, thank you for your great module!

I have a question, when auto scan and read is enabled, I find it a bit agressive, as it is reading in a loop without any waiting time. What would be the best approach to add a delay in your code and a field in the GUI to set this? Like wait 300s between each reading.

Also, I find that functions getDevice and getDevices is a bit confusing. At first, I was expecting the getDevices to also read all devices stored in the JSON file, but that doesn't seem to be the case. Or am I wrong?

I'm just trying to find a way to poll all devices (a lot, I'm taking care of a building with many meters) every 5 minutes or more without doing something complicate with loops and stuff.

Best regards,

Yanik

robertsLando commented 7 months ago

I have a question, when auto scan and read is enabled, I find it a bit agressive, as it is reading in a loop without any waiting time.

You could do the scan your own if needed by using the getDevice function. `getDevices function returns latest devices data that are cached on each read