Unfortunately, I don’t have an energy meter monitor and my provider doesn’t have an API which I can tap into. I do, however, get my total kWh consumed over the previous day in a daily email.
I have managed to extract this value in Node Red and insert it into msg.html
. Now, I would like to “post” this to the HA energy feature so I can keep track of daily usage.
Based on some Googling, I tried to create an energy sensor this way.
household_energy_yesterday:
# Set up a friendly name
friendly_name: Yesterday's Household Energy Usage
# Use kWh, as that's the unit of the source
unit_of_measurement: kWh
# Set the icon
icon_template: mdi:history
# Store yesterday's cumulative energy in a new variable
value_template: "{{ state_attr('sensor.household_energy_daily', 'last_period') }}"
As well as some utility meters:
utility_meter:
daily_energy:
name: "Tri-County Electric Daily Usage"
source: sensor.tce_energy_in_kwh
cycle: daily
monthly_energy:
name: "Tri-County Electric Monthly Usage"
source: sensor.tce_energy_in_kwh
cycle: monthly
Neither of these are selectable as energy sources under ADD CONSUMPTION
.
How can I get this value I extracted from the email to post into the energy database for yesterday’s usage, preferably continuing to use Node Red?