dolezsa / thermal_comfort

Thermal Comfort sensor for HA (absolute humidity, heat index, dew point, thermal perception)
Other
609 stars 117 forks source link

Can't create new sensor #391

Closed bernikr closed 2 weeks ago

bernikr commented 1 month ago

I currently have 5 thermal comfort sensors configured and they work flawlessly. However, when i want to add a new one i get the following error:

Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble

Im on Home Assistant 2024.09.0, but I'm not sure when it broke, since this was the first sensor I wanted to add for ages.

Thermal Comfort Version is 2.2.2. I redownloaded through hacs and restarted home assistant but the error still occurs.

mjl commented 1 month ago

I see the same error, but with a totally fresh install (I just installed thermal comfort from HACS). I cannot even install the integration.

The error in the logs is:

  File "/config/custom_components/thermal_comfort/config_flow.py", line 360, in build_schema
    humidity_sensors = get_sensors_by_device_class(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/thermal_comfort/config_flow.py", line 309, in get_sensors_by_device_class
    additional_sensors = list(filter(f, additional_sensors))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/thermal_comfort/config_flow.py", line 114, in filter_useless_domain
    Platform.MAILBOX,
    ^^^^^^^^^^^^^^^^
AttributeError: type object 'Platform' has no attribute 'MAILBOX'
raysmith844 commented 1 month ago

Well, I encounter the same issue. Nothing I can do to sort this out. I just want to re-configure on sensor and the same error occurs. I'm on Home Assistant 2024.09.0 ,too, mhhhh**

sokripon commented 1 month ago

Homeassistant removed that platform in this PR: https://github.com/home-assistant/core/pull/123741

https://github.com/dolezsa/thermal_comfort/blob/7359eabd69933333f9a29cf827c770b3e44bac2d/custom_components/thermal_comfort/config_flow.py#L114

So to fix it without waiting for this to update, you can edit the file in ha using one of the file editor addons. image So, just delete the line with Platform.MAILBOX, save, and restart ha.