Hello
I am not really family with openHAB since I started with openHAB last Christmas. So I hope my questions are not to silly. I use e energy meter connected to openHAB thru modbus binding und rrd4j to store the data. In Switzerland the energy-coast ar daytim-depending (and weekday too ). For now I try to calculate the coast with this smal roule. But I think nothing happens. How can I check if the roule is working? Is there a way to start and debug the roule? in …/logs/openhab.log are no entrys. Thanks for any hint.
rule “StromkostenNiedertarif”
when
Time cron "0 0 7 * * ?"
then
KWH_N_1 = KWH_L1_L2_L3.state as DecimalType
KWH_N_2 = KWH_L1_L2_L3.historicState(now.minusHours(11)).state as DecimalType
KWH_N = KWH_N_1 - KWH_N_2
KW_CHF_N = KWH_N * NT
end
rule "StromkostenHochtarif"
when
Time cron "0 0 20 * * ?"
then
KWH_H_1 = KWH_L1_L2_L3.state as DecimalType
KWH_H_2 = KWH_L1_L2_L3.historicState(now.minusHours(13)).state as DecimalType
KWH_H = KWH_H_1 - KWH_H_2
KW_CHF_H = KWH_H * HT
end
rule "UpdateKosten"
when
Item KW_CHF_H changed or
Item KW_CHF_N changed
then
KW_CHF_T = KW_CHF_H + KW_CHF_N
KW_CHF.postUpdate(KW_CHF_T)
KW_CHF_T = (0)
KW_CHF_H = (0)
KW_CHF_N = (0)
end