sorry for the noobish question but i am trying for hours now and cannot make any progress …
I have a switch item i want to display in grafana via influxdb.
i checked in the influxdb and the item is updated (1 to 0 and vice versa).
If i implement the exact same item in grafana it just stays at 0.
i read that switch items are supported but i also tried converting it to a number.
i found a thread that explains how to do that: sendCommand() Documentation - #9 by rlkoshak
but i cannot get any of those working. Other graphs work fine (so i know it’s not an authorization problem or bucket or something like that.
Here’s a screenshot of my influxdb, grafana graphs and the configs i made
I used to plot many switches in Grafana as a heatmap. It worked very well without doing anything special. I haven’t been able to recently, but only because the binding was changed so that the switch channel is now a string type and that doesn’t work in influx-Grafana.
rule "Warmwasserzirkulationspumpe Switch to Number"
when
Item KG_Technikraum_Zirkulationspumpe changed
then
val int zero = 0
val int one = 1
if (KG_Technikraum_Zirkulationspumpe.state == ON)
{
KG_Technikraum_Zirkulationspumpe_Nummer.sendCommand(one)
KG_Technikraum_Zirkulationspumpe_Number.sendCommand(1.0)
}
if (KG_Technikraum_Zirkulationspumpe.state == OFF)
{
KG_Technikraum_Zirkulationspumpe_Nummer.sendCommand(zero)
KG_Technikraum_Zirkulationspumpe_Number.sendCommand(0.0)
}
end
Does also not work for me …
I also tried without int
I just checked. Switch type items OFF or ON appear in Grafana as 0 or 1 for me. I even do a math calculation to scale them up to 100 and then plot them on a heat map together with dimmers. Item state is updated by a binding. I am using influx persistence config file.
strategy = everyUpdate, everyChange, everyHour
What are your Grafana query settings for the item?
everything was working fine.
The problem was my aggregation argument in grafana (6 minutes) → that did negate my fast on/off switching for debugging reasons …