Newbie with both InfluxDB and Grafana here. I’ve got a Home Assistant setup which feeds data from my Ecobee into InfluxDB. I am trying to create a grafana graph that overlays the indoor temperature with the state of my furnace, so that I can show runtimes of my furnace overlaid on the temp). I have a field called hvac_action_str which can have a few different values, one of which is ‘heating’. I want to do something like consider heating to be a value of 1 and anything else to be a 0 so I can graph it as a simple boolen on or off type of thing.
I thought this must be a common problem but I’ve been searching and haven’t hit on the answer yet. I saw some suggestions to edit the sql and do a SELECT IF(hvac_action_str = ‘heating’, 1, 0) but either grafana or influxdb doesn’t like that (says that the = operator is expected in the WHERE clause.)
There must be a straightforward way to do this, no? Or am I misunderstanding something fundamental? Thanks!