Zwave: Can't update items using a rule - they are switching back again

Hi There,

I’ve created a simple rule which takes the value from one item and post it to another item:

rule Command_Desired_Temperature_GF_Bath
when
  Item Desired_Temperature_GF_Bath_Command received update
then
  Desired_Temperature_GF_Bath.postUpdate(Desired_Temperature_GF_Bath_Command.state)
end
Number     Desired_Temperature_GF_Bath "Sollwert Bad unten"             { channel="zwave:device:d90ead21:node7:thermostat_setpoint_heating" }

When the rule is triggered the value of Desired_Temperature_GF_Bath is updated. But when the zwave devices wakes up, the value is being “resettet” to the last value.

For example:

Value of zwave device: 22.0

Value triggered by rule: 21.5

After the zwave devices wakes up, the value will be 22.0 again but should be 21.5.

What can I do to fix this?

OK, maybe the Problem is the postUpdate instead of using sendCommand.

Desired_Temperature_GF_Bath.sendCommand(Desired_Temperature_GF_Bath_Command.state)

So I modified my rule and now receive an Error Message:

2016-09-30 14:36:37.219 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Command_Desired_Temperature_GF_Bath': An error occured during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(org.eclipse.smarthome.core.items.Item,java.lang.String) on instance: null

Yes, you have to use sendCommand. With postUpdate only OH gets the new value, not the device itself. Therefore when the device wakes up, it transfers the “wrong/old” value back to OH.

Concerning your error message. I have to take a look at my rules for the LC-13, but haven’t got them at hand at the moment. Can check it this evening.

1 Like