pimoroni / enviro

MIT License
105 stars 84 forks source link

Home Assistant (HASS) Discovery via MQTT #156

Open andymanic opened 1 year ago

andymanic commented 1 year ago

I've added Home Assistant discovery to the MQTT destination for all four Enviro boards. It's not absolutely perfect as wind direction and gas resistance aren't detected currently since HASS doesn't have a device class for direction or resistance, but other than that I believe all other entities should work. I've tested this with my Enviro Weather board but since I don't have the other three boards I can't say for sure that those ones will detect.

This could also be improved for the small group of people who change their HASS MQTT discovery term by replacing the checkbox on the setup page with another text entry field and if the text field is empty the code won't fire the HASS discovery publishes. But I'm burned out enough as it is so a checkbox will have to do.

image Here's it in my Home Assistant client to show it's working.

CBDesignS commented 10 months ago

the dashboard looks good. I am strugling to get past an error adding the mqtt manually as HA seems to have changed the way its used. Is there a compiled firmware with discovery enabled or do I have to wait and hope the maintainer can add this pull request into main code and compile it for us ordinary unskilled users..

Adding and configuring this has NOT been fun but its now working so so on 27th Nov 2023.

I will add my mqtt.yaml file snip once I work out how to keep the formatting as is and not get destroyed by the editor (indents are the bane of my life)

a look at the weather dashboard:- screen

mqtt.yaml.log

Good work andymanic