question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: This entity has already configured a power sensor

See original GitHub issue

After updating to 2022.8.0b0 today, I am getting an error in the log about already-configured power sensors for several entities:

This error originated from a custom integration.

Logger: custom_components.powercalc.sensor
Source: custom_components/powercalc/sensor.py:244
Integration: Powercalc (documentation, issues)
First occurred: 1:18:17 PM (9 occurrences)
Last logged: 1:18:17 PM


light.arc_lamp: This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id
light.ben_s_lamp: This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id
light.vanessa_s_lamp: This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id
Could not resolve any entities in group 'Bedroom Lamps'
light.downstairs_lamp_left: This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id
light.downstairs_lamp_right: This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id
Could not resolve any entities in group 'Downstairs Lamps'
light.office_desk_lamp: This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id
light.nursery_lamp: This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id

For what it’s worth, I recently changed my YAML configuration to remove manufacturer/model overrides for some, but not all, of these entities, all of which are Hue (Signify) bulbs. When I originally added them, there were no LUT files for those specific models, so I overrode the model number to force Powercalc to use LUT files for similar bulbs. I recently noticed that model-specific LUT files have been added, so I commented out those overrides assuming that Powercalc would simply use the other LUT files going forward. I did not notice an error message until I updated to 2022.8.0b0, but I suppose it’s possible that commenting out the manufacturer/model overrides has something to do with the error, and I simply did not notice until now.

The power and energy sensors appear to still be working correctly, but I would appreciate any suggestions for tweaking my configuration – either YAML or in .storage – to clear this error message.

The relevant YAML sensor configuration is pasted below for reference.

sensor:

  - platform: powercalc
    entity_id: light.arc_lamp
    # manufacturer: signify
    # model: LCT015 #  (LUT file added)

  - platform: powercalc
    create_group: Bedroom Lamps
    entities:
      - entity_id: light.ben_s_lamp
        # manufacturer: signify
        # model: LWB010 #  (LUT file added)
      - entity_id: light.vanessa_s_lamp
        # manufacturer: signify
        # model: LWB010 #  (LUT file added)

  - platform: powercalc
    create_group: Downstairs Lamps
    entities:
      - entity_id: light.downstairs_lamp_left
        # manufacturer: signify
        # model: LWB010 #  (LUT file added)
      - entity_id: light.downstairs_lamp_right
        # manufacturer: signify
        # model: LWB010 #  (LUT file added)

  - platform: powercalc
    entity_id: light.office_desk_lamp
    manufacturer: signify
    model: LCA006 #  (no LUT file yet)

  - platform: powercalc
    entity_id: light.nursery_lamp
    # manufacturer: signify
    # model: LCT015 #  (LUT file added)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
szatan81commented, Jul 28, 2022

@bramstroker thanks for fixing my config. Looks like i was very lucky with it and going version 24< “broke” something. I have applied your suggested code and now the error is gone. Thanks again!

0reactions
bramstrokercommented, Jul 28, 2022

@szatan81 You must configure like below. Each unique entity_id needs to be defined only once in the configuration. You can use nested groups to add the entity both to the “all lights” group and the specific light groups. Defining one first and later adding to a group was never documented and not supported, as it will cause various issues when because also order of loading can cause issues etc… It was a coindicence this was working before for you.

sensor:
  - platform: powercalc
    create_group: Żarowki
    entities:
      - create_group: Światła Korytarz
        entities:
          - entity_id: light.gu10_korytarz_1
          - entity_id: light.gu10_korytarz_2
      - create_group: Światła Jadalnia
        entities:
          - entity_id: light.gu10_jadalnia_1
            manufacturer: ikea
            model: LED1537R6
          - entity_id: light.gu10_jadalnia_2
            manufacturer: ikea
            model: LED1537R6
          - entity_id: light.gu10_jadalnia_3
            manufacturer: ikea
            model: LED1537R6
        - create_group: Światła Kuchnia Góra
          entities:
            - entity_id: light.e27_kuchnia_1
            - entity_id: light.e27_kuchnia_1
            - entity_id: light.e27_kuchnia_1
        - create_group: Światła Sypialnia
          entities:
            - entity_id: light.e27_sypialnia_sylwia
            - entity_id: light.e27_sypialnia_wojtek
        - create_group: Światła Salon
          entities:
            - entity_id: light.e27_komoda
            - entity_id: light.lampa_salon
                linear:
                  min_power: 1
                  max_power: 8
            - entity_id: light.e27_tv_1
              linear:
                min_power: 1
                max_power: 5.2
        - entity_id: light.e27_dzieci_1
Read more comments on GitHub >

github_iconTop Results From Across the Web

Powercalc - Virtual power sensors - Custom Integrations
Powercalc will create a seperate power sensor (entity) for your light named sensor.ph80_power . You can find this sensor in Configuration → ...
Read more >
PowerCalc: Home Assistant Virtual Power Sensors - GitHub
PowerCalc is a custom component for Home Assistant to estimate the power consumption (as virtual meters) of lights, fans, smart speakers and other...
Read more >
Cisco 7K Port Power Errors NXOS 7.2(2)D1(2) - Forum
It appears that NX-OS does not support CISCO-ENVMON-MIB, so I think you would lose all hardware sensing supported by CISCO-ENTITY-SENSOR-MIB. So I've disabled ......
Read more >
Energy monitoring in Home Assistant - with or without power ...
With the setup complete, we can now create a dashboard to view the data from the sensors we've created. For my dashboard, I...
Read more >
Untitled
Real Time Device Power Meter for Home Assistant | Sean Blanchfield. register_component ... The sensor entity model has been updated with two new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found