tp1de / ioBroker.ems-esp

EMS-ESP Adapter
MIT License
18 stars 4 forks source link

Please allow km200_polling < 90 #31

Closed EvilEls closed 5 months ago

EvilEls commented 10 months ago

It works fine for smaller devices

ems-esp.0 | 2023-08-19 14:08:13.429 | info | KM200: polling every 60 secs
ems-esp.0 | 2023-08-19 14:08:13.428 | info | end of initializing KM200 states
ems-esp.0 | 2023-08-19 14:07:57.204 | info | start initializing KM200 states
ems-esp.0 | 2023-08-19 14:07:57.201 | info | write KM200 file:/opt/iobroker/iobroker-data//ems-esp/0/km200.csv
ems-esp.0 | 2023-08-19 14:07:57.200 | info | End reading KM200 data-structure: 115 fields found
ems-esp.0 | 2023-08-19 14:07:24.491 | info | start reading KM200 data-structure
ems-esp.0 | 2023-08-19 14:07:24.240 | info | starting. Version 2.2.0 in /opt/iobroker/node_modules/iobroker.ems-esp, node: v18.17.1, js-controller: 5.0.11
tp1de commented 10 months ago

Polling times for km200 are higly depending on number of states available on the different installations. (between 80 to 250 on hybrid systems).

I have 136 states (without recordings) and actual polling times differ between (18 and 36 seconds). Switch on statistics and you will see the actual polling time.

The Bosch gateways are quite slow. Every state has to be polled by a single http get request - including some waiting time in between. Otherwise the gateway collapses with errors. Any parameter less then 90 seconds is changed to be minimum 90 seconds to secure stable operations.

And there are only a few states (boiler / heatpump status, valve status ...) where shorter polling times might be of interest. This might be an add-on for further developments - but not now.

Compared to the km200 adapter with standard polling of 15 minutes and fast polling of 5 minutes - the ems-esp adapter is already much faster.

Stability of the adapter is actually highest priority for me, since the km200 adapter is end of life and I expect a couple of hundred users to migrate to ems-esp.

If you urgently need faster polling, than I recommend to consider buying an ems-esp gateway. (actual polling times are between 1 to 2 seconds).

EvilEls commented 10 months ago

Thanks for your reply. In case stability is most important, how about defining a delay between polls instead of a fixed poll cycle time. With a poll cycle you could run into trouble when a poll runs longer than the cycle lasts.

With a defined delay between polls, the adapter would wait for a poll to finish, wait, and start the next poll. This would not affect stability but faster devices would benefit from it.

tp1de commented 10 months ago

API access to km200 gateway is asynchronous (polling states / polling recordings / state changes) and not just the ioBroker adapter requires access to the gateway. Cloud-access (read/write) must stay possible as well as state changes within ioBroker (http post). 90 seconds is already a quite low limit to secure stable operations. I recommend 300 seconds for standard users.

Please provide a list of states where shorter poll cycle times are required and explain why you need this.