Hi Guys
I have updated to the latest Home-Assistant 2021.03 today. I am running HA in a docker container.
With this latest update my tasmotized iFan03 is now showing as unavailable. Relevant log shows:
2021-03-05 05:47:47 ERROR (MainThread) [homeassistant.util.logging] Exception in availability_message_received when handling msg on 'tele/fan1/LWT': 'Online'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 32, in wrapper
msg_callback(msg)
File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 295, in availability_message_received
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 295, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 313, in _async_write_ha_state
attr = self.capability_attributes
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 510, in capability_attributes
attrs[ATTR_PRESET_MODES] = self.preset_modes
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 634, in preset_modes
return preset_modes_from_speed_list(self.speed_list)
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 680, in preset_modes_from_speed_list
return [
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 683, in <listcomp>
if speed.lower() in _NOT_SPEEDS_FILTER and speed.lower() != SPEED_OFF
AttributeError: 'bool' object has no attribute 'lower'
When I switch on the fan in the tasmota interface home assistat shows some more error messages such as:
2021-03-05 07:21:10 ERROR (MainThread) [homeassistant.util.logging] Exception in speed_received when handling msg on 'stat/fan1/RESULT': '{"FanSpeed":1}'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 32, in wrapper
msg_callback(msg)
File "/usr/src/homeassistant/homeassistant/components/mqtt/fan.py", line 248, in speed_received
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 295, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 313, in _async_write_ha_state
attr = self.capability_attributes
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 510, in capability_attributes
attrs[ATTR_PRESET_MODES] = self.preset_modes
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 634, in preset_modes
return preset_modes_from_speed_list(self.speed_list)
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 680, in preset_modes_from_speed_list
return [
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 683, in <listcomp>
if speed.lower() in _NOT_SPEEDS_FILTER and speed.lower() != SPEED_OFF
AttributeError: 'bool' object has no attribute 'lower'
My relevant yaml for the fan integration is as follows (just in case):
fan OfficeFan:
- platform: mqtt
name: "Office Fan"
command_topic: "cmnd/fan1/FanSpeed"
speed_command_topic: "cmnd/fan1/FanSpeed"
state_topic: "stat/fan1/RESULT"
speed_state_topic: "stat/fan1/RESULT"
state_value_template: >
{% if value_json.FanSpeed is defined %}
{% if value_json.FanSpeed == 0 -%}0{%- elif value_json.FanSpeed > 0 -%}4{%- endif %}
{% else %}
{% if states.fan.office_fan.state == 'off' -%}0{%- elif states.fan.office_fan.state == 'on' -%}4{%- endif %}
{% endif %}
speed_value_template: "{{ value_json.FanSpeed }}"
availability_topic: tele/fan1/LWT
payload_off: "0"
payload_on: "4"
payload_low_speed: "1"
payload_medium_speed: "2"
payload_high_speed: "3"
payload_available: Online
payload_not_available: Offline
speeds:
- off
- low
- medium
- high
After all of the above information… is there anything I can do on my end to get my fan properly working again with HA 2021.03?
For the time being I’ll revert back to the previous version.