Closed FrancineMatos closed 4 months ago
Another improvment, now it's return the device class and the unit of measurement of the components by Home Assistant MQTT Discovery so the sensor is correctly registred.
Was necessary to change a bit the data structure but i dont think that it can do something bad
Some changes in DataLogger.py and RoverClient.py
Instead of the zip file can you create a PR against branch mqtt-discovery?
I'm not famillyar with githut plataform but i cant try. I ll find some tutorial teaching how to do it.
Instead of the zip file can you create a PR against branch mqtt-discovery?
Ok, i think i did it, my first time using github to update a repository but i guess i did it rigth.
Ah ok. Thanks for the PR, I bet you learned a thing or two today. 😊
I've added the MQTT Discovery function that auto create the components in Home Assistant.
1 - We need to add this to DataLogger.py (for some reason i cant paste the code here it's broke the editor)![image](https://github.com/cyrils/renogy-bt/assets/148077119/af3e7fff-7662-4485-9a3b-af53786251ea)
2 - some changes need to be done on log_mqtt function still in DataLogger.py![image](https://github.com/cyrils/renogy-bt/assets/148077119/94b65c60-9dbe-47bd-92df-66bedc4de98f)
3 - We need to create the call for the new function on example.py or whathever you are using to start the renogy![image](https://github.com/cyrils/renogy-bt/assets/148077119/33fecd98-d0b6-4265-afb0-6b4046900c1b)
4 - We neet to indicate in the config.ini the instance name of our home assistant![image](https://github.com/cyrils/renogy-bt/assets/148077119/af0d5018-2173-4539-b7ed-d125cac660ea)
A video fo the thing working: https://github.com/cyrils/renogy-bt/assets/148077119/13f61b24-5d9e-4b15-a75d-4f838eb8766e
Files.zip