Grafana displaying Hive Status

Hi,

I am using the Hive Integration and this stores ‘On’ and ‘Off’ in the state of the sensor field along with a time when the activity happens.
In Grafana I can see this with the following query:
SELECT state,time FROM “sensor.thermostat_1_state”

response:Object
results:Array[1]
0:Object
statement_id:0
series:Array[1]
0:Object
name:“sensor.thermostat_1_state”
columns:Array[2]
0:“time”
1:“state”
values:Array[37]
0:Array[1619208498867,OFF]
1:Array[1619209972681,ON]
2:Array[1619210871862,OFF]

I can’t work out how to draw a graph with this though showing the times the boiler comes on/off. In Home Assistant directly I do get this:

Can anyone help/assist please?

Thanks

Rob

Add this to your Grafana addon options:

plugins:
  - flant-statusmap-panel

You can then make graphs like this:

Great thanks Tom. I will give this a try and report back.

That worked a treat - thanks a lot Tom.

Next step is to try and work out how long my boiler is spending on a day but that’s a case of me wrapping my head around InfluxDB SQL!

Use a history stats sensor?

1 Like

Thanks Tom. Just noticed your reply after putting that message on last night I discovered the History Stats and used that mechanism. I actually had to combine it with a ‘template’ to get it into InfluxDB so I ended up with the content below. I am still learning a lot but I’m enjoying it.

  • platform: history_stats
    name: Boiler On today
    entity_id: sensor.thermostat_1_state
    state: “ON”
    type: time
    start: “{{ now().replace(hour=0, minute=0, second=0) }}”
    end: “{{ now() }}”

    • platform: template
      sensors:
      todayboilertotal:
      friendly_name: “Boiler Time Today”
      unit_of_measurement: time
      value_template: “{{ (states(‘sensor.boiler_on_today’)) }}”