Sensors unknown when the device is turned on
moritzmaier84 opened this issue · comments
System Health details
I switched from ZHA to Z2M and tried to rebuild the Powercalc sensors.
Some devices: No problem.
Some others: Strange things happen
For example: My e14 Ikea bulbs are working well. e27 bulbs not.
I can see the sensor states if the bulb is turned out. Like Power 0,23W and Energy 1,2kWh (this state is from ZHA times and I like it, that it is still here and does not start from zero).
If I turn the bulb on, both sensors become unavailable. Turn out again: The old states are back there.
Why is that? Help please!
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
I switched from ZHA to Z2M and tried to rebuild the Powercalc sensors.
Some devices: No problem.
Some others: Strange things happen
For example: My e14 Ikea bulbs are working well. e27 bulbs not.
I can see the sensor states if the bulb is turned out. Like Power 0,23W and Energy 1,2kWh (this state is from ZHA times and I like it, that it is still here and does not start from zero).
If I turn the bulb on, both sensors become unavailable. Turn out again: The old states are back there.
Why is that? Help please!
Reproduction steps
...
Debug logs
nothing :(
Diagnostics dump or YAML config
No response
ogger: homeassistant.components.mqtt.light.schema_json
Source: components/mqtt/light/schema_json.py:316
Integration: MQTT (documentation, issues)
First occurred: 03:15:47 (2 occurrences)
Last logged: 03:16:31
Invalid or incomplete color value '{'color_mode': 'xy', 'color_options': None, 'linkquality': 81, 'power_on_behavior': 'previous', 'state': 'ON', 'update': {'installed_version': 268572245, 'latest_version': 268572245, 'state': 'idle'}, 'update_available': None}' received for entity light.statuslicht_eg
Invalid or incomplete color value '{'brightness': 254, 'color_mode': 'xy', 'color_options': None, 'linkquality': 183, 'power_on_behavior': 'previous', 'state': 'ON', 'update': {'installed_version': 268572245, 'latest_version': 268572245, 'state': 'idle'}, 'update_available': None}' received for entity light.statuslicht_og
So the error seem to be caused by upstream component/integration. In this case MQTT
I suggest you create an issue report for that in HA core tracker.
You can maybe find some more details in the logs why powercalc "flips out" on it, might be wisefull to temporarily enable debug logging for powercalc.
That should provide insides about why the powercalc sensor goes to unavailable. But this is probably causes by some erronous color returned by the mqtt light.
Hi. Same thing with xiaomi aqara (ZNLDP12LM) bulbs. when it in ON state powercalc sensors become unavailable.
Logger: custom_components.powercalc.strategy.lut
Source: custom_components/powercalc/strategy/lut.py:116
Integration: Powercalc (documentation, issues)
First occurred: 07:05:42 (37 occurrences)
Last logged: 11:52:29
light.0x00158d000396a57f_light: Could not calculate power. no brightness set
light.0x158d0002d40e17_light: Could not calculate power. no brightness set
Hm... its probably XiaomiGateway3 integration bug. AlexxIT/XiaomiGateway3#1254
These both are issues with other integrations, so really should be reported in their respective issue trackers.
Powercalc needs the brightness and color information to lookup power for the light.
Each light MUST have this information according to HA specifications. When it doesn't powercalc sensor will report errors, but also HA lights cards etc will misbehave.
Closing this issue as it's not something I can fix.