- Platform information:
- Hardware: RPi 3 B+
- openHAB version: 2.5.12
I am using the AVG function to calculate the average of all my items (relative humidity). The AVG function ignores NULL state items. However, recently I realized that when one of my sensors went down, it was showing “nan” on ESPEASY web interface, but openhab (OH2.5.12) showed the last valid sensor reading on sitemap and the item state was stuck to that value (so it was not NULL), even though it had not updated for over 12 hours. Subsequently, this completely threw off the Average value of all the group items. I haven’t found a work around this yet. Any suggestions, tips or insight would be appreciated.
Item file (multiple sensors, so multiple items, but only showing one below):
Group F2_rh_group //group for all RH sensors
Group:Number:AVG hu_average_g_item "hu_average_g_item [%.1f]" //this group item will calculate the avg values from its member items
Number f2_htc_112_rh "f2_htc_112_rh" (F2_rh_group, hu_average_g_item) {channel="mqtt:topic:MQTTBroker:F2_HTC_112:f2_htc_112_rh"}
Sitemap file:
Frame label="RH"
{
Text item=hu_average_g_item label="hu_average_g_item"
}