-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add HA discovery option to PIR sermod #2853
Conversation
@albarlow can you verify this still works as intended as I do not own HA? |
The code is looking right but I'm not getting the message publishing. I deleted out the existing message and then rebuilt the firmware from the pir-ha-discovery channel and it's not published the message. I'll take a further look tomorrow in case its something at my end. |
I moved the initial broadcast into connected() as to not need retained message. EDIT: It should not be in loop(). |
@albarlow I have it correctly publish (when MQTT broker connection is established) but comparing the topic to other HA autodiscovery topics (in Multi Relay and Temperature usermods) this seems off as it publishes on |
Publish on MQTT connect.
I have tried again this evening and I can confirm that for me this is also working now, my existing entity in home assistant was able to detect this as the same device and has linked it the brightness sensor usermod output so they all appear in the same device (pictured below with BH1750 usermod output). I like the use of linking it to onMQTTConnect - that feels better than having it on setup. Is that something I can port to the other two usermods I've been working on as I don't recall seeing that as something to harness previously(?) |
Yes, you can. I've added (but not documented) the feature when implementing Multi Relay usermod. |
I've also had this verified independently by @srg74 and he also confirmed it working. So I'll merge this PR and close the other. |
Sorry, but this seems to break HA integrations.
Something is broken... im cant get the entry to show up. MQTT does not publish the motion topic to.. no matter what i try. |
Please use a pre-compiled binaries from @srg74 and report back. |
as far i see he has only esp32 this is a esp01s. Or am i missing it? |
Replaces #2724 where I accidentally pushed changes from main branch messing up commit history.