Hive heating history

I’ve setup a new Hass.io install and added the Hive component which has picked up my heating nicely.

What I want to do is be able to track how long my heating is running for each day so I added the History Statistics Sensor and now the display appears in the history window under the default history as it should.

I used the following code…
sensor:

  • platform: history_stats
    name: Heating ON today
    entity_id: climate.heating
    state: ‘on’
    type: time
    start: ‘{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}’
    end: ‘{{ now() }}’

This gives me a line graph with three series: heating current temperature, heating target temperature and heating heating.

I was hoping the “heating heating” would tell me when the heating is running but it doesn’t display at all in the graph window.

Please can someone help me get a view of when the heating is running?

I am not sure I fully understand what you are trying to achieve, but I use the history stats on hive to show how long the heating was on for today and yesterday:
image

which when clicked on shows:
image

The code behind those is:

 - platform: history_stats
   name: Heating On Today
   entity_id: sensor.heating_state
   state: 'On'
   type: time
   start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
   end: '{{ now() }}'
 - platform: history_stats
   name: Heating On Yesterday
   entity_id: sensor.heating_state
   state: 'On'
   type: time
   end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
   duration:
     hours: 24

Is this the sort of thing you are looking for?

3 Likes

I’ve tried setting up same but I get nothing. My Hive thermostat entity has a different name:

sensor:

  • platform: history_stats
    name: Heating On Today
    entity_id: climate.receiver_1
    state: ‘heating’
    type: time
    start: ‘{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}’
    end: ‘{{ now() }}’
  • platform: history_stats
    name: Heating On Yesterday
    entity_id: climate.receiver_1
    state: ‘heating’
    type: time
    end: ‘{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}’
    duration:
    hours: 24

I have tried different states - heat. heating and on - heat seems to be the default as I do get back stats for that which equates to hours of the day - i.e. yesterday shows 24 hours - Wheras heating was probably only on for 3-4 hours

How do I find the state I need to set in this history sensor?