sensors and api calls, constant polling ??

Hi,
I have started to integrate OR into my setup and noticed that my controller (Home center 2) ran out of memory last evening.
As part of my setup I have a lot of sensors created (for switches, dimmers, temp sensors, etc)

Are the sensor constantly polling (based on the value entered) or do they only poll when the sensor is used on a panel ?
Also for a switch or dimmer on a panel that is active (displayed) - is the sensor constantly polling or is it just when the switch or dimmer changes state

If each sensor that I have created (whether it is used on a panel or not) is polling constantly base on the value entered, then I'm concerned that all the API calls may be flooding my controller ...

Thanks
Frank

Indeed sensor polling is independent of the panels; so if you have a sensor defined in your designer account then it will be polled. Some protocols have a continuous connection and do not use polling but instead receive sensor change notifications. Without looking at the code I’m not sure what the Z Wave protocol does (assuming this is the protocol you are using).

Rich

Thanks Richard
I'm polling two thing mainly
My HA Controller devices (Fibaro HC2) via the API
The sonos http api bridge.

Would it be a worthwhile change to only have polling for sensor that is either
a) included in a panel
b) displayed on an panel that is showing
c) for a switch - poll only when it changes state

OR is fantastic but if I have 100 sensors in my setup that are polling every 1s, I'm not sure the HC2 api could handle that

thoughts ?

Thanks
Frank

Not easy for the controller to know what sensors are currently needed by panels and rules hence why any sensors defined in the building modeler are automatically active. If you have to use a ‘connectionless’ protocol like HTTP then the best you can do is tweak the polling interval use various prime numbers to try and stagger the requests, obviously the longer the polling interval the bigger the delay in your UI updating so values should depend on how quickly the values change.

Rich

Thanks Rich
I've already started to look more closely at the polling interval and have extended some obvious ones.
I like the idea of intervals based on prime numbers
Am I correct in assuming that the polling starts from when the command was last saved ?

Rgds
Frank

Hi Frank,

pooling starts every time the controller starts and sensor which uses particular command is initialised. This means, that if you have many sensors which use the same command then they still can perform pooling at the same time.

Kind regards,

Michal