homeassistant-powercalc: global energie sensor setting not working for groups

System Health details

image

Checklist

  • I have read the FAQ to see if there is a known solution to my problem.
  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues

Describe the issue

Thanks for this great integration, I was considering templates, but found this solution on time 😄

I globally disabled the creation of energie sensors as I don’t want to track that per light. Than I created a group (manually in yaml) with some lights in it. For the included lights, correctly only the power sensors are created, but for the group also an energy sensor gets created. Initially I was very happy about that as I indeed want to track energy per group. But that group energy sensor doesn’t work (remains unknown).

Based on the global setting I believe it should not be created automatically

I think it’s an other issue that when created (ie deliberate enable it for the group) it should work, even without the energie sensors enabled for its groupmembers. As the total group power is known, energy can be calculated without having energy sensors per light in the group.

Best Eric

Reproduction steps

  1. See yaml below

Debug logs

this is logged after each restart (3 times as I created more groups)


This error originated from a custom integration.

Logger: custom_components.powercalc.sensors.group
Source: custom_components/powercalc/sensors/group.py:513
integration: Powercalc (documentation, issues)
First occurred: 18:13:09 (3 occurrences)
Last logged: 18:13:09

sensor.woonkamer_lights_energy: Could not restore last state: [<class 'decimal.ConversionSyntax'>]

Diagnostics dump or YAML config

enable_autodiscovery: false
create_energy_sensors: false
create_utility_meters: false

sensors:
  - create_group: woonkamer lights
    entities:
      - entity_id: light.tv_lamp
      - entity_id: light.leeslamp
      - entity_id: light.bureau_koof
      - entity_id: light.zithoek
      - entity_id: light.olie_lamp
      - entity_id: light.bureau
      - entity_id: light.kast

About this issue

  • Original URL
  • State: closed
  • Created 3 months ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

Correctly disabling creation of group energy sensor is fixed with #2148. Will be in next release.