Attribute color_mode in HA is not set correctly causing powercalc to report a warning

Hi everyone,
currently I’m trying to set up some energy consumption monitoring using Powercalc, but somehow it does not work properly. There are several issues, but I would like to start with a (hopefully) smaller one.

Installing the integration went fine and at least for some of my lights, power and energy sensors were created properly. As an example, for my Lidl E14 light it looks like this:
image

Stand by consumption has been set to 0,31W automatically by the integration and while being switched off, the consumption is displayed just fine:

Once the light is switched on, the current power consumption runs into an unkown issue and becomes unavailable:

Any idea, why this happens? Also the list of attributes seems to be reduced as well. The log is reflecting this somehow, so there is no error shown - it just seems to be normal:

2022-08-12 10:15:17.487 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.lidl_e14_weiss_power, old_state=<state sensor.lidl_e14_weiss_power=unavailable; state_class=measurement, unit_of_measurement=W, device_class=power, friendly_name=Lidl E14 weiß power @ 2022-08-12T10:14:53.883403+02:00>, new_state=<state sensor.lidl_e14_weiss_power=unavailable; state_class=measurement, unit_of_measurement=W, device_class=power, friendly_name=Lidl E14 weiß power @ 2022-08-12T10:15:17.487275+02:00>>

Did I do something wrong?

Thanks a lot.

Could you please create an issue on github, then we can figure out what goes wrong for you.

1 Like

Btw I suggest to enable debug logging (see last section readme), that should probably give some more pointers about why the power sensor is set to unavailable.

Just to keep you in the loop: Yesterday we’ve checked a couple of things in the following thread: Issue

The result seems to be that the attribute color_mode is not correctly set in HA, after the light is turned on. Instead, the color_mode is set to unknown, after the light has been switched on, leading to the situation that the powercalc integration reports a warning.

Either way, after checking the zigbee2mqtt integration, which is used to integrate this light into HA, and going through a couple of log files, suddenly the color_mode was reported correctly. Nothing has been changed regarding the configuration or similar, just out of a sudden the value of the attribute was correct.

Another idea was that there might be a difference concerning manually switching on the light or letting an Automation do this job and maybe if this is not done manually, the attribute is filled differently. But I’ve checked this today and the attribute keeps being set correctly, no matter how the light is switched on.

I’ll keep an eye on this issue and once I’m able to reproduce the issue, I’ll file a bug to prevent that powercalc and maybe other integrations depending on this ‘color_mode’ attribute are running into issues.

1 Like