I have a rule (JSR223/Javascript) working which runs every couple of minutes, checks the outdoor and indoor temperatures, and sets the a switch item to ON or OFF according to whether the indoor temperature is higher or lower. I see the switch change state in PaperUI. All good. The switch item is linked to a thing which writes a value to a Modbus register to open or close the bypass valve of the ventilation machine. If I operate the switch manually, it changes the state of the bypass and I see it reflected in the bypass state values read out from the relevant registers. However, when the switch state is changed from the rule, the bypass state doesn’t change. What am I missing? Here is the relevant snippet.
var itemBypassSwitch = getItem('BrinkDataWriteBypassValve6006_ValueAsSwitch');
itemBypassSwitch.state = ON;
I imagine some kind of update or notification is missing.