Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95272

Heating season starting date in template/History Statistics Sensor

$
0
0

@Dimster wrote:

I would like to count heater running hours starting every 01 August. Currently I set up the following code for the sensor:

- platform: history_stats
    name: Heater running hours
    entity_id: sensor.input3_state
    state: '1'
    type: time
    start: '{{ now().replace(year=(now().year-1)).replace(month=8).replace(day=1).replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'

I understand that it counts now not only this season but also takes last year. I would like to find solution for excluding last year if the current date is in between August-December.

Need your help!

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95272

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>