No examples around here with Greeneye monitors so I thought I’d share an example configuration for calculating costs and accounting using utility_meter. Here is how to calculate the cost of my furnace and heat pump to build a gauge that shows today’s HVAC cost.
Here’s my Greeneye config:
greeneye_monitor:
port: 8000
monitors:
- serial_number: XXXXXXXXX
channels:
- number: 3
name: furnace_power
- number: 4
name: heatpump_power
I’ve added an input_number
to specify energy cost so you can change this easily from the UI.
input_number:
energy_cost:
name: "Energy Cost"
unit_of_measurement: "$"
icon: mdi:currency-usd
mode: box
min: 0
max: 1
Now to convert from watt seconds to kwh. You can consider skipping this step if seeing kwh values isn’t useful for you and do this calculation in the final sensor.
sensor:
- platform: template
sensors:
power_heatpump_kwh:
friendly_name: 'Heat Pump kwH'
unit_of_measurement: kwH
value_template: "{{ state_attr('sensor.power_heatpump', 'watt_seconds') * 0.00000028 }}"
power_furnace_kwh:
friendly_name: 'Furnace kwH'
unit_of_measurement: kwH
value_template: "{{ state_attr('sensor.power_furnace', 'watt_seconds') * 0.00000028 }}"
You’ll need to use the utility_meter
system to do accounting.
utility_meter:
meter_hvac_daily:
source: sensor.power_heatpump_kwh
cycle: daily
meter_furnace_daily:
source: sensor.power_furnace_kwh
cycle: daily
Now the sensor (template) to calculate the cost. Note that instead of rounding I use a different way to format the price so that there are always 2 digits after the decimal point.
hvac_daily_cost:
friendly_name: 'HVAC Daily Cost'
value_template: >
{{ "%.2f" | format(((states('sensor.meter_hvac_daily') | float)+(states('sensor.meter_furnace_daily')|float)) * states('input_number.energy_cost')|float) }}
icon_template: mdi:gauge
unit_of_measurement: '$'