- Platform information:
- Hardware: Raspberry PI 3
- OS: openhabian 1.4
- Grafana 5.3.4
I want to display different webviews depending on what time slot i am selecting.
I have four webviews that display the same chart with different times (day, week, month, year):
Webview icon=none url="http://openhabianpi:3000/d/ioB0_uWgk/raumtemperatur?orgId=1&panelId=4&theme=light&kiosk&fullscreen&from=now-1d&to=now" height=11 visibility=[Proxy_TemperatureGroundFloor_DisplayDay==ON]
Webview icon=none url="http://openhabianpi:3000/d/ioB0_uWgk/raumtemperatur?orgId=1&panelId=4&theme=light&kiosk&fullscreen&from=now%2Fw&to=now" height=11 visibility=[Proxy_TemperatureGroundFloor_DisplayWeek==ON]
Webview icon=none url="http://openhabianpi:3000/d/ioB0_uWgk/raumtemperatur?orgId=1&panelId=4&theme=light&kiosk&fullscreen&from=now%2FM&to=now" height=11 visibility=[Proxy_TemperatureGroundFloor_DisplayMonth==ON]
Webview icon=none url="http://openhabianpi:3000/d/ioB0_uWgk/raumtemperatur?orgId=1&panelId=4&theme=light&kiosk&fullscreen&from=now%2Fy&to=now" height=11 visibility=[Proxy_TemperatureGroundFloor_DisplayYear==ON]
So select the time range, I have a switch item:
Switch item=Proxy_TemperatureGroundFloor_TimeSelection label="Zeitbereich" mappings=[0="Tag", 1="Woche", 2="Monat", 3="Jahr"]
and finally a rule that changes the items for visibility:
rule "Display Temperature Ground Floor"
when
Item Proxy_TemperatureGroundFloor_TimeSelection received command
then
switch(receivedCommand)
{
case 0:{ //day
logInfo("Temperature groundfloor", "Day")
Proxy_TemperatureGroundFloor_DisplayDay.postUpdate(ON)
Proxy_TemperatureGroundFloor_DisplayWeek.postUpdate(OFF)
Proxy_TemperatureGroundFloor_DisplayMonth.postUpdate(OFF)
Proxy_TemperatureGroundFloor_DisplayYear.postUpdate(OFF)
}
case 1:{ //week
logInfo("Temperature groundfloor", "1")
Proxy_TemperatureGroundFloor_DisplayDay.postUpdate(OFF)
Proxy_TemperatureGroundFloor_DisplayWeek.postUpdate(ON)
Proxy_TemperatureGroundFloor_DisplayMonth.postUpdate(OFF)
Proxy_TemperatureGroundFloor_DisplayYear.postUpdate(OFF)
}
case 2:{ //month
logInfo("Temperature groundfloor", "2")
Proxy_TemperatureGroundFloor_DisplayDay.postUpdate(OFF)
Proxy_TemperatureGroundFloor_DisplayWeek.postUpdate(OFF)
Proxy_TemperatureGroundFloor_DisplayMonth.postUpdate(ON)
Proxy_TemperatureGroundFloor_DisplayYear.postUpdate(OFF)
}
case 3:{ //year
logInfo("Temperature groundfloor", "3")
Proxy_TemperatureGroundFloor_DisplayDay.postUpdate(OFF)
Proxy_TemperatureGroundFloor_DisplayWeek.postUpdate(OFF)
Proxy_TemperatureGroundFloor_DisplayMonth.postUpdate(OFF)
Proxy_TemperatureGroundFloor_DisplayYear.postUpdate(ON)
}
}
end
The problem is that I am getting an error from grafana that the time zone is invalid when changing e.g. from day to week:
When I hit F5 in the browser the current chart is working again. But switching to another time zone causes the same error again.
My first idea was that grafana does not like it if several charts are loaded at the same time. (The visibility tag just shows/hides an HTML element)
But if I remove the visibility tag from the items in the sitemap, all graphs are shown without issues.
The URLs in the webview show no difference - iāve doublechecked that with the developer tools from Chromeā¦
OK: I just realized that is seems to be browser related. Chrome and Edge have the same issue. The Android App is working fine.
So itās not a real OH (or grafana) problem. But did somebody realize something similiar or did somebody run into the same issues (and maybe has a solution for browsers?)