-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Boolean format API/MQTT options 1/0 and true/false don't work as expected #931
Comments
Only if you are using HA. That's another stupid limitation of HA. Disable HA and you get the native format. Lines 1528 to 1530 in ede8e7d
|
Can you write something more about this HA limitation? Maybe there's a way to workaround it... |
No, i'm not using HA. Proddy has spend a lot of time and work to add code and comments for the HA extras. I'm only reading the comments (as quoted). |
It's a limitation of HA's MQTT Discovery (e.g. https://www.home-assistant.io/integrations/switch.mqtt/) which requires ..but if you're using Home Assistant you shouldn't really care what the API/MQTT format is? Do you have a use-case @pswid that I've overlooked? Like do you need numeric 1 and 0? |
in fact
to:
remove the condition: Lines 1528 to 1530 in ede8e7d
and boolean option "on/off" will start working (I've just tested it). Option "0/1" too! Howewer it would also be good to remove quotes from payload_on/off definitions (just for more "clarity"). ... I'm using API/MQTT not only with HA. |
ok great, that's what I was hoping for. Home Assistant finally fixed it (I promise it didn't use to be like this!) |
@proddy do you want me to try to prepare a fix? |
If you have time that would be great. Do test all scenarios. |
ok I will. hopefully this weekend |
…esp#931) furthermore variable names in the HA discovery payload has been abbreviated according to: https://www.home-assistant.io/integrations/mqtt/#discovery-payload
done. everything seems to work fine, though if you select option |
Nice! I'll try it out. |
fixed 1/0 and true/false MQTT/API format options with HA enabled (#931)
Latest v3.5.0-dev.16.
If I choose the
1/0
option as the Boolean Format API/MQTT, the quotation marks are added anyway in MQTT, so the option works the same as the option"1"/"0"
. The same problem withtrue/false
option.The text was updated successfully, but these errors were encountered: