zeronounours / HA-custom-component-energy-meter

Provides extended features on top of utility-meter to track costs for each tariff as well as total costs
MIT License
19 stars 2 forks source link

Will this work hourly tariff #31

Closed esnil closed 10 months ago

esnil commented 1 year ago

The documentation is not clear on this point så my question is, will this component work well with hourly tariff? Documentation and examples only mentions Peak and Off-Peak tariffs.

Best regards!

Eskil

anha7196 commented 1 year ago

My question as well. A meter that would keep track of cost based on consumption and hourly price would be great. Is this it?

Thanks!

zeronounours commented 1 year ago

This sensor works based on the builtin utility meter and the energy stats.

This means that indeed hourly tariff is possible. Just keep in mind that tariff, as defined by utility meter, is just a timeslot to track consumption. It is slightly different from energy price. Energy price, on the other hand, can be fixed through the price attribute, or can be an entity which change whenever you need, through the price_entity.

For instance, you can have a fix energy price all day long, but 2 tariffs (e.g. day & night) to keep track of consumption in different timeslots.

For hourly tariff (as defined by utility meter)

You need to define 1 tariff per hour and have automation which change it automatically:

energy_meter:
  daily_energy:
    source: sensor.energy
    name: Daily Energy
    cycle: daily
    price_entity: sensor.current_energy_price
    tariffs:
      - hour_00
      - hour_01
      - hour_02
#…
      - hour_22
      - hour_23

For hourly price

You need to define an entity which holds your current price (it can be a template sensor, a sensor polling you energy supplier or any other source). Let's call it sensor.current_energy_price.

energy_meter:
  daily_energy:
    source: sensor.energy
    name: Daily Energy
    cycle: daily
    price_entity: sensor.current_energy_price
    tariffs:
#      - any tariff you want

Does that answer your questions ?

esnil commented 1 year ago

Thank you @zeronounours ! I will try this out in a few weeks, looks promising!

Best regards Eskil

zeronounours commented 10 months ago

I'm closing the issue as it seems resolved. If needed I'll open again