Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT HVAC component - not subscribing to broker? #9942

Closed
DirkieP opened this issue Oct 18, 2017 · 3 comments
Closed

MQTT HVAC component - not subscribing to broker? #9942

DirkieP opened this issue Oct 18, 2017 · 3 comments

Comments

@DirkieP
Copy link

DirkieP commented Oct 18, 2017

Running HASS v 0.55.1 (on Ubuntu 16.04)
Running paho-mqtt v 1.3.0

I am having the following configuration.yaml section:
`climate:

  • platform: mqtt
    name: Downstairs
    modes:
    • day
    • eco
    • night
    • off
      mode_command_topic: /hass/thermo/1/setmode
      temperature_state_topic: /hass/thermo/1/setpoint
      current_temperature_topic: /hass/thermo/1/measured
      temperature_command_topic: /hass/thermo/1/settemp
      mode_state_topic: /hass/thermo/1/mode
      swing_modes:
      fan_modes:
      initial: 20`

This configuration does not return any configuration errors (so don't worry about the formatting) and properly displays the component. So far, so good...
Testing proper behaviour of the mqtt topics works fine too: example, when publishing an mqtt topic to '/hass/thermo/1/setmode day', the HVAC system switches to "Day"-mode and returns it's confirmed status to '/hass/thermo/1/mode' (payload is then 'day').

Problem: However Home Assistant does not record any state changes, while it is supposed to be subscribed to '/hass/thermo/1/mode' to collect mode_state_topic. I do not see any instance of it in the logs.
The same counts for '/hass/thermo/1/settemp' that is used for making changes to the temp setting, that results in a change of '/hass/thermo/1/setpoint', which should be picked-up by HASS to adjust the target temperature setting ('temperature_state_topic').
The only topic the MQTT HVAC component seems to be subscribing to is 'current_temperature_topic' which is reflected correctly in the interface.

Other findings: When starting up HASS, the logs return a number of errors which only appeared when setting up the HVAC MQTT component (so they dissappear when the component is removed from the configuration.yaml). So, the error must be related somehow to the component... The following is the error which appears once during the startup:
2017-10-18 14:05:20 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step result = coro.throw(exc) File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity new_entity, self, update_before_add=update_before_add File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py", line 236, in async_add_entity yield from entity.async_added_to_hass() File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/climate/mqtt.py", line 182, in async_added_to_hass handle_current_temp_received, self._qos) File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/mqtt/__init__.py", line 237, in async_subscribe yield from hass.data[DATA_MQTT].async_subscribe(topic, qos) File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/mqtt/__init__.py", line 533, in async_subscribe self._mqttc.subscribe, topic, qos) File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__ yield self # This tells Task to wait for completion. File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result raise self._exception File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.5/dist-packages/paho/mqtt/client.py", line 1194, in subscribe if qos < 0 or qos > 2: TypeError: unorderable types: NoneType() < int()

Hope this helps... Dirkie

@tinloaf
Copy link
Contributor

tinloaf commented Oct 19, 2017

This should be fixed with #9802

@DirkieP
Copy link
Author

DirkieP commented Oct 19, 2017

Works! Thanks great!

@tinloaf
Copy link
Contributor

tinloaf commented Oct 19, 2017

Cool. 🙂 Could you close the ticket?

@DirkieP DirkieP closed this as completed Oct 20, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Mar 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants