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

fix backwards binary sensor payload on/off values #1073

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

airdrummingfool
Copy link

I noticed that when I configured a binary motion sensor on my BK7231T device, it was showing up inverted in Home Assistant when I used MQTT Discovery. I checked the discovery payload and found that the pl_on and pl_off values were inverted, even though the binary motion sensor on my device was not configured to be inverted. I checked the code and it looks like it is set up backwards.

Thanks for this great project!

@openshwprojects
Copy link
Owner

I can see how that can be a problem, but how do we handle now people who have already configurations to respect it?

@airdrummingfool
Copy link
Author

That's a good question.

I would imagine that existing users would be unaffected until a new discovery payload was pushed to MQTT, but I don't know how often that happens. If it is only when discovery is started manually, perhaps we could recognize the use of a binary sensor and show a warning in the UI? That won't work if it gets updated more often (e.g. every device power cycle or HA reboot or anything like that).

You can call it out it as a breaking change in the release changelog (maybe put it at the top or in bold letters or something), but I don't know how often people check the release notes before upgrading. Maybe you can announce it before releasing the change, e.g. have it in the changelog as an "upcoming breaking change" for perhaps for a month before merging?

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.

None yet

2 participants