Giter Site home page Giter Site logo

Comments (3)

bramstroker avatar bramstroker commented on September 17, 2024 2

Hi, I solved this in my installation by using the group integration and a template sensor. I am using 20 lights.
Unfortunately you still have to setup 100 lights in the powercalc integration and define them in the group. But you only need to do this one time.

Step1 - Setup powercalc:

sensor:
  - platform: powercalc
    entity_id: light.livingroom
  - platform: powercalc
    entity_id: light.bedroom

Step2 - Create a group of the power sensors created by powercalc

group:
  all_light_power:
    name: All lights power
    entities:
      - sensor.livingroom_power
      - sensor.bedroom_power

Step3 - Define a template sensor summing all the power values

sensor:
  - platform: template
    sensors:
      all_light_power:
        friendly_name: All light power
        unit_of_measurement: W
        icon_template: mdi:transmission-tower
        value_template: >
          {{ expand('group.all_light_power') 
          | rejectattr('state', 'in', ['unavailable', 'unknown'])
          | map(attribute='state') | map('float') | sum | round(2) }}

When you add a new light you only need to add this to the powercalc integration and the group.

from homeassistant-powercalc.

barisahmet avatar barisahmet commented on September 17, 2024

Thank you very much! That was I what looking for.

from homeassistant-powercalc.

Marsman83 avatar Marsman83 commented on September 17, 2024

I have succesfully setup this sensor for all my lights. I included the Energy sensors instead of the Power sensors as I would like to see the total kWh. I can see the total kWh under entities.
However I am unable to add this sensor in de Energy dashboard at Individual Devices.
What do I need to change so I can add it to the Energy dashboard?

from homeassistant-powercalc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.