emsesp / EMS-ESP

ESP8266 firmware to read and control EMS and Heatronic compatible equipment such as boilers, thermostats, solar modules, and heat pumps
https://emsesp.github.io/docs
GNU Lesser General Public License v3.0
305 stars 97 forks source link

Fix issues with HA: no hypens in names, ensure dallas sensors stay unique, add group name #742

Closed FauthD closed 3 years ago

FauthD commented 3 years ago

Hi Guys, this is to discuss what needs to be adjusted for HA. Reference Issue: Auto discovery fro Home Assistant is not consistent for Dallas sensors #700

I added a new sensor format: HA_UNIQUE

{"D28a81378060000":34.6,"D28f84277060000":50.8}

That ensures there will be no mixups if sensors are added, removed, or replaced (in case of defect). In HA you can easily assign nice names in the customize section to the unique sensor names.

I also added group (or dev) names to avoid that HA uses the very first sensor name for the group of sensors (I have 9). (also manufacturer and model).

For now I did keep the unique_ID to use the sensor ID with hyphens as it used to be. That place seems to make no trouble with HA. (perhaps we should remove the hyphens there as well, just in case...) These changes run fine since a few days here.

Currently it is a breaking change. We could either use conditional compile to generate the old behavior (#ifdef HA_LEGACY), or we could add this third format to the web interface. I do not know how many HA users are there. What do you think?

Many regards, Dieter Fauth

proddy commented 3 years ago

see https://github.com/proddy/EMS-ESP/issues/700#issuecomment-796684094

is this PR still neeed?

FauthD commented 3 years ago

Some changes are superfluous by now.