Max heat mode per day

Hello Everyone,

i’m nearly owner of the Nest climate :slight_smile: And i’d like to control my energy consumption.
I already a history sensor in order to get the total duration that the nest have been in the heat mode.

timeInHeatMode : 2.45 h

It’s really nice but it’s a linear information

There is a way to update only once a day, that number ( in order to graph in Grafana) ?
thanks

If you are already using MQTT, I offer you this brute-force solution. It’s not elegant but it should make it easier to produce the graph you want.

You already have a History Statistics sensor. I assume it is called sensor.timeinheatmode.

  • Create an MQTT Sensor that represents the total time in heat mode. In this example, I called it: sensor.totaltimeinheatmode.
  • Create an automation to set sensor.totaltimeinheatmode = sensor.timeinheatmode at the end of the day.
sensor:
  - platform: mqtt
    name: 'TotalTimeInHeatMode'
    state_topic: home/heatinghours


automation:
  - alias: 'Publish total heating hours for today'
    trigger:
      platform: time
      at: '23:59:00'
    action:
      service: mqtt.publish
        data_template:
          topic: home/heatinghours
          payload: "{{states('sensor.timeinheatmode')}}"

sensor.totaltimeinheatmode contains only one value per day so it will easily produce the chart you desire.

The only glitch is that the last day in the series (i.e. the current day) will contain the previous day’s data. That’s because sensor.totaltimeinheatmode doesn’t get updated until the end of the current day.

1 Like