Hi,
I’ve a rule which should flush my heating valves, when they aren’t used for 14 days.
rule "Ventilspülung"
when
Time cron "0 0 4 * * ?"
then
// Ventilspülung, wenn ein Ventil in den letzten 2 Wochen nicht bewegt wurde
if (!StatusHeizenBad.changedSince(now.minusDays(14)) ||
!StatusHeizenGaestezimmer.changedSince(now.minusDays(14)) ||
!StatusHeizenSchlafzimmer.changedSince(now.minusDays(14)) ||
!StatusHeizenWohnzimmer.changedSince(now.minusDays(14))
) {
sendCommand(Ventilspuelung, ON)
logInfo("Debug", "Ventilspülung: Bad: " + StatusHeizenBad.changedSince(now.minusDays(14)) + " GZ: " + StatusHeizenGaestezimmer.changedSince(now.minusDays(14)) + " SZ: " + StatusHeizenSchlafzimmer.changedSince(now.minusDays(14)) + " WZ: " + StatusHeizenWohnzimmer.changedSince(now.minusDays(14)))
}
end
This rule fires every night at 4 o’clock and flushes my valves although they should if one valve hasen’t used in the last 14 days. Especially in winter time this rule shouldn’t match at all, but it does.
I see in the events.log, that all four items/valves changed last night and the night before and so on and I also see this in my influxdb, which is the persistence service.
Although all items change every night my debug log line show something like this (the true and false are inverted, which means every item should show true, as the item changed in the last 14 days):
No, every valves opena and close, so their state definately changes.
Meanwhile I think there must be a bug, as every valve changes within these 14 days, but just two valves behave correct.
A look at my influxdb data shows, that every valce changes its state in the last 14 days (ON/OFF), but just Bad and WZ (Wohnzimmer) show a true (which means they have changed within the last 14 days).
Might be worth to mention: with OH1 this rule worked correct.
The influxdb content looks good, so I assume everything works fine with the persistent service.
I’ve made some influx queries, which show, that every valve had some OFFs and ONs in the last 2 days:
> select count(value) from StatusHeizenGaestezimmer where time > now() - 2d and value=1
name: StatusHeizenGaestezimmer
time count
---- -----
2017-03-19T08:34:51.606993156Z 11
> select count(value) from StatusHeizenGaestezimmer where time > now() - 2d and value=0
name: StatusHeizenGaestezimmer
time count
---- -----
2017-03-19T08:34:57.313266312Z 2873
> select count(value) from StatusHeizenWohnzimmer where time > now() - 2d and value=0
name: StatusHeizenWohnzimmer
time count
---- -----
2017-03-19T08:35:12.169142395Z 2873
> select count(value) from StatusHeizenWohnzimmer where time > now() - 2d and value=1
name: StatusHeizenWohnzimmer
time count
---- -----
2017-03-19T08:35:15.287698896Z 11
> select count(value) from StatusHeizenSchlafzimmer where time > now() - 2d and value=1
name: StatusHeizenSchlafzimmer
time count
---- -----
2017-03-19T08:35:29.165601842Z 11
> select count(value) from StatusHeizenSchlafzimmer where time > now() - 2d and value=0
name: StatusHeizenSchlafzimmer
time count
---- -----
2017-03-19T08:35:32.84251568Z 2873
> select count(value) from StatusHeizenBad where time > now() - 2d and value=0
name: StatusHeizenBad
time count
---- -----
2017-03-19T08:35:48.614349985Z 2567
> select count(value) from StatusHeizenBad where time > now() - 2d and value=1
name: StatusHeizenBad
time count
---- -----
2017-03-19T08:35:56.338781531Z 448