#Tracking electricity cost that includes flat monthly rate

1 messages · Page 1 of 1 (latest)

random remnant
#

I've been trying to to track my energy costs better.

My rate is a flat connection fee + usage.

I have a sensor set up that is calculating my monthly electricity costs (resetting when my billing cycle resets), however I'm unsure how to use that in the energy dashboard.

In the dashboard under consumption I selected Use an entity tracking the total costs but it doesn't look like it's working correctly. Is that the correct way to track this, or should I do it a different way?

winter whale
#

Seems like that should be a possibility.

#

You might need to give some more details about how it's not working.

random remnant
#

So my sensor has a cost for the month. Then this is the energy dashboard costs for that same time period. If anything I would expect there to be a consumption cost that would then subtract the production costs (which is just a flat rate) to get the grid total cost for the time period.

#

I did make changes to that sensor recently, so maybe it hasn't properly propagated yet?

winter whale
#

Production and consumption costs (returns) are separate

random remnant
#

Correct. In my configuration I have the return to grid set up to use a static rate. Which I believe is working correctly as seen in the image. I'm just saying I would expect the consumption number to be a positive value, and then the difference between them to be the grid total (which I cut off in the image but is just showing as -51.26)

winter whale
#

Ok so you are saying that $0 should be something non-zero.

#

Can you show more details about this sensor you have created?

random remnant
#

Yup. I have these two sensors

    - name: "Energy over 50 kWh"
      unit_of_measurement: "kWh"
      unique_id: energy_over_50_kwh
      state: >
        {% set total_consumption = states('sensor.energy_monthly_total') | float * 1000 %}
        {% if total_consumption > 50 %}
          {{ (total_consumption - 50) | round(2) }}
        {% else %}
          0
        {% endif %}
      availability: "{{ states('sensor.energy_monthly_total') not in ['unknown', 'unavailable'] }}"
    - name: "Monthly Electricity Cost"
      unique_id: monthly_electricity_cost
      unit_of_measurement: "$"
      device_class: monetary
      state_class: total_increasing
      state: >
        {% set flat_rate = 29.19 %}
        {% set per_kwh_rate = 0.134221 %}
        {% set over_50_kwh = states('sensor.energy_over_50_kwh') | float(0) %}
        {{ (flat_rate + (over_50_kwh * per_kwh_rate)) | round(2) }}

which are referencing this utility meter

energy_monthly_total:
  source: sensor.envoy_lifetime_net_energy_consumption
  unique_id: energy_monthly_total
  name: "Energy Monthly Total"
  cycle: monthly
  offset:
    days: 12

And for reference, here are these entities

winter whale
#

Can you plot on a statistics graph card this "Monthly Electricity Cost" sensor, is it correct?

#

Specifically plot the Sum statistic.

random remnant
#

Umm, I'm not sure how to get it to show nicely. The days to show value doesn't seem to do anything

winter whale
#

How about 1 day to show, period = hour

#

line chart

#

that will show the data that it has for today.

#

which should be what your energy panel is pulling to get the cost

random remnant
#

Hmm, that doesn't seem promising

winter whale
#

What does a 24-hour History panel plot of this entity look like?

random remnant
winter whale
#

No I mean go to History panel in the sidebar

#

Is this a new entity that you just created?

#

Or has it been around a while.

random remnant
#

Ah. I created it maybe a week or two ago, but just fixed it today to properly convert units so it was actually increasing vs just sitting at the flat connection rate value

winter whale
#

Ok well lets wait a day and see if things improve then

#

looks like it just started doing something interesting