I have a Number item that gets changed by a rule (depending on status of another Text item).
My Item is in a persistence group that should get persisted on everyChange (also tried everyUpdate).
I can’t get that configuration to work (tried postUpdate and sendCommand), the only way I found is to call Item.persist in my rule.
Is that working as intended or did I just found a bug?
If that’s working as intended, it would be good to have that written somewhere clearly visible in documentation.
rules/Sensors.rules
rule "Update ALL4176 Power value"
when
Item ALL4176_Voltage changed or
Item ALL4176_Current changed
then
ALL4176_Power.postUpdate(ALL4176_Current.state as Number * ALL4176_Voltage.state as Number)
end
Logging shows (DEBUG log level for org.openhab.persistence.influxdb enabled) that there are no values logged, despite the item gets changed:
2018-12-12 08:35:21.101 [vent.ItemStateChangedEvent] - ALL4176_Voltage changed from 226.37 V to 226.7 V
2018-12-12 08:35:21.104 [vent.ItemStateChangedEvent] - ALL4176_Power changed from 33.9555 W to 34.005 W
Group GP_Persist_Minute works as expected, so persistence itself works:
==> /log/openhab2/events.log <==
2018-12-12 08:34:51.025 [vent.ItemStateChangedEvent] - Memory_Used_Percent changed from 57.4 % to 57.0 %
==> /log/openhab2/openhab.log <==
2018-12-12 08:35:00.008 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 57.0
==> /log/openhab2/openhab.log <==
2018-12-12 10:49:57.333 [DEBUG] [.internal.InfluxDBPersistenceService] - got DecimalType value 33.9645
==> /log/openhab2/events.log <==
2018-12-12 10:49:57.331 [vent.ItemStateChangedEvent] - ALL4176_Voltage changed from 226.72 V to 226.43 V
2018-12-12 10:49:57.333 [vent.ItemStateChangedEvent] - ALL4176_Power changed from 34.008 W to 33.9645 W
Do I also have to restart, when I don’t touch the .persist file, but add another Item to a Group that gets persisted?
I tried to add an item to the hourly persistence group, but it didn’t get persisted.
Okay yeah, it is so. I had one item that got persisted at full hour trigger (that had assigned this one before last restart), the other ones that I added after restart didn’t…