SOLVED: Control Z Wave Thermostat Popp via Rule

Hi Everyone,

i want to control my Popp 010101 Thermostat via Rules.
I can change the Temperature via slider, and this Widget on the Habpanel.

But my Rule is not working:

rule "heizen morgens" 
when Item exec_command_anwesenheit_output received update //Presence check
then 
var Number hour = now.getHourOfDay if
((hour >= 5) && (hour <= 7)) {
if
(exec_command_anwesenheit_output.state == OFF) // Someone ist at home
{
sendCommand (zwave_device_94f48f98_node9_thermostat_setpoint_heating, 20.0)
sendCommand (zwave_device_94f48f98_node8_thermostat_setpoint_heating, 20)
}
}
end

No Errors in the log-files!

Config:
Openhab 2
openHAB 2.1.0-1 (Build )
Raspberry Pi 3
Z Wave Stick ZME_UZB1

Any Ideas?
What is wrong?

Thank You!

Add a logInfo in there and see if the rule even gets triggered.

Right now it should only be triggered, if somebody comes home or leaves right? (Whenever exec_command_anwesenheit_output receives an update)
Wouldn’t it make more sense to trigger the rule depending on cron and then check if somebody is at home?

Hey Nicolas,

thanks for your answer.
Im new in den Rules section. I do not know how i add a logInfo. But i will find it out.

When the exec Command is OFF somebody is home.
There is no Update. Here i read

(an update might leave the status unchanged)

This works in another rule perfect.

Yeah okay, but think about what you want to achieve.
Is the rules purpose to do smth depending on presence or time?
Based on the name you gave to the rule “heizen morgens” I highly suspect the latter one. Otherwise you would have named it smth like “heizen Anwesenheit”. You see what I mean?

just put the line

logInfo('rule_heizen_morgens', 'rule has been fired') 

right after the “then”. By doing this you can check in the log if the rule even has been fired.

1 Like

Ah nice, so easy :smiley: thx!
Ok, the Rule fires. But only when the exec item changing the status :frowning:
And the z wave device isn’t changing.

I think the error is hidden here

sendCommand (zwave_device_94f48f98_node9_thermostat_setpoint_heating, 20.0)
sendCommand (zwave_device_94f48f98_node8_thermostat_setpoint_heating, 20)

ditch the space… sendCommand(zwave.....)
and change the trigger to

when 
    Item exec_command_anwesenheit_output changed or
    Time cron "0 0 5 1/1 * ? *"

by doing so it gets fired everyday at 5 am and whenever the presence changes

Okay, now it looks like

rule "heizen morgens" 
when 
Item exec_command_anwesenheit_output changed or
Time cron "0 0 5 1/1 * ? *"
then
logInfo('rule_heizen_morgens', 'rule has been fired') 
var Number hour = now.getHourOfDay 
if
((hour >= 12) && (hour <= 15)) {
if
(exec_command_anwesenheit_output.state == OFF)
{
sendCommand(zwave_device_94f48f98_node9_thermostat_setpoint_heating, "20.0")
sendCommand(zwave_device_94f48f98_node8_thermostat_setpoint_heating, "20")
}
}
end

But the Setpoint will not change.
I tried 20, “20”, 20.0, “20.0”…

1 Like

Wrong:

Right:
(exec_command_anwesenheit_output.state ==

“OFF”

)
Thank You very much!!

@Moriarty: why do you use different times in your “Time cron” tag and the “if ((hour >= 12 …” tag?
May be this is the reason why the rule will never be triggered?

Im only using Time cron.The rule works fine!