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

Mosquitto broker not creating an entry into HA Devices or Entities list when adding a previously deleted device #35684

Closed
heisenberg2980 opened this issue May 16, 2020 · 8 comments
Assignees

Comments

@heisenberg2980
Copy link
Contributor

The problem

I am using zigbee2mqtt and Mosquitto broker in hassio (HassOS 3.13) and I am having an issue with zigbee devices, because every time I remove one device from Home Assistant and add it again, Home Assistant doesn’t create an entry in the Entities or Devices list for the device.

I am removing the device using topic zigbee2mqtt/bridge/config/force_remove, and then when I add the device again, zigbee2mqtt recognise it (I can see the message {"type":"pairing","message":"interview_successful","meta":{"friendly_name":"xxxxxxxxxxxx","model":"xxxxxxxx","vendor":"xxxxxx","description":"xxxxxxxxx","supported":true}} and any other subsequent message sent by the device in the zigbee2mqtt log, so pairing is successful), but Home Assistant doesn’t create an entry in the Entities or Devices list for the device.

These are the steps I am following:

  1. Remove zigbee device from HA using topic zigbee2mqtt/bridge/config/force_remove
  2. Restart HA
  3. Confirm zigbee device has been completely removed and it´s not appearing in the zigbee map (also zigbee2mqtt is not capturing any message sent from the device, so device has been removed)
  4. Enable zigbee option “permit_join = true” to allow zigbee devices to join
  5. Add the zigbee device to Ha using the reset button in the device
    After this process I can see the “interview_successful” message and also any new message sent from the device in zigbee2mqtt log, but the device doesn´t appear in HA devices list or entities list

I already checked the option “Enable newly added entities” is enable within MQTT Mosquitto Broker system options, so I don’t understand why the device is not added to the devices/entities list

Environment

  • Home Assistant Core release with the issue: 0.109.6
  • Last working Home Assistant Core release (if known): N/A
  • Operating environment (Home Assistant/Supervised/Docker/venv): Home Assistant
  • Integration causing this issue: MQTT Mosquitto Broker
  • Link to integration documentation on our website: https://github.com/home-assistant/hassio-addons/tree/master/mosquitto

Problem-relevant configuration.yaml

Traceback/Error logs

Additional information

@heisenberg2980 heisenberg2980 changed the title Mosquitto broker not creating an entry into HA Devices or Entities list Mosquitto broker not creating an entry into HA Devices or Entities list when adding a previously deleted device May 16, 2020
@probot-home-assistant
Copy link

mqtt documentation
mqtt source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @home-assistant/core, @emontnemery, mind taking a look at this issue as its been labeled with a integration (mqtt) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@emontnemery
Copy link
Contributor

@Koenkk can you confirm the steps described by OP are correct for deleting and readding a zigbee2mqtt device?
How does zigbee2mqtt remove the device from HA and how does it readd it?

@Koenkk
Copy link
Contributor

Koenkk commented May 16, 2020

@elbueno222 does this device reappear after restarting zigbee2mqtt? If yes, this is a zigbee 2mqtt bug.

@heisenberg2980
Copy link
Contributor Author

heisenberg2980 commented May 16, 2020

@Koenkk The device doesn't reappear after restarting zigbee2mqtt or Home Assistant, it just reappear when I link it again using the normal linking process. The problem is once the device is linked again, MQTT Mosquitto Broker should add the device to the Devices and Entities list and it's not doing it.
I would like to know how MQTT Mosquitto Broker adds the devices to the Devices/Entities list and if there is any log where I can see why it's not doing it for devices previously deleted. My guess is that the delete process leaves data about the device somewhere that interfere with the discovery process but I don't know how the discovery process add the devices to HA tables.

@Koenkk
Copy link
Contributor

Koenkk commented May 16, 2020

Can you try:

  1. Remove device from zigbee2mqtt
  2. Stop zigbee2mqtt
  3. Start zigbee2mqtt
  4. Pair device
  5. Is this device discovered now?

@heisenberg2980
Copy link
Contributor Author

@Koenkk I don't really understand why, but following the steps you mentioned the device is discovered and entries are created in the Devices and Entities lists, thank you very much.

For some reason stopping and starting zigbee2mqtt produce a different effect than restarting HA (even I would assume restarting HA would also restart zigbee2mqtt)

@Koenkk
Copy link
Contributor

Koenkk commented May 17, 2020

@elbueno222 this is a zigbee2mqtt bug. Fixed it in the latest dev branch. (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html)

@emontnemery I think this issue can be closed as it's not related to Home Assistant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants