Creating dummy/virtual power meters

Hello,

what would be your ideas to create dummy/virtual power meters? I don’t have installed power meters for my lights, but I’m pretty sure that they consume i.e. 10W if they are on.

How would be your thoughts to collect their consumption?

Thanks, Thomas

It is important to select the correct method of integration though. See this post: Power consumed per day

Oh! That means my setup is wrong with just:

    power_consumption_total:
        entity_id: sensor.time
        unit_of_measurement: W
        value_template: >
          {% set ns = namespace(states=[]) %}
          {% for s in states.sensor %}
            {% if s.object_id.endswith('_power_consumption') %}
              {% set ns.states = ns.states + [ s.state | float ] %}
            {% endif %}
          {% endfor %}
          {{ ns.states | sum | round(2) }}
utility_meter:
  power_consumption_hourly:
    source: sensor.power_consumption_total
    cycle: hourly
  power_consumption_daily:
    source: sensor.power_consumption_total
    cycle: daily
  power_consumption_monthly:
    source: sensor.power_consumption_total
    cycle: monthly
  power_consumption_yearly:
    source: sensor.power_consumption_total
    cycle: yearly

I need to pass the wattmeter into an into an https://www.home-assistant.io/integrations/integration and then pass it to utilitymeter right?

Correct.

1 Like

Thanks again for your help. Really appreciated!

1 Like

If you use Node Red, that’s how I do it right now:

Only takes one flow, one mqtt sensor and the utility meter (and two input numbers, if you want to quickly change Wattages)

1 Like