Core: 0.86.0b0 MQTT Devices Not Loading

Created on 17 Jan 2019  路  7Comments  路  Source: home-assistant/core

Home Assistant release with the issue:
0.86.0b0

Last working Home Assistant release (if known):
0.85.1

Operating environment (Hass.io/Docker/Windows/etc.):
Debian

Component/platform:
MQTT Light, Switch, Sensor, Binary Sensor

Description of problem:
Since updating to the 0.86 beta, all of my MQTT devices are broken. I seem to get an error for each MQTT entry I have (I've only copied a small sample, as there's lots of them).

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
Again, just one example

switch:
  - platform: mqtt
    name: Sprinkler Zone 1
    icon: mdi:water
    state_topic: "node/sprinkler/006/state"
    command_topic: "node/sprinkler/006/command"
    availability_topic: "node/sprinkler/006/availability"
    payload_on: "1_on"
    payload_off: "1_off"

Traceback (if applicable):

2019-01-17 13:15:01 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform mqtt
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/mqtt.py", line 62, in async_setup_platform
    await _async_setup_entity(config, async_add_entities)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/mqtt.py", line 81, in _async_setup_entity
    async_add_entities([MqttSensor(config, discovery_hash)])
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/mqtt.py", line 109, in __init__
    payload_available, payload_not_available)
TypeError: __init__() takes 2 positional arguments but 5 were given
2019-01-17 13:15:01 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform mqtt
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/mqtt.py", line 59, in async_setup_platform
    await _async_setup_entity(config, async_add_entities)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/mqtt.py", line 77, in _async_setup_entity
    async_add_entities([MqttBinarySensor(config, discovery_hash)])
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/mqtt.py", line 100, in __init__
    payload_available, payload_not_available)
TypeError: __init__() takes 2 positional arguments but 5 were given
2019-01-17 13:15:02 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform mqtt
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/mqtt.py", line 57, in async_setup_platform
    discovery_info)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/mqtt.py", line 76, in _async_setup_entity
    async_add_entities([MqttSwitch(config, discovery_hash)])
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/mqtt.py", line 104, in __init__
    payload_available, payload_not_available)
TypeError: __init__() takes 2 positional arguments but 5 were given

Additional information:

mqtt

Most helpful comment

Reposting my comment from discord:

The wheel package for 0.86.0b0 is tainted. Sdist works. Workaround:

pip uninstall -y homeassistant
pip install --pre --no-binary=homeassistant homeassistant

All 7 comments

Same error here with Tasmota Discovery and with manual configuration.

- platform: mqtt
  name: 'Shelly2 5B2604 Relay 0'
  state_topic: 'shellies/shellyswitch-5B2604/relay/0'
  command_topic: 'shellies/shellyswitch-5B2604/relay/0/command'
  availability_topic: 'shellies/shellyswitch-5B2604/online'
  unique_id: 'shellyswitch-5B2604-relay-0'
  payload_on: 'on'
  payload_off: 'off'
  payload_available: 'true'
  payload_not_available: 'false'
  qos: 1
  retain: true

Environment: RPi3, Raspbian, Python 3.6.3 virtualenv, Mosquitto.

I think this can be caused by files moved in PR #20050 still being present.
Can you confirm which commit you're on?

HA 0.86.0b0

Thanks.

Then this is caused by stale files present after the renaming of files in PR #20050:

Instead of, for example:
/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/mqtt.py
You should have a file:
/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/mqtt/sensor.py

If you have both, it should be safe to remove:
/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/mqtt.py

Reposting my comment from discord:

The wheel package for 0.86.0b0 is tainted. Sdist works. Workaround:

pip uninstall -y homeassistant
pip install --pre --no-binary=homeassistant homeassistant

@balloob You mentioned on discord the underlying issue causing the bad wheel package has been fixed, so this can be closed?

Yes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aweb-01 picture aweb-01  路  3Comments

arangates picture arangates  路  3Comments

moskovskiy82 picture moskovskiy82  路  3Comments

bdraco picture bdraco  路  3Comments

piitaya picture piitaya  路  3Comments