Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 96121

Calculating Cost using a Utility Meter Sensor

$
0
0

@MarkR wrote:

Hello

I finally managed to get my Utility sensors working as they should, but what is the best way to get the cost of the persistent data sorted from a utility sensor please?

sensor

  - platform: integration
    source: sensor.tv_power
    name: tv energy
    unit_prefix: k
    round: 2

utility meter

utility_meter:
  tv_monthly:
    source: sensor.tv_energy
    cycle: monthly
  tv_daily:
    source: sensor.tv_energy
    cycle: daily
  tv_hourly:
    source: sensor.tv_energy
    cycle: hourly   

I thought it would be like this but it appears to just add it up and not sure how I should be going about it? as when I reboot HA the sensor shows 0 (see the graph drop)
image

    
  - platform: template
    sensors:
      tv_cost_hourly:
        friendly_name: TV Cost Hourly
        unit_of_measurement: '£'
        value_template: "{{ (states('sensor.tv_hourly') | float * 0.16653) | round(4) }}"
  - platform: template
    sensors:
      tv_cost_daily:
        friendly_name: TV Cost Daily
        unit_of_measurement: '£'
        value_template: "{{ (states('sensor.tv_daily') | float * 0.16653) | round(4) }}"   

I have a simple standard tariff, so any ideas please?

Cheers
Mark

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>