Skip to content

Use node_id in unique_id and mqtt topics#16

Merged
lanrat merged 3 commits intolanrat:mainfrom
elratt0r:use_node_id
Dec 10, 2022
Merged

Use node_id in unique_id and mqtt topics#16
lanrat merged 3 commits intolanrat:mainfrom
elratt0r:use_node_id

Conversation

@elratt0r
Copy link
Copy Markdown
Contributor

This patch makes use of the MQTT_NODE_ID and MQTT_DEVICE_NAME values to form unique mqtt topics so there can be multiple devices at the same time.

@lanrat lanrat merged commit c8ef4c2 into lanrat:main Dec 10, 2022
@lanrat
Copy link
Copy Markdown
Owner

lanrat commented Dec 10, 2022

Looks Great! Thanks.

@lanrat
Copy link
Copy Markdown
Owner

lanrat commented Dec 10, 2022

I think it was due to one of your prior merged PRs. But I'm noticing that my boot_count, activity_count, and boot_reason stats are no longer being updated in HASS. The values in MQTT seem to be correct.

Are you having this same issue or is it something with my setup?

@elratt0r
Copy link
Copy Markdown
Contributor Author

I had this problem once when there were a leftover device inside HA. I had to delete it with the three dots next to "MQTT Info", then restart the homeplate and reenable the diagnostic sensors.

@lanrat
Copy link
Copy Markdown
Owner

lanrat commented Dec 10, 2022

I just tried that and had no luck. It's really strange, the config and state objects seem correct.

Screen Shot 2022-12-10 at 3 09 32 PM

@elratt0r
Copy link
Copy Markdown
Contributor Author

Looks all good. Maybe HA got a hickup in the subscribe? Does the sensor show in the MQTT Info part? Does the data under "Subscribed topics" match "homeassistant/sensor/homeplate/boot/state" and are there any received telegrams?

scr_hass_boot

@lanrat
Copy link
Copy Markdown
Owner

lanrat commented Dec 10, 2022

It does not...

I was thinking since I combine the state of these sensors into a single state, that HA could be buggy with that, but I do the same for battery & voltage which work as expected.

Screen Shot 2022-12-10 at 3 27 06 PM

@elratt0r
Copy link
Copy Markdown
Contributor Author

Combining works fine usually. It looks like HA somehow swallowed the setup topic for this sensor. Try deleting the device and restart HA. (I see that all the disabled sensors are missing, are they visible in the diagnostics tab, maybe under the hidden version?)

@lanrat
Copy link
Copy Markdown
Owner

lanrat commented Dec 10, 2022

I figured it out! When I deleted and re-added my homeplate to fix the device info now showing up, it reset the sensor states that are disabled by default. After re-enabling them they started working again.

Screen Shot 2022-12-10 at 3 43 31 PM

@lanrat
Copy link
Copy Markdown
Owner

lanrat commented Dec 10, 2022

I thing the "MQTT INFO" button should still show that data for debugging purposes, especially if it can show it with a disabled annotation....

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants