Hi all.
Living in South Brazil, I’m experiencing a very warm summer, which means that I’m using my ACs a lot. That also means that my electric bill is getting very expensive.
To avoid surprises on the bill, I created a few sensors to estimate the cost of each AC unit.
# The power consumption for the bill is always measured around the 5th, so we need to use the lastest 5th as a start date
sensor:
- platform: history_stats
name: Livingroom AC Cooling
entity_id: climate.livingroom_ac
state: 'cool'
type: time
end: '{{ now() }}'
start: '{{ as_timestamp(now().replace(day=5).replace(hour=0).replace(minute=0).replace(second=1))-2592000 if now().day < 6 else now().replace(day=5).replace(hour=0).replace(minute=0).replace(second=1)}}'
- platform: history_stats
name: Bedroom AC Cooling
entity_id: climate.bedroom_ac
state: 'cool'
type: time
end: '{{ now() }}'
start: '{{ as_timestamp(now().replace(day=5).replace(hour=0).replace(minute=0).replace(second=1))-2592000 if now().day < 6 else now().replace(day=5).replace(hour=0).replace(minute=0).replace(second=1)}}'
##### COST #####
# kWh cost: R$ 0.654533 (for the first 150kWh)
# kWh cost: R$ 0.782816 (after the first 150kWh)
# We will just use the most expensive one. Best safe than sorry.
# Cooling power consumption: 1.092kW (1092W) - from ACs specs
- platform: template
sensors:
bedroom_ac_power_consumption:
friendly_name: "Bedroom AC Power Consumption"
unit_of_measurement: 'kWh'
value_template: "{{states('sensor.bedroom_ac_cooling')|float * 1.092}}"
livingroom_ac_power_consumption:
friendly_name: "Livingroom AC Cost"
unit_of_measurement: 'kWh'
value_template: "{{states('sensor.livingroom_ac_cooling')|float * 1.092}}"
bedroom_ac_cost:
friendly_name: "Bedroom AC Cost"
unit_of_measurement: 'R$'
value_template: "{{'%.2f'|format(states('sensor.bedroom_ac_power_consumption')|float * 0.782816)}}"
livingroom_ac_cost:
friendly_name: "Livingroom AC Cost"
unit_of_measurement: 'R$'
value_template: "{{'%.2f'|format(states('sensor.livingroom_ac_power_consumption')|float * 0.782816)}}"
total_ac_cost:
friendly_name: "Total AC Cost"
unit_of_measurement: 'R$'
value_template: "{{'%.2f'|format(states('sensor.livingroom_ac_cost')|float + states('sensor.livingroom_ac_cost')|float)}}"
Here’s how it looks on Lovelace
I do know that the ACs don’t have a 100% duty cycle and are probably using much less power, but the idea is to have a rough estimate, at least while I don’t get a full house power consumption sensor.