Tariff unit price

I’ve configured a utility_meter block to monitor the energy usage from an Aeotec Home Energy Monitor that I’ve got connected to our main electric meter.

However I’m struggling to work out how to add a unit price to calculate cost per day etc.

My utility_meter package looks like:

###############
# Utility meter
################
utility_meter:
  daily_energy:
    source: sensor.nodeid_3_power
    cycle: daily
    tariffs:
      - standard
  monthly_energy:
    source: sensor.nodeid_3_power
    cycle: monthly
    tariffs:
      - standard

homeassistant:
  customize:
    sensor.nodeid_3_power:
      friendly_name: "Accumulated kWh"
    sensor.nodeid_3_generic:
      friendly_name: "Real-time current (A)"
    sensor.nodeid_3_power_8:
      friendly_name: "Real-time power (W)"
    sensor.nodeid_3_gas_density:
      friendly_name: "Real-time voltage (V)"

I’m using zwave2mqtt and can see the kWh values being updated.

Any ideas?

Cheers

I’ve also use the utility meter with the aeotec energy meter

#####UTILITY-METER##################################################################################################

utility_meter:
  daily_energy:
    source: sensor.aeon_labs_zw095_home_energy_meter_gen5_energy
    cycle: daily
    tariffs:
      - peak
      - offpeak
  weekly_energy:
    source: sensor.aeon_labs_zw095_home_energy_meter_gen5_energy
    cycle: weekly
    tariffs:
      - peak
      - offpeak
  monthly_energy:
    source: sensor.aeon_labs_zw095_home_energy_meter_gen5_energy
    cycle: monthly
    tariffs:
      - peak
      - offpeak
  yearly_energy:
    source: sensor.aeon_labs_zw095_home_energy_meter_gen5_energy
    cycle: yearly
    tariffs:
      - peak
      - offpeak
  hourly_energy:
    source: sensor.aeon_labs_zw095_home_energy_meter_gen5_energy
    cycle: hourly
    tariffs:
      - peak
      - offpeak

And you need some template sensors like this:

 kosten_vandaag:
       friendly_name: "Kosten vandaag"
       unit_of_measurement: '€'
       value_template: "{{ (states('sensor.daily_energy_peak') | float * 0.31 + states('sensor.daily_energy_offpeak') | float * 0.23) | round(2) }}"
3 Likes

Cool, that seems to work…

image

Cheers for the suggestion…

1 Like

Hello many thanks for this post. I wonder where and how are defined ‘peak’ and ‘offpeak’ tariffs in your exemple. I cannot find any complete example in documentation about this.

Use the sensors from the utility meter and make automations to define ‘peak’ and ‘offpeak’.

#####AUTOMATION#########################################
- alias: Change Utility Tariffs to offpeak on Weekends
  trigger:
  - platform: time
    at: '21:00:00'
  condition:
  - condition: time
    weekday:
    - fri
  action:
  - service: utility_meter.select_tariff
    data:
      entity_id:
      - utility_meter.daily_energy

Hello @freezeke ,

thank you for your quick answer.

I clearly understand the automation you gave which call the service select_tariff at 21:00 on friday.
But how does this service call set the peak or offpeak tarrif ? there is nowhere peak or offpeak defined.

Perhaps is it reserved words ? If not where are they defined ?

May be I’m totally wrong in my understanding :disappointed_relieved:

1 Like

The utility meter enables you to define the various tariffs.

utility_meter:
  daily_energy:
    source: sensor.aeon_labs_zw095_home_energy_meter_gen5_energy
    cycle: daily
    tariffs:
      - peak
      - offpeak

2 different sensors will be created : sensor.daily_energy_peak and sensor.daily_energy_offpeak
Then a time based automation can be used to switch according your energy provider tariffs.

I think you better read this first :smiley:

https://www.home-assistant.io/integrations/utility_meter/

Thank you @freezeke , I already read this but I will re-read this carefully with the examples you gave.

I have posted my configuration which is still not working here: Energy integration with 3 phases electrical installation

If you have time maybe you can have a look and see if something seems wrong.

I have no experience with iammeter, after a quick google search about iammeter you need the configure the importenergy sensor like this :

 Specifying the customize_glob to be exactly per sensors makes it work: e.g. sensor.iammeter3_importenergy_c

More info here:

https://imeter.club/topic/77

Hope this helps you

Ho, thank you so much for this. I will have a look.

@jmcollin @freezeke

I dont see where it says WHAT tarrif to select.
you told the last guy to read Utility Meter - Home Assistant
ive been reading it for the past couple hours.

where is the tarrif string that is required for SERVICE: UTILITY_METER.SELECT_TARIFF in your posted example ?? i think you cut it off or something is not explained. there is a reason me and the last guy have the same question…

Apparently pasting and copying on a smartphone is not a good idea to reply on a forum…
last line was not copied from my config
I’m sorry, my mistake
Anyway this is the full automation

#####AUTOMATION#########################################
- alias: Change Utility Tariffs to offpeak on Weekends
  trigger:
  - platform: time
    at: '21:00:00'
  condition:
  - condition: time
    weekday:
    - fri
  action:
  - service: utility_meter.select_tariff
    data:
      entity_id:
      - utility_meter.daily_energy
      tariff: offpeak

#####AUTOMATION#########################################
- alias: Change Utility Tariffs to peak on Weekdays
  trigger:
  - platform: time
    at: '06:00:00'
  condition:
  - condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  action:
  - service: utility_meter.select_tariff
    data:
      entity_id:
      - utility_meter.daily_energy
      tariff: peak

#####AUTOMATION#########################################
- alias: Change Utility Tariffs to offpeak on Weekdays
  trigger:
  - platform: time
    at: '21:00:00'
  condition:
  - condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
  action:
  - service: utility_meter.select_tariff
    data:
      entity_id:
      - utility_meter.daily_energy
      tariff: offpeak
1 Like