Hello Community,
i have generated a rule with Habpanel, since 2 years, and with the latest 2.5 Version of openhab it doesnt work anymore.
// This rule file is autogenerated by HABmin.
// Any changes made manually to this file will be overwritten next time HABmin rules are saved.
Imports
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import org.joda.time.*
// Global Variables
rule "Steckerleiste Schlafzimmer um 2:00 Uhr ausschalten"
when
Time cron "0 * * * * ?"
then
if ((((new LocalTime().getLocalMillis()) >= (new LocalTime(2, 0, 0, 0).getLocalMillis())) && ((new LocalTime().getLocalMillis()) <= (new LocalTime(2, 30, 0, 0).getLocalMillis())) && (flagitemtvbed.state == ON))) {
sendCommand(Power_FF_Bed, OFF)
}
end
I noticed it after I rewrote the rule because I haven’t used it for a long time.
i tried to change it to:
rule "Steckerleiste Schlafzimmer um 2:00 Uhr ausschalten"
when
Item MartinsPhone received update OFF or
Time cron "0 0 2 * * ?"
then
if (flagitemtvbed.state == ON && Power_FF_Bed.state == ON) {
Power_FF_Bed.sendCommand(OFF)
}
end
can someone help me to get this rule working again, it should turn off a sonoff pow after 2 o clock or when my phone is not in the wlan, maybe someone can show me a better solution to do this with a rule.
I probably made a mistake because I previously commented everything out with // and have no backup of the original file