ccutrer / balboa_worldwide_app

Ruby library for communication with Balboa Water Group's WiFi module or RS-485
99 stars 27 forks source link

Home Assistant MQTT Discovery #42

Closed jshank closed 3 years ago

jshank commented 3 years ago

This PR enables balboa_worldwide_app to automatically create entities in Home Assistant through MQTT Discovery. The readme has also been updated to include:

ccutrer commented 3 years ago

I'll have to think on this. I'm generally of the opinion that HASS should add support for the agnostic Homie convention rather than devices having to support HASS specific metadata. Especially since I want to convert all the MQTT handling to use the homie-mqtt gem, which vastly simplifies the code.

jshank commented 3 years ago

I appreciate the consideration and this amazing utility. This was actually my first attempt at ruby coding and your coding style and clear descriptions made it easy to understand what was happening and where to plug-in.

There shouldn't be any impact to you using the homie-mqtt gem (great idea!). I just generate the Home Assistant specific auto discovery code and point to the entities at their native homie/bwa/ topics. There is no impact to the Homie implementation. If you do change the device topics, I'd be happy to maintain the Home Assistant MQTT Discovery portion and enhance or update it as new functionality comes along. Just tag me on any check ins that need it. I'm also happy to take any guidance on moving this code to another location, it just made the most sense to me to put it in bwa_mqtt_bridge.

Regarding HASS adding support for the Homie convention, I haven't see the team reject any PRs that proposed it, I just don't think anyone has done the translation work. It's beyond my coding skills but I do think it would be a great enhancement.

ccutrer commented 3 years ago

Note I made some non-trivial changes in the merge. Mostly ensuring the topics auto-adjust properly, and using symbols instead of strings for hash keys.

jshank commented 3 years ago

Changes look great and I've successfully tested the new code in my environment . I'll follow your style and create a new PR for the added functions (hold, & filter configs). Thanks again!