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
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?
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.
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”…
@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?