danielwippermann / resol-vbus

A JavaScript library for processing RESOL VBus data
MIT License
67 stars 34 forks source link

Is it possible to set relay using em-simulator ? #92

Closed faronov closed 9 months ago

faronov commented 11 months ago

Using em-simulator example I'm able to get the status of the relay but is it possible to set the status of the relay?

danielwippermann commented 11 months ago

Hi @faronov !

It depends... But I simply might misunderstood your question...

The em-simulator acts like a real extension module (EM) - at least as far as the controller can tell over the VBus connection. The controller regularly sends relay control information to the EM (simulator) and in return gets back the sensor input values.

That means that only the controller is able to set a relay state, regardless of whether it is a built-in relay, a real extension module's relay or one of the em-simulator's virtual relays. There is no programmatic way to set the em-simulator's relay states since it would get overriden in the next communication cycle.

The steps to get the controller to set one of "its" relays heavily depends on the controller itself. If you take a RESOL DeltaSol MX for example the easiest way is to use a "Function block" from the "Arrangement Optional Functions" section. You can add a "Function block", assign it one of the virtual extension module relays and then activate one or more of the criteria to switch that virtual relay.

If you want to set a real relay state that is not part of the em-simulator the way again is controller-dependend. On a RESOL DeltaSol MX you can use a "Function block" again, assign a real relay to it and use a virtual sensor input to switch that real relays. You then let your em-simulator send different sensor input values to influence the controller into switching the real relay.

I hope that answers your question. If not, don't hesitate to ask any additional questions!

Best regards, Daniel