Modbus Sunspec REFRESH command

I use the Sunspec binding to read the Modbus registers from my Solaredge inverter. Polling is every 10 seconds.

With the DSMR binding I read the most actual values from my Dutch smart meter.

Problem: I have no control over the data that my smart meter is sending. It sends data approximately every ten seconds. However, the exact update times are unreliable and the ten seconds may shift over time. As such a poll of my inverter via Sunspec can happen at the exact same time as data is received from my smartmeter, or in-between two data readings (receivings) from the smart meter.

The modbus binding has a REFRESH command as per the binding documentation. Issuing a REFRESH command to an item linked to a modbus data channel, will trigger a polling of that data channel (and all values in that data block). So my idea would be to send a REFRESH command to one of the Sunspec channels when a DSMR item receives an update, so that my inverter readings and smartmeter readings are in sync as much as possible (and as such any calculation to the two). But whatever I try in rules like a item.sendCommand(REFRESH), item.sendCommand(“REFRESH”), and even declaring the refreshtype in my rules DSL, nothing seems to trigger a REFRESH. The log shows that a REFRESH command was received by the item, but no REFRESH seems to take place at any of the items, just the regular ten second pollings.

Does anyone know if the Sunspec binding supports the REFRESH command?

Probably the easiest way would be to just send the command and watch the event log to see if it updates. It’s not required to implement it, and in some cases it does not make sense to implement it on some channels or even a full binding.

You could look at the code. Navigate the folder and file structures to find a file ending in Handler. Then in that file will be the handleCommand section and it should be clear even if you do not read java if it does or not.

If it does not have it and it makes sense to add it, then raise a github issue as a feature/improvement request.

No it does not support any commands.

openhab-addons/bundles/org.openhab.binding.modbus.sunspec/src/main/java/org/openhab/binding/modbus/sunspec/internal/handler/AbstractSunSpecHandler.java at main · openhab/openhab-addons (github.com)

Secretly I checked the github as well and could not find it either. I was however hoping… due to the docs stating that Sunspec was an extension to the Modbus binding (I can only find the Sunspec documentation via the Modbus documentation), in my head that translated to a binding that is additional code on top of the Modbus code.

Thank you for confirming that the command won’t work due to Sunspec being more or less a separate binding. Tried to make it work for three years but had poor understanding :joy: