You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using SLR1b with a Hive thermostat to control my boiler.
I've noticed in HA logs that very often I'm getting error messages like below.
2025-01-31 00:46:29.625 ERROR (MainThread) [homeassistant.util.logging] Exception in mqtt_message_received when handling msg on 'zigbee2mqtt/Hive Receiver': '{"linkquality":58,"local_temperature":20.58,"occupied_heating_setpoint":15,"running_state":"idle","system_mode":"heat","temperature_setpoint_hold":true,"temperature_setpoint_hold_duration":65535}'
Traceback (most recent call last):
File "/config/custom_components/hive_local_thermostat/__init__.py", line 81, in mqtt_message_received
for entity in hass.data[DOMAIN][entry.entry_id][platform]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: <Platform.SELECT: 'select'>
I did a bit investigation and I think I have an idea why this is happening. Here the value of PLATFORMS is as below [<Platform.SENSOR: 'sensor'>, <Platform.CLIMATE: 'climate'>, <Platform.NUMBER: 'number'>, <Platform.SELECT: 'select'>, <Platform.BUTTON: 'button'>, <Platform.BINARY_SENSOR: 'binary_sensor'>]
However, my hass.data[DOMAIN][entry.entry_id] doesn't have <Platform.SELECT: 'select'>. It only has the below {'entities': [], <Platform.SENSOR: 'sensor'>: [<entity sensor.hive_receiver_running_state_heat=idle>, <entity sensor.hive_receiver_current_temperature=20.6>, <entity sensor.hive_receiver_heating_boost_remaining=unknown>], <Platform.CLIMATE: 'climate'>: [<entity climate.hive_receiver_climate=heat>], 'heating_boost_duration': 120, 'heating_frost_prevention': 12, 'heating_default_temperature': 20, 'heating_boost_temperature': 25, <Platform.NUMBER: 'number'>: [<entity number.hive_receiver_heating_boost_duration=120>, <entity number.hive_receiver_heating_frost_prevention=12>, <entity number.hive_receiver_heating_default_temperature=20>, <entity number.hive_receiver_heating_boost_temperature=25>], <Platform.BUTTON: 'button'>: [<entity button.hive_receiver_heating_boost=unknown>], <Platform.BINARY_SENSOR: 'binary_sensor'>: [<entity binary_sensor.hive_receiver_heating_boost=unknown>]}
As there's no <Platform.SELECT: 'select'> in that dictionary, I get the KeyError.
Then, I looked a bit more into why I don't have <Platform.SELECT: 'select'>. I believe it's because I don't have a SELECT entity created.
Then, I checked what happens to select entities here. If I'm not mistaken, this is something only used with hot water, but my boiler, thus my receiver, doesn't have anything to do with hot water.
So, to solve this I think a simple check to see if platform exists in hass.data[DOMAIN][entry.entry_id][platform] in here should suffice like below
for platform in PLATFORMS:
if platform in hass.data[DOMAIN][entry.entry_id]:
for entity in hass.data[DOMAIN][entry.entry_id][platform]:
entity.process_update(parsed_data)
Or
The solution could be to remove Platform.SELECT in here for SLR1 devices as they don't have hot water, but only SLR2 do as described here.
I can create a fork and do the first one, but not sure how to implement the second solution.
What do you think? Is this the correct root cause?
I'm surprised that this hasn't been raised before. Maybe it's because most important functions, namely Platform.SENSOR, Platform.CLIMATE, Platform.NUMBER, which happen to be before Platform.SELECT in this list are working fine.
The text was updated successfully, but these errors were encountered:
Hi, thanks for reporting this. I have an SRL2 so didn't see this issue.
You are right with your suggestions, I'll just need to build some conditionals around the platforms.
It won't hurt but I hate log errors as much as anyone so will work on a fix.
Hi,
I'm using SLR1b with a Hive thermostat to control my boiler.
I've noticed in HA logs that very often I'm getting error messages like below.
I did a bit investigation and I think I have an idea why this is happening.
Here the value of PLATFORMS is as below
[<Platform.SENSOR: 'sensor'>, <Platform.CLIMATE: 'climate'>, <Platform.NUMBER: 'number'>, <Platform.SELECT: 'select'>, <Platform.BUTTON: 'button'>, <Platform.BINARY_SENSOR: 'binary_sensor'>]
However, my
hass.data[DOMAIN][entry.entry_id]
doesn't have<Platform.SELECT: 'select'>
. It only has the below{'entities': [], <Platform.SENSOR: 'sensor'>: [<entity sensor.hive_receiver_running_state_heat=idle>, <entity sensor.hive_receiver_current_temperature=20.6>, <entity sensor.hive_receiver_heating_boost_remaining=unknown>], <Platform.CLIMATE: 'climate'>: [<entity climate.hive_receiver_climate=heat>], 'heating_boost_duration': 120, 'heating_frost_prevention': 12, 'heating_default_temperature': 20, 'heating_boost_temperature': 25, <Platform.NUMBER: 'number'>: [<entity number.hive_receiver_heating_boost_duration=120>, <entity number.hive_receiver_heating_frost_prevention=12>, <entity number.hive_receiver_heating_default_temperature=20>, <entity number.hive_receiver_heating_boost_temperature=25>], <Platform.BUTTON: 'button'>: [<entity button.hive_receiver_heating_boost=unknown>], <Platform.BINARY_SENSOR: 'binary_sensor'>: [<entity binary_sensor.hive_receiver_heating_boost=unknown>]}
As there's no
<Platform.SELECT: 'select'>
in that dictionary, I get the KeyError.Then, I looked a bit more into why I don't have
<Platform.SELECT: 'select'>
. I believe it's because I don't have a SELECT entity created.Then, I checked what happens to
select
entities here. If I'm not mistaken, this is something only used with hot water, but my boiler, thus my receiver, doesn't have anything to do with hot water.So, to solve this I think a simple check to see if platform exists in
hass.data[DOMAIN][entry.entry_id][platform]
in here should suffice like belowOr
The solution could be to remove
Platform.SELECT
in here for SLR1 devices as they don't have hot water, but only SLR2 do as described here.I can create a fork and do the first one, but not sure how to implement the second solution.
What do you think? Is this the correct root cause?
I'm surprised that this hasn't been raised before. Maybe it's because most important functions, namely
Platform.SENSOR, Platform.CLIMATE, Platform.NUMBER
, which happen to be beforePlatform.SELECT
in this list are working fine.The text was updated successfully, but these errors were encountered: