[SOLVED] Rule Sending Command after ZWave Room Thermostate changed SetPoint

Hello,

I’m new to this forum. So I’ll introduce me first: My name is Michael. I’m german, so excuse my bad english.
I’m using openhab2 (v2.5) on Ubuntu 16.04. I want to send a command after a the Setpoint (heating) of a ZWave room thermostate has changed. I don’t know, how to do this. Can anyone help me, please?

Of course, it’s not too late for a “Happy new Year”, is it?

Regards
Michael

Welcome! It is not too late for a sentiment like that.

This user forum is to assist users in configuring and understanding openHAB. We can help you debug a rule you have written but do not exist to just provide solutions to be copy and pasted.

Please read the documentation on rules here.

You may want to read some forum guidelines here, especially how to use code fences.

We have a very active community here to help.

Best Regards,
Bruce

Hello and thanks for your answer.

Here is what I tried:
rule “Heizung WZ an bei Kälte”

when
    Item ZWaveNode006014G0160RoomThermostat_SetpointHeating received update
then
    if (ZWaveNode006014G0160RoomThermostat_SetpointHeating.state>23) {
            sendCommand(ZWaveNode002SpiritThermostaticValveWZE_ThermostatMode, "1");
            
   sendCommand(ZWaveNode002SpiritThermostaticValveWZE_SetpointEnergyHeat, "22.5");
            sendCommand(ZWaveNode003SpiritThermostaticValveWZW_ThermostatMode, "1");
            sendCommand(ZWaveNode003SpiritThermostaticValveWZW_SetpointEnergyHeat, "22.5");
    }
    else {
            if (ZWaveNode006014G0160RoomThermostat_SetpointHeating.state<22) {
                    sendCommand(ZWaveNode002SpiritThermostaticValveWZE_ThermostatMode, "0");
                    sendCommand(ZWaveNode003SpiritThermostaticValveWZW_ThermostatMode, "0");
            }
    }

end

It doesn’t work, but I don’t know why.
I already read the linked site but maybe not carefully enough. Is there any help possible?

Thanks in advance.

Regards Michael

Thank you. The Item definition for ZWaveNode006014G0160RoomThermostat_SetpointHeating may be useful too.

Unfortunately, I do not know the German language. Perhaps @sihui or one of the other German people here can assist better.

Thank you,

the definition is not written into a file.
I linked a channel of a zwave room thermostate with this item which has been created on the fly in paperui.
Where do I have to look for the definition?

Unfortunately, I do not know the German language.

I think I’m able to understand most of the english language. I’m just not able to express what I want to say correctly.
Nevertheless thanks for all your help so far.

Regards
Michael

1 Like

I will try as I have time. If it is easier for you, I understand there is also a German language forum.

Hi

Welcome to the party.

I think you’ve just missed a tiny bit of syntax.

>=

Rather than just

>

Try this

rule “Heizung WZ an bei Kälte”

when
    Item ZWaveNode006014G0160RoomThermostat_SetpointHeating received update // or changed as Rossko57 suggests
then
    if (ZWaveNode006014G0160RoomThermostat_SetpointHeating.state >=23) {
            sendCommand(ZWaveNode002SpiritThermostaticValveWZE_ThermostatMode, "1")
            
   sendCommand(ZWaveNode002SpiritThermostaticValveWZE_SetpointEnergyHeat, "22.5")
            sendCommand(ZWaveNode003SpiritThermostaticValveWZW_ThermostatMode, "1")
            sendCommand(ZWaveNode003SpiritThermostaticValveWZW_SetpointEnergyHeat, "22.5")
    }
    
            if (ZWaveNode006014G0160RoomThermostat_SetpointHeating.state <= 22) {
                    sendCommand(ZWaveNode002SpiritThermostaticValveWZE_ThermostatMode, "0")
                    sendCommand(ZWaveNode003SpiritThermostaticValveWZW_ThermostatMode, "0")
            }
    


end

; Removed as suggested

What would be helpful is the entry from your events.log that shows when you change your setpoint.
That would confirm the Item name at least.
It will also show you if your Item’s state is a QuantityType (with units) or a plain number - I think this is one of your problems.

Do you really want your rule to run on update, or on change? These are not the same thing.

I’m not an expert in de Rules DSL, but I thought that the semicolons ; isn’t needed at the end of the line.
So maybe this is the problem?

1 Like

Hello and thank you all for your help.

Inserted. :slight_smile:

I deleted them.

Here it is:

2020-01-05 16:41:07.512 [vent.ItemStateChangedEvent] - ZWaveNode006014G0160RoomThermostat_SensorTemperature changed from 22.88 °C to 23.13 °C
2020-01-05 16:41:07.535 [vent.ItemStateChangedEvent] - zwave_serial_zstick_d05e1c4f_serial_sof changed from 4184 to 4185
2020-01-05 16:41:07.536 [me.event.ThingUpdatedEvent] - Thing 'zwave:device:d05e1c4f:node6' has been updated.
2020-01-05 16:41:08.537 [vent.ItemStateChangedEvent] - zwave_serial_zstick_d05e1c4f_serial_ack changed from 1393 to 1394
2020-01-05 16:41:08.543 [vent.ItemStateChangedEvent] - zwave_serial_zstick_d05e1c4f_serial_sof changed from 4185 to 4186
2020-01-05 16:41:08.560 [vent.ItemStateChangedEvent] - zwave_serial_zstick_d05e1c4f_serial_sof changed from 4186 to 4187
2020-01-05 16:41:14.707 [vent.ItemStateChangedEvent] - zwave_serial_zstick_d05e1c4f_serial_sof changed from 4187 to 4188
2020-01-05 16:41:14.711 [vent.ItemStateChangedEvent] - ZWaveNode006014G0160RoomThermostat_SetpointHeating changed from 22 °C to 25 °C

I don’t know, how to trigger the rule. I want to set the thermostate mode of my heaters, after the room thermostate setpoint has been changed.
What woulld be the code in case I want to run the rule on update?

Regards
Michael

Hi

Is it the UoM that is the issue?

I know about the .toString command, so I assume there is a similar command that will strip out the °C UoM ?

So the rule will need this extra command after the .state

Try adding a few logInfo("temp_triggers","Rule triggered")

Lines, and keep an eye on openhab.log

Then you’d use a changed rule trigger, no? Periodic updates to the same value would then be ignored.

Your Item is Number:Temperature type, so its state is expressed as a QauntityType with units. It’s not 23.13, it is 23.13 °C

You cannot get a useful result comparing 23.13 °C with 23. 23 of what, °C, °F, K, bananas?
There are two ways to deal with this

1 Like

Hello everybody,

ok, I stripped the semicolons (semicola?).
I added “=”.
I changed the trigger to “…received update” and, due to

compared the temperature with a temperature.

Now it works as intended.
Thank you all again for your time, your interest and patience with a noob.

For any other person with similar problems I leave the code here:

rule "Heizung WZ an bei Kälte"

when
        Item ZWaveNode006014G0160RoomThermostat_SetpointHeating received update
then
        if (ZWaveNode006014G0160RoomThermostat_SetpointHeating.state>=24 | "°C") {
                sendCommand(ZWaveNode002SpiritThermostaticValveWZE_ThermostatMode, "1")
                sendCommand(ZWaveNode002SpiritThermostaticValveWZE_SetpointEnergyHeat, "22.5")
                sendCommand(ZWaveNode003SpiritThermostaticValveWZW_ThermostatMode, "1")
                sendCommand(ZWaveNode003SpiritThermostaticValveWZW_SetpointEnergyHeat, "22.5")
        }
        else {
                if (ZWaveNode006014G0160RoomThermostat_SetpointHeating.state<=22 | "°C") {
                        sendCommand(ZWaveNode002SpiritThermostaticValveWZE_ThermostatMode, "0")
                        sendCommand(ZWaveNode003SpiritThermostaticValveWZW_ThermostatMode, "0")
                }
        }
end

Regards
Michael

3 Likes