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

"state" binary "ON"/"OFF" casing consistency for Waveman-Switch decoder #2946

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DigiH
Copy link
Contributor

@DigiH DigiH commented May 29, 2024

There are several decoders with the "state" key being a binary "ON"/"OFF" option.

To be able to create a single Home Assistant discovery routine for all of them, without having to create a separate one just for the Waveman-Switch decoder, brining the casing in line with all the others makes things more consistent and easier for discovery implementation.

See
Brennenstuhl RCS 2044
Nexa
Proove

@zuckschwerdt
Copy link
Collaborator

I'd say that if we change the output of binary keys we should directly go to 0/1. rtl_433 is not the presentation layer and should provide a machine-oriented format that is easy to parse and process.
But then again "state" is a confusing key here, I suspect it really is a command ("cmd")?

@DigiH
Copy link
Contributor Author

DigiH commented May 30, 2024

0/1 would be fine as well, as long as there is some consistency, especially for commonly creating discovery messages for all such keys, with the payload_on and payload_off being the same. Then with assigning appropriate type device classes for different decoders the HA display would be converted nicely from ON/OFF - 1/0.

https://www.home-assistant.io/integrations/binary_sensor/

When there is no device class specified (None) the default binary sensor for HA is actually showing ON/OFF, so maybe it might be ok to keep. This would also mean less of a breaking change for existing users with different controllers, when only one decoder has a casing change from on/off to ON/OFF!?!

And yes, the key name "state" is also confusing, as it appears as binary ON/OFF 1/0 as above, but also as open/closed (again with inconsistencies throughout as "open", "Open" or "OPEN") or as completely arbitrary strings or an integer.

But aligning all binary keys and generalising string casings would be a great help in making discovery messages a lot easier, without having to investigate every individual decoder.

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