-
Notifications
You must be signed in to change notification settings - Fork 37
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
MQTT output as JSON #41
Comments
Please keep in mind that home assistant isn't the only home automation system. For other systems it's more convenient to expose single states, however it's easily doable to just do both, HA can just ignore the single states. I'm not using HA, so I'm not too familiar with how HA handles updates via MQTT - the HA part wasn't added by me but by @rodriguezst. That being sad, I'm open to making changes to improve things. Maybe you can explain a bit more, and point me to some documentation. |
I'd also vote for a JSON object as an alternative output format for representing lock states. A lock state change has several attributes like Currently those attributes are published sequentially starting with It looks like homeassistant supports JSON topics: |
Jen, if you think we could support both methods (with a user option maybe), I think @kvj would be willing to contribute to the JSON object implementation. @kvj: we're discussing about this in https://discord.gg/mPHyWF55Gv, would be awesome if you joined the project. :) |
I would as well vote for a JSON output of composite data. For the client, such a JSON object is much easier to parse and less error-prone than assembling the same object from various values of different topics. The keypad code list has the additional challenge of being of variable length. The client does not know in advance when to stop reading/waiting ("Is keypad/code_$n/... the last item or do I need to wait for more data?"). A JSON array of keypad objects would be very helpful here. |
Having the information who locked or unlocked the door available as an attribute of the lock state would still be very useful! E.g. if the last two lock actions have been done manually, the trigger state will simply stay at |
Hi @technyon
first of all I appreciate all the work you've done so far, the code quality is very high!
I'm creator/maintainer of https://github.com/kvj/hass_nuki_ng custom Nuki component for HASS and I've been also hacking Bluetooth API recently.
How much are you open discussing changes in MQTT ouput format?
I see that you purposely decided to expose each field of status, config, last auth, etc entry as a topic instead of JSON object. e.g.
Topic:
xxx/yyy/config
and payload:{"auto_lock": true, "led_enabled": false}
Then you can push multiple updates via single mqtt payload (anyway you get all the config updates via one BLE payload), but more importantly, you can greatly simplify MQTT discovery and expose all the attributes as state properties instead of making single entity for each field.
Tell me WDYT and I can contribute to the project
The text was updated successfully, but these errors were encountered: