- Platform information:
- Hardware: Raspberry Pi 4 Model B Rev 1.1
- OS: Linux version 6.1.21-v8+
- PRETTY_NAME=“Raspbian GNU/Linux 12 (bookworm)”
- Java Runtime Environment:OpenJDK Client VM version 17.0.11+9-Raspbian-1deb12u1rpt1
- openHAB version: 4.2.0
- ECMAScript (ECMAScript 262 Edition 11)
I have a blockly rule that checks if my InfluxDB 2 (2.6.1) on a NAS is saving values.
I use an item that changes all the time.
The persistence works fine since a long time without issues.
My rule fires every 2 minutes.
For unknown reasons the item, that definitely gets changed regularly, does not always return the persistence.lastChanged time.
If I press the “Run Now” button inside the script editor, the rule returns the time just fine.
I’m not 100% sure, but I think before switching to OH4.2.0 the check was working.
I already recreated the rule after switching to OH4.2.0
I checked that the persistence item is the one that is stored inside the InfluxDB.
Blockly:
–>Show generated Code:
timeLastChanged = items.getItem('EasyMeterWattSumme').persistence.lastChange( 'influxdb');
console.info(['Time EasyMeter_WattSumme changed Last time: ', timeLastChanged]);
When the rule is triggered by cron (cronExpression: 0 0/2 * ? * * *):
2024-08-16 10:10:00.481 [DEBUG] [e.automation.internal.RuleEngineImpl] - The trigger '1' of rule 'f878bdc52b' is triggered.
2024-08-16 10:10:01.593 [INFO ] [nhab.automation.script.ui.f878bdc52b] - Time EasyMeter_WattSumme changed Last time: ,
2024-08-16 10:10:01.596 [DEBUG] [e.automation.internal.RuleEngineImpl] - The rule 'f878bdc52b' is executed.
2024-08-16 10:12:00.481 [DEBUG] [e.automation.internal.RuleEngineImpl] - The trigger '1' of rule 'f878bdc52b' is triggered.
2024-08-16 10:12:01.487 [INFO ] [nhab.automation.script.ui.f878bdc52b] - Time EasyMeter_WattSumme changed Last time: ,
If I press the “Run Now”:
2024-08-16 10:12:01.490 [DEBUG] [e.automation.internal.RuleEngineImpl] - The rule 'f878bdc52b' is executed.
2024-08-16 10:13:10.281 [INFO ] [nhab.automation.script.ui.f878bdc52b] - Time EasyMeter_WattSumme changed Last time: ,2024-08-16T10:12:59.939+02:00[Europe/Berlin]
2024-08-16 10:13:10.286 [DEBUG] [e.automation.internal.RuleEngineImpl] - The rule 'f878bdc52b' is executed.
2024-08-16 10:13:15.639 [INFO ] [nhab.automation.script.ui.f878bdc52b] - Time EasyMeter_WattSumme changed Last time: ,2024-08-16T10:12:59.939+02:00[Europe/Berlin]
2024-08-16 10:13:15.642 [DEBUG] [e.automation.internal.RuleEngineImpl] - The rule 'f878bdc52b' is executed.
Thanks for help.