diyBMSv4ESP32 icon indicating copy to clipboard operation
diyBMSv4ESP32 copied to clipboard

MQTT compatibility with HomeAssistant

Open vajpeters opened this issue 3 years ago • 9 comments

Since HomeAssistant is getting a defacto standard, it would be nice to create a MQTT compatibility mode with HomeAssistant.

vajpeters avatar Jul 10 '21 18:07 vajpeters

What's needed to make it work?

stuartpittaway avatar Jul 10 '21 21:07 stuartpittaway

It's pretty well documented here: https://www.home-assistant.io/docs/mqtt/discovery/ Mainly it's about naming and structure conventions. Would this be possible?

vajpeters avatar Jul 10 '21 21:07 vajpeters

Just another vote for adding the necessary auto-discovery topics. This would make it incredibly easy to incorporate a diyBMS battery into Home Assistant's new Energy platform.

shampeon avatar Sep 11 '21 18:09 shampeon

A battery or BMS doesn't appear to be in the list of supported discoverable devices. Is the document out of date?

stuartpittaway avatar Sep 11 '21 19:09 stuartpittaway

They would be sensor devices, where you set the class and unit, etc.

For example, this is the discovery topic for one of the sensors from an MPP Solar inverter.

homeassistant/sensor/Inverter_100177/Battery_voltage/config {
            "name": "Battery_voltage_Inverter",
            "uniq_id": "100177_Battery_voltage",
            "device": { "ids": "100177", "mf": "MPPSolar", "mdl": "PIP3048LV-MK", "name": "Inverter", "sw": "61.01"},
            "state_topic": "homeassistant/sensor/Inverter_100177/Battery_voltage",
            "state_class": "measurement",
            "unit_of_meas": "V",
            "icon": "mdi:battery-outline"
        }

shampeon avatar Sep 11 '21 19:09 shampeon

+1 for this, I would look into adding a esphome component (a custom one for starters) instead of using mqtt directly.

Have a look at the Daly BMS component for inspiration: https://github.com/esphome/esphome/tree/dev/esphome/components/daly_bms

natiz avatar Dec 28 '21 22:12 natiz

+1 on this, maybe someone is able to add this :)

Linusten avatar May 30 '23 21:05 Linusten

+1

schmue81 avatar Aug 18 '23 07:08 schmue81

It's in the pipeline!

stuartpittaway avatar Aug 18 '23 10:08 stuartpittaway