Closed Mariusthvdb closed 9 months ago
The error message is about "Plafond spots"
Could not resolve any entities in group 'Plafond spots'
This means no include
configuration could be resolved correctly resulting in any sensors to be included in the group.
The include option only works for entities which are part of the entity registry, a prerequisite for that is the entities to be create with a GUI flow or the entities to have a unique_id.
But the configuration you shared is about Terrace outdoors
?
Also entities is not really formatted right, is this also part of the configuration? Or you just mentioning these as possible entities for the issue report?
sorry, missed a few ticks there. and arghh been copying to much today:
this is Plafond spots:
- create_group: Plafond spots
unique_id: powercalc_group_plafond_spots
# https://github.com/bramstroker/homeassistant-powercalc/blob/master/docs/source/sensor-types/group/include-entities.rst#wildcard
# include:
# wildcard: light.hue_ambiance_spot_*
entities:
- entity_id: light.hue_ambiance_spot_1
- entity_id: light.hue_ambiance_spot_2
- entity_id: light.hue_ambiance_spot_3
- entity_id: light.hue_ambiance_spot_4
- entity_id: light.hue_ambiance_spot_5
- entity_id: light.hue_ambiance_spot_6
- entity_id: light.hue_ambiance_spot_7
- entity_id: light.hue_ambiance_spot_8
- entity_id: light.hue_ambiance_spot_9
- entity_id: light.hue_ambiance_spot_10
- entity_id: light.hue_ambiance_spot_11
- entity_id: light.hue_ambiance_spot_12
- entity_id: light.hue_ambiance_spot_13
- entity_id: light.hue_ambiance_spot_14
same story: off power mostly, doesnt throw an error in 1.9.9 as configured above.
when 1.9.10 the posted error is thrown and even turning on the power does not bring the unavailable entities back to live.
The include option only works for entities which are part of the entity registry, a prerequisite for that is the entities to be create with a GUI flow or the entities to have a unique_id.
these are all GUI created by the Philips Hue integration and yes, all have a unique_id in the entity_registry
I still see an oddity in 1.9.9: these groups show unknown when HA restarts and lights are turned off (but have physical power). They should show the summed power of its siblings though, even at startup. toggling 'on' to go from 'unknown' and back 'off' works ok, and shows the actual device_power summed.
If thats a different issue, I can open an new
Let's try to focus at one things at a time. This is too much information and clutter to get clear reproduction steps. The problem with initial unknown is definitely a non related / other issue. I think it was reported before by another user, but unsure if this was still an issue.
The error message you posted "Could not resolve entities" is definitely an error message and no debug message. This means powercalc could not find any entities to setup the group. So that's also the reason the group cannot be setup and stays unavailable.
Let's focus on your posted configuration and group.
- create_group: Plafond spots
unique_id: powercalc_group_plafond_spots
....
I see you commented the wildcard part, so I can conclude this is not active anymore?
If I understand correctly you are saying this group does not work with the manual entities listing light.hue_ambiance_spot_1
to light.hue_ambiance_spot_14
in v1.9.10, but when you revert to v1.9.9 it works again?
I went through all the changes in v1.9.10 and only part which was overhauled is related to the include
functionality. The behaviour for the entities
configuration should be the similar as before the changes, and I have several test cases which also work fine.
So I'm highly surprised this is broken for you somehow.
Before investigating further I want to be 100% certain this is the case. You don't have any wildcard or include logic going on anymore for this group or any of it's parent groups and restarted afterwards?
Btw https://github.com/bramstroker/homeassistant-powercalc/issues/1922 This issue report seems very similar to your initial "unknown" problem.
Issue with initial unknown as reported in #1922 should be fixed now. The problem was the power groups were only updated on state changes of underlying sensors, but unavailable sensors / which stay unavailable will never cause a state change, so that's why the power sensor always stayed unknown, until one of the power sensors became available. I calculate the initial group state now once during startup of HA, and after that only on state changes. You can try that out by installing latest master.
This does not solve your other issue where you have problems with setting up the group at all in v1.9.10. See my comment above. This needs more information / debugging.
ok, let me try to install that master from a working 1.9.9 configuration with group entities listed verbosely.
Edit
uhm... it wont go, remains swirling.,
ok thats fine now, I can see my dining table group, which has no physical power currently, showing 0.0 nicely (the fact it's toggleable and even shows a brightness is a light oddity, and has nothing to do with PC):
this is with a regular entities config, not yet with the new wildcard:
- create_group: Dining table
unique_id: powercalc_group_dining_table
# include:
# wildcard: light.dining_table_lamp_*
entities:
- entity_id: light.dining_table_lamp_1
- entity_id: light.dining_table_lamp_2
- entity_id: light.dining_table_lamp_3
fwiw, this group is inside another 'total' group, so nested. Not sure if that has any relevance, just saying.
Next, I'll comment the entities section with the individual lights, and will once more use the include option:
- create_group: Dining table
unique_id: powercalc_group_dining_table
include:
wildcard: light.dining_table_lamp_*
# entities:
# - entity_id: light.dining_table_lamp_1
# - entity_id: light.dining_table_lamp_2
# - entity_id: light.dining_table_lamp_3
and there it goes wrong again:
in a lighter theme to make it better visible:
2023-12-18 22:17:10.833 ERROR (MainThread) [custom_components.powercalc.sensor] 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 'Dining table'
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...
@RoSche2001 I appreciate your efforts to provide good debug information. But currently we are mixing up different issues in this same issue report. This makes it very hard to keep track of things and creates a lot of confusion.
The issue report from @Mariusthvdb was about the include
wildcard option not working correctly. When this option is used it results in the error Could not resolve any entities in group 'Dining table'
. So please only post comments / information related to that.
@RoSche2001 could you please post your reply for the energy calculation misbehaving in a new issue report, and delete the comment here. That would help a lot to keep things organized. Thanks.
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.
let me know if I can help testing, or change config or whatever you need
did a quick test in my local dev instance but it's working fine for me. what does your full configuration looks including the parent group?
here you go, Ive cut down on a lot of entities, but this is the full structure of my config:
##########################################################################################
# package Power calc
# https://github.com/bramstroker/homeassistant-powercalc
# https://github.com/bramstroker/homeassistant-powercalc/blob/master/docs/supported_models.md
##########################################################################################
powercalc:
disable_extended_attributes: true
enable_autodiscovery: false
energy_sensor_naming: '{} device energy'
power_sensor_naming: '{} device power'
ignore_unavailable_state: true
energy_sensor_precision: 2
unavailable_power: 0
create_utility_meters: true
utility_meter_types:
- daily
- yearly
sensors:
##########################################################################################
# Daily energy, so the consumption of the devices connected to the plugs
# creates: daily energy sensors for all individuals sensor.[source object_id]_daily
# and the following grouped sensors:
# sensor.alle_schakelaars_samen_totaal_daily, summed daily energy sensor for all entities
# sensor.alle_schakelaars_samen_actueel, summed power for all entities W (source: '_actueel')
# sensor.alle_schakelaars_samen_totaal, summed energy for all entities kWh (source: '_totaal)
##########################################################################################
- energy_sensor_id: sensor.patchboard_zolder_totaal
power_sensor_id: sensor.patchboard_zolder_actueel
- energy_sensor_id: sensor.inductieplaat_totaal
power_sensor_id: sensor.inductieplaat_actueel
- create_group: Alle schakelaars samen
unique_id: powercalc_group_alle_schakelaars_samen
energy_sensor_naming: '{} totaal'
power_sensor_naming: '{} actueel'
utility_meter_types:
- daily
entities:
##########################################################################################
# Power consumption sensors
##########################################################################################
# Shelly
- energy_sensor_id: sensor.toaster_keuken_totaal
power_sensor_id: sensor.toaster_keuken_actueel
- energy_sensor_id: sensor.plus_plug_s_totaal
power_sensor_id: sensor.plus_plug_s_actueel
- energy_sensor_id: sensor.tester_totaal
power_sensor_id: sensor.tester_actueel
# Qubin0
- energy_sensor_id: sensor.netwerk_library_totaal
power_sensor_id: sensor.netwerk_library_actueel
#etcec
##########################################################################################
# Device energy/power sensors, so the device consumption of the plugs themselves
##########################################################################################
- create_group: Switches total
unique_id: powercalc_group_switches_total
entities:
# - entity_id: switch.attic_living
- entity_id: switch.freezer_bijkeuken
- entity_id: switch.freezer_garage
- entity_id: switch.front_room
- entity_id: switch.vaatwasser_keuken
# etc
# Shelly:
- entity_id: switch.toaster_keuken
<<: &shelly
standby_power: 0.5
fixed:
power: 0.8
- entity_id: switch.plus_plug_s
<<: *shelly
- entity_id: switch.tester
- entity_id: switch.slaapkamer_stopcontact
<<: *shelly
- create_group: Alle lampen
unique_id: powercalc_group_alle_lampen
entities:
- create_group: Light inside total
unique_id: powercalc_group_lights_inside_total
entities:
# via DIRIGERA Homekit
- entity_id: light.bol_lamp
# via ZHA Skyconnect
- create_group: Kerst sterren
unique_id: powercalc_group_kerst_sterren
entities:
- entity_id: light.ster_links
- entity_id: light.ster_rechts
- create_group: Plafond spots
unique_id: powercalc_group_plafond_spots
# https://github.com/bramstroker/homeassistant-powercalc/blob/master/docs/source/sensor-types/group/include-entities.rst#wildcard
# include:
# wildcard: light.hue_ambiance_spot_*
entities:
- entity_id: light.hue_ambiance_spot_1
- entity_id: light.hue_ambiance_spot_2
- entity_id: light.hue_ambiance_spot_3
- entity_id: light.hue_ambiance_spot_4
- entity_id: light.hue_ambiance_spot_5
- entity_id: light.hue_ambiance_spot_6
- entity_id: light.hue_ambiance_spot_7
- entity_id: light.hue_ambiance_spot_8
- entity_id: light.hue_ambiance_spot_9
- entity_id: light.hue_ambiance_spot_10
- entity_id: light.hue_ambiance_spot_11
- entity_id: light.hue_ambiance_spot_12
- entity_id: light.hue_ambiance_spot_13
- entity_id: light.hue_ambiance_spot_14
- create_group: Dining table
unique_id: powercalc_group_dining_table
# include:
# wildcard: light.dining_table_lamp_*
entities:
- entity_id: light.dining_table_lamp_1
- entity_id: light.dining_table_lamp_2
- entity_id: light.dining_table_lamp_3
# Ikea Tradfri
- entity_id: light.corridor_pool
- entity_id: light.boekenkas
standby_power: 0.18
linear:
attribute: brightness
calibrate:
- 1 -> 0.3
- 3 -> 0.7
- 13 -> 0.8
- 26 -> 0.9
- 38 -> 1.0
- 51 -> 1.1
- 64 -> 1.3
- 76 -> 1.4
- 89 -> 1.6
- 102 -> 1.8
- 115 -> 2.3
- 128 -> 2.5
- 140 -> 2.9
- 153 -> 3.3
- 166 -> 3.8
- 178 -> 4.1
- 191 -> 5.1
- 204 -> 5.9
- 217 -> 6.4
- 230 -> 8.1
- 242 -> 9.4
- 255 -> 10.8
- entity_id: light.bureau_left
- entity_id: light.bureau_right
- entity_id: light.pantry
- entity_id: light.gym
# Philips Hue
# Philips Hue smart plug
- entity_id: light.attic_living
- entity_id: light.hue_go
- entity_id: light.corridor_cabinet
- entity_id: light.dorm_ceiling_panel
- create_group: Light outside total
unique_id: powercalc_group_lights_outside_total
entities:
- 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
# Ikea Tradfri
- entity_id: light.parking_light
# Philips Hue
- entity_id: light.backdoor_outdoors
- entity_id: light.pond_alley
- entity_id: light.garden_terrace_floodlight
- entity_id: light.garden_backyard_floodlight
- entity_id: light.driveway_floodlight
- entity_id: light.porch_floodlight
- entity_id: light.gate_outdoors
- entity_id: light.pond_tools
- create_group: Non Switches total
unique_id: powercalc_group_non_switches_total
entities:
- entity_id: device_tracker.smartgateways_watermeter
fixed:
power: 4.9
# - entity_id: device_tracker.airport_express_water
# fixed:
# power: 4.1
- entity_id: device_tracker.awair_element
fixed:
states_power:
home: 1.1
not_home: 0
- entity_id: sensor.vindstyrka_temperature
fixed:
power: 0.9
- entity_id: media_player.googlehome_hub
standby_power: 2.3
fixed:
states_power:
playing: 4.1
paused: 3.3
idle: 2.8
- entity_id: media_player.googlehome_hall
- entity_id: media_player.homepod_keuken
- entity_id: fan.luchtreiniger_hall
<<: &ikea_fan
standby_power: 0.5
linear:
attribute: percentage
calibrate:
- 10 -> 1.5
- 18 -> 1.6
- 20 -> 1.7
- 30 -> 2.1
- 40 -> 3.3
- 50 -> 5.2
- 60 -> 8.5
- 70 -> 11.4
- 80 -> 16.3
- 90 -> 18.8
- 100 -> 21.9
- entity_id: fan.luchtreiniger_woonkamer
<<: *ikea_fan
- unique_id: powercalc_daily_fixed_bel_trafo
daily_fixed_energy:
value: 4.9
unit_of_measurement: W
- create_group: Heaters total
##########################################################################################
# creates only group entities:
# sensor.heaters_total_energy
# sensor.heaters_total_energy_daily
# sensor.heaters_total_energy_yearly
# sensor.heaters_total_power
##########################################################################################
unique_id: powercalc_group_heaters_total
energy_sensor_naming: '{} energy'
power_sensor_naming: '{} power'
entities:
- create_group: Heaters devices
##########################################################################################
# creates
# group entities:
# sensor.heaters_devices_device_energy
# sensor.heaters_devices_device_energy_daily
# sensor.heaters_devices_device_energy_yearly
# sensor.heaters_devices_device_power
# individual entities:
# sensor.[object_id]_device_power
# sensor.[object_id]_device_energy
# sensor.[object_id]_device_energy_daily
##########################################################################################
unique_id: powercalc_group_heaters_devices
entities:
- entity_id: device_tracker.heater_dorm
<<: &mill_heater
fixed:
states_power:
home: 1.7
not_home: 0
- entity_id: device_tracker.heater_library
<<: *mill_heater
- entity_id: device_tracker.heater_office
<<: *mill_heater
- create_group: Heaters consumption
##########################################################################################
# creates:
# sensor.heaters_consumption_energy
# sensor.heaters_consumption_energy_daily
# sensor.heaters_consumption_energy_yearly
# sensor.heaters_consumption_power
# required a lot of manual editing of the 'Dummy' object_ids and not use the default
# _device_energy naming....
# sensor.[object_id]_current_energy
# sensor.[object_id]_current_energy_daily
# sensor.[object_id]_current_energy_yearly
##########################################################################################
unique_id: powercalc_group_heaters_consumption
energy_sensor_naming: '{} energy'
power_sensor_naming: '{} power'
entities:
- power_sensor_id: sensor.heater_library_current_power
- power_sensor_id: sensor.heater_office_current_power
- power_sensor_id: sensor.heater_dorm_current_power
restarted again with debug on:
2023-12-21 11:17:07.875 DEBUG (MainThread) [custom_components.powercalc.group_include.include] Found possible include entities: ['light.dining_table_lamp_2', 'light.dining_table_lamp_3', 'light.dining_table_lamp_1']
2023-12-21 11:17:07.875 ERROR (MainThread) [custom_components.powercalc.sensor] 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 'Dining table'
note this Is with power cut off from those bulbs, which the regular group config with the listed entities does Not bother.
restarting with the lights on power yields the same but not the same....:
2023-12-21 11:20:44.331 DEBUG (MainThread) [custom_components.powercalc.group_include.include] Found possible include entities: ['light.dining_table_lamp_2', 'light.dining_table_lamp_3', 'light.dining_table_lamp_1']
2023-12-21 11:20:44.331 ERROR (MainThread) [custom_components.powercalc.sensor] Group state might be misbehaving because there was an error with an entity
File "/config/custom_components/powercalc/sensor.py", line 631, in create_sensors
File "/config/custom_components/powercalc/sensor.py", line 680, in create_sensors
custom_components.powercalc.errors.SensorConfigurationError: Could not resolve any entities in group 'Dining table'
separate log for the entities listed group:
2023-12-21 11:26:47.048 DEBUG (MainThread) [custom_components.powercalc.discovery] light.dining_table_lamp_1: Auto discovered model (manufacturer=Signify Netherlands B.V., model=Hue ambiance lamp (LTW010))
2023-12-21 11:26:47.048 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.dining_table_lamp_1 entity_category=None, sensor_name=Dining table lamp 1 device power strategy=lut manufacturer=signify model=LTW010 unique_id=1492a44a-207f-4732-88f2-089303564d29)
2023-12-21 11:26:47.048 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] Loading LUT data file: /config/custom_components/powercalc/power_profile/../data/signify/LTW010/color_temp.csv.gz
2023-12-21 11:26:47.054 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] LUT file loaded: 1785 lines
2023-12-21 11:26:47.054 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Dining table lamp 1 device energy
2023-12-21 11:26:47.054 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Dining table lamp 1 device energy daily (entity_id=sensor.dining_table_lamp_1_device_energy_daily)
2023-12-21 11:26:47.054 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Dining table lamp 1 device energy yearly (entity_id=sensor.dining_table_lamp_1_device_energy_yearly)
2023-12-21 11:26:47.055 DEBUG (MainThread) [custom_components.powercalc.discovery] light.dining_table_lamp_2: Auto discovered model (manufacturer=Signify Netherlands B.V., model=Hue ambiance lamp (LTW010))
2023-12-21 11:26:47.055 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.dining_table_lamp_2 entity_category=None, sensor_name=Dining table lamp 2 device power strategy=lut manufacturer=signify model=LTW010 unique_id=38b13e99-1b93-4f76-be40-edcdf7cd647d)
2023-12-21 11:26:47.055 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Dining table lamp 2 device energy
2023-12-21 11:26:47.055 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Dining table lamp 2 device energy daily (entity_id=sensor.dining_table_lamp_2_device_energy_daily)
2023-12-21 11:26:47.055 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Dining table lamp 2 device energy yearly (entity_id=sensor.dining_table_lamp_2_device_energy_yearly)
2023-12-21 11:26:47.055 DEBUG (MainThread) [custom_components.powercalc.discovery] light.dining_table_lamp_3: Auto discovered model (manufacturer=Signify Netherlands B.V., model=Hue ambiance lamp (LTW010))
2023-12-21 11:26:47.055 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.dining_table_lamp_3 entity_category=None, sensor_name=Dining table lamp 3 device power strategy=lut manufacturer=signify model=LTW010 unique_id=ae2465cc-7a42-4dd0-8ad5-6ae75437506c)
2023-12-21 11:26:47.055 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Dining table lamp 3 device energy
2023-12-21 11:26:47.055 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Dining table lamp 3 device energy daily (entity_id=sensor.dining_table_lamp_3_device_energy_daily)
2023-12-21 11:26:47.056 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Dining table lamp 3 device energy yearly (entity_id=sensor.dining_table_lamp_3_device_energy_yearly)
2023-12-21 11:26:47.056 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped power sensor: Dining table device power (entity_id=sensor.dining_table_device_power)
2023-12-21 11:26:47.056 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped energy sensor: Dining table device energy (entity_id=sensor.dining_table_device_energy)
2023-12-21 11:26:47.056 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Dining table device energy daily (entity_id=sensor.dining_table_device_energy_daily)
2023-12-21 11:26:47.057 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Dining table device energy yearly (entity_id=sensor.dining_table_device_energy_yearly)
I would suggest to create a separate wildcard group first without any nesting. To keep it as simple as possible and see if that one works correctly.
powercalc:
sensors:
- create_group: Plafond spots test
unique_id: powercalc_group_plafond_spots_test
include:
wildcard: light.hue_ambiance_spot_*
a that sound like an idea.
Can I create a second group of the same entities I already have in the nest? (afraid I otherwise will overwrite that or other issues might arise?
apparently I can.. ;-)
2023-12-21 11:58:38.424 DEBUG (MainThread) [custom_components.powercalc.group_include.include] Found possible include entities: ['light.dining_table_lamp_2', 'light.dining_table_lamp_3', 'light.dining_table_lamp_1']
2023-12-21 11:58:38.424 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped power sensor: Eettafel voor de test device power (entity_id=sensor.eettafel_voor_de_test_device_power)
2023-12-21 11:58:38.424 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped energy sensor: Eettafel voor de test device energy (entity_id=sensor.eettafel_voor_de_test_device_energy)
2023-12-21 11:58:38.425 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Eettafel voor de test device energy daily (entity_id=sensor.eettafel_voor_de_test_device_energy_daily)
2023-12-21 11:58:38.425 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Eettafel voor de test device energy yearly (entity_id=sensor.eettafel_voor_de_test_device_energy_yearly)
with
sensors:
- create_group: Eettafel voor de test
unique_id: powercalc_group_eettafel_voor_de_test
include:
wildcard: light.dining_table_lamp_*
and power to the lights.
No, that's no problem. You can put same entity in multiple groups. It won't have impact on your existing groups.
yeah, I noticed. I'll wait 15 minutes to see if the unknowns get a value, and the unavailable will too because of that.
if that happens, Ill again restart, but then with power cut to those lights
anyways, there is progress! now got to find out why this works and the nest doesnt
Ah I see your edit now. So that concludes that everything is working fine when it's a seperate group, but when you use the wildcard inside some nested groups it won't work.
I will see if I can reproduce this behaviour and fix it. Will come back in a few days.
yeah, I noticed. I'll wait 15 minutes to see if the unknowns get a value, and the unavailable will too because of that.
if that happens, Ill again restart, but then with power cut to those lights
That's fixed now in latest version, that the initial state directly gets 0, instead of after 15 minutes.
But that's unrelated to group being setup succesfull or not.
but I am on the latest version? 1.9.11
nothing happening. do I need to record those entities ( I am never sure)?
no that doesnt help. the only entity turning 0 on startup is the power sensor, and that never was the issue:
äter startup the power is again calculated correctly but the other 3 remain as they are
o, and it did cause trouble, because the PC entities for the individual lights got mixed up now, being created 2ce, and, because of that, the existing nested groups.... so dont be to easy in using entities in multiple group configs is what we learn here too.
made some changes for the include functionality. See #1959
Currently the include
option was only working when you have either setup powercalc entities for the light via the GUI, or defined the entity_id in YAML.
I have made some changes to also directly setup powercalc entities for supported devices directly from the include option.
Are you able to test this by installing master branch? Thanks!
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.
made some changes for the include functionality. See #1959
Currently the
include
option was only working when you have either setup powercalc entities for the light via the GUI, or defined the entity_id in YAML. I have made some changes to also directly setup powercalc entities for supported devices directly from the include option.Are you able to test this by installing master branch? Thanks!
dl as we speak, Ill report back, thanks for looking into this!
update
seems to be fixed!
no more errors in the log, and the entities for power are nicely created and immediate on startup great development, thanks Bram
the above was tested on lights actually on life power.
restarted with a new include wildcard group for lights cut from power now....
and also perfect:
no errors in log powering the lights immediately show the grouped power
there is a remarkable difference between these two groups though, check this for the groups when lights aer cut from power:
Eettafel shows as available and switchable light, even shows on/off, and the only way we can see there is no actual power usages is by means of the PC reading of 0.00
and now check the other group consisting of four (also) Hue spots:
it has nothing to do with PC. the terrace group is a HA helper light group, while the Eettafel is a Hue group made in the Hue app (and thus also in the integration)
anyways, all besides the point...
your integration is now correctly creating nested group entities with the new include/wildcard option!
@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.
lets close this now? great present for the holidays!
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
Describe the issue
unexpected error logging
Reproduction steps
...
Debug logs
Diagnostics dump or YAML config