core: mqtt statestream not working

The problem

mqtt statestream error on 2023.4.0b0 or 2023.4.0b1, but works fine when rolled back to 2023.3.6

configuration.yaml

mqtt_statestream:
  base_topic: homeassistant
  include:
    entities:
      - binary_sensor.backyard_motion
      - binary_sensor.kitchen_motion
      - binary_sensor.porch_motion
      - binary_sensor.pet_cam_motion

The errors:

Logger: homeassistant.setup Source: setup.py:279 First occurred: 6:55:37 PM (1 occurrences) Last logged: 6:55:37 PM

Setup failed for mqtt_statestream: Integration failed to initialize.

Logger: homeassistant.components.mqtt_statestream Source: components/mqtt_statestream/init.py:50 Integration: mqtt_statestream (documentation, issues) First occurred: 6:55:37 PM (1 occurrences) Last logged: 6:55:37 PM

MQTT integration is not available

What version of Home Assistant Core has the issue?

2023.4.0b1

What was the last working version of Home Assistant Core?

2023.3.6

What type of installation are you running?

Home Assistant Container

Integration causing the issue

mqtt statestream

Link to integration documentation on our website

https://www.home-assistant.io/integrations/mqtt_statestream/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (17 by maintainers)

Most upvoted comments

Just a quick note to let you know that I am running the mqtt_statestream from #91454 as a custom_component and it is working for me. Thanks.

@bdraco it seems both mqtt and mqtt_statestream are set up at stage 2. With the dependency mqtt will be set up first. The only scenario I can think of is that the setup of MQTT is not successful at the time mqtt_statestream is initialized. hass.data["setup_done"]["mqtt"] is not set before the mqtt entry has been started. After setup the mqtt key is removed from hass.data["setup_done"]. Then the only check that is performed is that the mqtt entry has LOADED state. Somehow that seems not to be the case. @balloob May be you have some suggestions here?