cmroche / OctoPrint-HomeAssistant

Home Assistant plugin for OctoPrint, enabling MQTT discovery of you device and sensors
110 stars 18 forks source link

MQTT changing/setting Base topic other than default octoPrint breaks integration #79

Closed ImagineerNL closed 2 years ago

ImagineerNL commented 2 years ago

In a previous closed issue you comment that updates are published to the topic defined in MQTT base topic. https://github.com/cmroche/OctoPrint-HomeAssistant/issues/34#issuecomment-687630323

However; changing this to any value other than octoPrint breaks integration. I have 2 octoprint instances, one for a laser, one for the printer. Setting the base topic to 'octoLaser' publishes to the topic 'octolaser', however, the HA Discovery payload keeps listening to "state_topic: octoPrint/" and thus fails to update any value.

Can currently not reproduce if this happened due to changing base topic after HA discovery, or if this happens even when setting the topic different before enabling HA discovery. Changing Base topic should enable (manual?) refreshing of the payload topic values

image

image

richard-scott commented 2 years ago

If you change the Device name, you also need to change the Node ID, otherwise Home Assistant won't see the changes.

Screenshot 2021-10-21 at 09 54 18 e

After a restart of OctiPrint, you will see all your entities populated again on the new device name and you can delete the old one.

ImagineerNL commented 2 years ago

This works, thanks!