homeassistant-powercalc: Group state might be misbehaving because

System Health details

upon updating to 1.9.10 I changed several groups from listing entities (lights in this case) to the new wildcard, documented in https://github.com/bramstroker/homeassistant-powercalc/blob/master/docs/source/sensor-types/group/include-entities.rst#wildcard

config see below.

these lights are mostly powered off physically, and with the listed entities that never caused a logging. With the new wildcard, it seems to bother Powercalc 😉: Group state might be misbehaving because

I can understand PC notices it cant see the lights currently, but maybe this is a debug message, and not as much a error level message.

It is by design of the user

Moreover: when actually powered the grouped sensor does not change from unavailable to a state.

I fear I do experience the same as https://github.com/bramstroker/homeassistant-powercalc/issues/1920 because even with my original entities those grouped sensors remain unavailable.

downgrading to 1.9.9 brings back my grouped sensor values correctly

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

unexpected error logging

Reproduction steps

  1. See description

…

Debug logs

Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.powercalc.sensor
Source: custom_components/powercalc/sensor.py:631
Integration: Powercalc (documentation, issues)
First occurred: 14:40:18 (3 occurrences)
Last logged: 14:40:18

Group state might be misbehaving because there was an error with an entity
Traceback (most recent call last):
  File "/config/custom_components/powercalc/sensor.py", line 631, in create_sensors
    child_entities = await create_sensors(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/powercalc/sensor.py", line 680, in create_sensors
    raise SensorConfigurationError(exception_message)
custom_components.powercalc.errors.SensorConfigurationError: Could not resolve any entities in group 'Plafond spots'

Diagnostics dump or YAML config

            - create_group: Terrace outdoors
              unique_id: powercalc_group_terrace_outdoors
              include:
                wildcard: light.terrace_spot_*
#               entities:
#                 - entity_id: light.terrace_spot_1
#                 - entity_id: light.terrace_spot_2
#                 - entity_id: light.terrace_spot_3
#                 - entity_id: light.terrace_spot_4

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 25 (25 by maintainers)

Most upvoted comments

@Mariusthvdb Didn’t get a notification about your edit, so didn’t know you were already able to test. Thanks for testing and great to hear things are solved for you.

1.9.11 only made some changes to the startup state of group power sensors, I did nothing regarding to energy sensors (yet).

Your initial bug report regarding that state being unknown was specifically about the power sensor in W, so I did have a look into that spefically.

Screenshot 2023-12-22 at 20 19 05

are you sure this config is correct? I copied it from the documentation, and was surprised we didnt have to use the entities option too, so please check if I should do that after all? otoh, the config checks fine so I guess that’s not it…

Yes it should work the way you have it. It’s clear now everything is working fine the old way, but stops working when you try to use the wildcard pattern feature. I’ll have a closer look in a few days.