Hello,
I have hass.io running on proxmox/debian x86, with the “Mosquitto Broker” add-on on the same virtual machine providing MQTTS on port 8883. Last night I updated to 0.103.3 and now I get errors in my log and my climate.mitsubishi_mqtt entries are “unavailable”.
They are also unsupported and locally modified by me, so I’m not expecting much help. I guess I’m just going to paste this here to help anyone else wandering into the same issue.
I reverted to 0.103.0 and now things are working again: with only the “custom integration”/“stability problems” warning and no errors. For now it is Christmas, I expect I will have more time to review this after 3 Jan.
In the log I see:
2019-12-23 01:45:59 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for mitsubishi_mqtt which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-12-23 01:46:00 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 406, in _async_add_entity
await entity.async_added_to_hass()
File "/config/custom_components/mitsubishi_mqtt/climate.py", line 103, in async_added_to_hass
await self._subscribe_topics()
File "/config/custom_components/mitsubishi_mqtt/climate.py", line 164, in _subscribe_topics
self.hass, self._sub_state, topics)
File "/usr/src/homeassistant/homeassistant/components/mqtt/subscription.py", line 83, in async_subscribe_topics
await requested.resubscribe_if_necessary(hass, current)
File "/usr/src/homeassistant/homeassistant/components/mqtt/subscription.py", line 40, in resubscribe_if_necessary
hass, self.topic, self.message_callback, self.qos, self.encoding
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 433, in async_subscribe
async_remove = await hass.data[DATA_MQTT].async_subscribe(
KeyError: 'mqtt'
2019-12-23 01:46:00 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 406, in _async_add_entity
await entity.async_added_to_hass()
File "/config/custom_components/mitsubishi_mqtt/climate.py", line 103, in async_added_to_hass
await self._subscribe_topics()
File "/config/custom_components/mitsubishi_mqtt/climate.py", line 164, in _subscribe_topics
self.hass, self._sub_state, topics)
File "/usr/src/homeassistant/homeassistant/components/mqtt/subscription.py", line 83, in async_subscribe_topics
await requested.resubscribe_if_necessary(hass, current)
File "/usr/src/homeassistant/homeassistant/components/mqtt/subscription.py", line 40, in resubscribe_if_necessary
hass, self.topic, self.message_callback, self.qos, self.encoding
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 433, in async_subscribe
async_remove = await hass.data[DATA_MQTT].async_subscribe(
KeyError: 'mqtt'
This suggests to me that either the method of manipulating mqtt in the python has changed, or I walked into a corner in the latest version.
My relevant configuration.yaml lines are:
mqtt:
broker: core-mosquitto
username: !secret mqtt_core_user
password: !secret mqtt_core_password
discovery: true
climate:
- platform: mitsubishi_mqtt
name: "Lounge Heatpump"
command_topic: "hp/lohp/set"
temperature_state_topic: "hp/lohp/status"
state_topic: "hp/lohp/status"
(and a second one very similar). Probably why there are two errors logged.
Outside Home Assistant, I can interact with the heatpump by mosquitto_sub and mosquitto_pub to the topics; it’s only the custom_component that is not happy.
The custom component is from https://github.com/SittingDuc/HeatPump/blob/bb4a4a37d682b61e197b0ccd6893f6c846c37f5e/integrations/home-assistant.io/custom_components/mitsubishi_mqtt/climate.py (all thanks to SwiCago for the original code). I see liberal use of MQTT calls, but no mention of “async” and that may be what I fell afoul of.
TL;DR
Updating hass.io x86 to 0.103.3 broke climate.mitsubishi_mqtt, an unsupported custom_component forked from github. Log messages suggest an issue with MQTT and an asynchronous call. Workaround is to roll back to 0.103.0
Cheers!