marthoc / GarHAge

a Home-Automation-friendly ESP8266-based MQTT Garage Door Controller
MIT License
170 stars 42 forks source link

HA - Error doing job: Task exception was never retrieved #17

Closed chad-p closed 6 years ago

chad-p commented 6 years ago

First - Thank you for your work. I am in the testing phases currently with Home Assistant (hass.io). Things seem to be working but my home-assistant.log is filling up with this (about every 2 sec)...

2018-04-05 22:51:50 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 594, in _async_perform_subscription
    _raise_on_error(result)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 680, in _raise_on_error
    'Error talking to MQTT: {}'.format(mqtt.error_string(result_code)))
homeassistant.exceptions.HomeAssistantError: Error talking to MQTT: The client is not currently connected.

After about 5-10min then GarHAge functionally stops and I have to cycle the NodeMCU which starts the process all over again. I switched to your 'fixed' branch to see if that fixed it and also added/removed the automations.yaml configuration but no go. I am using 'cover' method.

Have you seen this? Any ideas you have would be appropriated.

Thanks again!

marthoc commented 6 years ago

I haven't seen this particular error but I am very sure that it has nothing to do with GarHAge. No MQTT client should care whether another MQTT client is connected: Home Assistant connects to the broker and reads the topics and messages that get delivered to it regardless whether GarHAge is also connected to the broker.

What this looks like instead is that your Home Assistant instance is losing its own connection to your MQTT broker: the error is "Error talking to MQTT: The client is not currently connected." The client that message is referring to is Home Assistant's MQTT client functionality. You'll need to troubleshoot what's going on with HA to cause this. Some things to consider to start:

  1. What broker are you using? Is it HA's built-in broker, or a Hass.io add-on, or a separate server altogether?
  2. If the broker is an add-on or separate server, what does your configuration.yaml mqtt: configuration look like?