The items used with HTTP Binding to gather data (once for 1 second):
//items for JSONPATH (gather data from Arduino, PowerManagement board)
Number EolianEvent { http="<[arduino:1000:JSONPATH($.Eoliana.[0])]" }
DateTime EolianLastUpdated
Number SolarEvent { http="<[arduino:1000:JSONPATH($.Solar.[0])]" }
DateTime SolarLastUpdated
Number BatteryEvent { http="<[arduino:1000:JSONPATH($.Baterii.[0])]" }
DateTime BatteryLastUpdated
The item used for postUpdate in order to display in HABPanel:
String HabpanelBattery "HabpanelBattery"
The rule:
var Timer timer = null
val String status = null //battery bank status
val b = (BatteryEvent.state() as Number)
rule "battery bank status"
when Item BatteryEvent changed
then
//define status of the battery bank
if (b >= 114){status = "OVER"}
else if (b < 114 && b >=102) {status = "NORMAL"}
else if (b < 102 && b >= 96) {status = "ECO"}
else if (b < 96 && b >= 86) {status = "UNDER"}
else if (b < 86 || b == null) {status = "Error"}
HabpanelBattery.postUpdate(status) //display data in Habpanel
end
Tried already: increased time for HTTP Binding to sync data once per 10 sec (instead of 1 by default) but no results. I have to mention that data coming once per 1 second from HTTP Binding is displayed in HABPanel instantly, without any delay.
The issue:
HABPanel update the item HabpanelBattery (Dummy Settings widget) when I manually saved the rule. Otherwise not at all.