I have question regarding polling intervals optimization.
I have few devices on the modbus. From this device I can read actual values, but also their configuration.
For the actual value it’s clear I must read it in any interval (like 2000ms ..), but configuration I can read only once when I’m opening configuration overview via my widget. I can set polling interval to 0, but I don’t know how to setup, that widget will refresh configuration informations about devices. It’s quite a lot of informations which I don’t need to read every 2 seconds, but don’t know how to optimize.
Does modbus provide an action of a Channel you can command to cause it to refresh on demand? If not there really isn’t anything you can do from the widget.
At a high level you need an Item or a rule that you command/run from the widget that does what ever modbus needs to be done to cause it to refresh. So right off the bat, it’s going to be a manual process even if modbus supports this.
If modbus doesn’t support a way to manually refresh, there really isn’t anything you can do.
Do you actually experience a problem with the current loads? Is this actually a problem that needs to be solved? If so is messing with the way OH polls them the most effective approach to solving the problem? I don’t have the answers to these questions but they are things you should ask yourself and answer.
I don’t use modbus so I can’t say what the best approach would be assuming there is a problem. I guess I would start by setting the polling period to be as long as reasonable for those registers that don’t change that often. I’d also only configure polling registers at all for those that provide meaningful and actionable information that OH needs. Just because a piece of information is available doesn’t mean your home automation has a use for it.
It is in the docs, you need to send the REFRESH command to one of the items.
Polling can be manually triggered by sending REFRESH command to item bound to channel of data thing. When manually triggering polling, a new poll is executed as soon as possible, and sibling data things (i.e. things that share the same poller bridge) are updated. In case the poller had just received a data response or an error occurred, a cached response is used instead. See Refresh command section for more details.
Some devices do not allow to query too many registers in a single readout action or a range that spans reserved registers. Split your poller into multiple smaller ones to work around this problem.
But you will need to add a push button to your widget with the REFRESH command as its action. AFAIK, widgets are not capable of sending commands when they opened.
You should define more than one poller for each Modbus device. One for your manually refreshed registers with period set to zero and one for automatic refreshed registers.