Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple EMS-ESP's in HA #1196

Closed
proddy opened this issue Jun 24, 2023 Discussed in #1195 · 22 comments
Closed

Support multiple EMS-ESP's in HA #1196

proddy opened this issue Jun 24, 2023 Discussed in #1195 · 22 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@proddy
Copy link
Contributor

proddy commented Jun 24, 2023

Discussed in #1195

Originally posted by g6094199 June 23, 2023
Hi,

i have to ems-esp (with different names an different heating systems) in the network and try to connect them to 1 HA instance.
i can see both ems in the mosquitto broker and they update nicely but HA seems to get fucked up. i see a mixture of settings ob both ems in the HA mqtt plugin.

so is there something wrong. has this ever been tested? is this a ems or HA problem? or both in combination?

sash

@g6094199

@proddy proddy added the enhancement New feature or request label Jun 24, 2023
@proddy proddy added this to the v3.6.0 milestone Jun 24, 2023
@proddy proddy self-assigned this Jun 24, 2023
@proddy
Copy link
Contributor Author

proddy commented Jun 24, 2023

I'll see if changing ids in the device entry for HA's discovery topic helps here

  "dev": {
    "ids": [
      "ems-esp32"
    ]

proddy added a commit to proddy/EMS-ESP32 that referenced this issue Jun 24, 2023
@proddy
Copy link
Contributor Author

proddy commented Jun 24, 2023

Ok implemented this and will continue testing. Then will merge into the dev build.

@g6094199
Copy link

plz report when there is a testable beta :-)

@proddy proddy closed this as completed Jun 27, 2023
@proddy
Copy link
Contributor Author

proddy commented Jul 3, 2023

@g6094199 you can pick up the build & firmware with this fix at https://github.com/emsesp/EMS-ESP32/releases/tag/test

@g6094199
Copy link

g6094199 commented Jul 4, 2023

hi

i think we are almost there...

i flashed both units. one gets displayed as indendet (junkers-heatronic-wdb) but the other gets displayed as "unknown" (should be buderus-heatronic-da)). btw vendor should be prody, in any case.

image

.

@proddy
Copy link
Contributor Author

proddy commented Jul 4, 2023

Strange, I'll see if I can reproduce. Do make sure you remove all the MQTT before flashing, either from within HA or using something like MQTTExplorer

@proddy proddy reopened this Jul 4, 2023
@g6094199
Copy link

g6094199 commented Jul 4, 2023

in mosquitto i see:

image

@proddy
Copy link
Contributor Author

proddy commented Jul 4, 2023

It looks like you're missing the main device called 'junkers-heatronic-wdb' in HA.

Can you use MQTTExplorer and show me the payload for the topic homeassistant/binary_sensor/junkers-heatronic-wdb/system_status/config.

If that doesn't exist find the topic with the word proddy in it, using the search.

If also may be good to check the HA logs.

@g6094199
Copy link

g6094199 commented Jul 5, 2023

{"uniq_id":"system_status","obj_id":"system_status","stat_t":"junkers-heatronic-wdb/status","name":"EMS-ESP status","pl_on":"online","pl_off":"offline","stat_cla":"measurement","dev_cla":"connectivity","ent_cat":"diagnostic","dev":{"name":"junkers-heatronic-wdb","sw":"v3.6.0-dev.13b","mf":"proddy","mdl":"EMS-ESP","cu":"http://192.168.1.144","ids":["junkers-heatronic-wdb"]}}

@proddy
Copy link
Contributor Author

proddy commented Jul 6, 2023

Sorry, can't reproduce. If I use junkers-heatronic-wdb as a MQTT base it adds the EMS-ESP system device correctly. I would need to see the system settings for both EMS-ESP devices to recreate your environment and see what is happening.

Did the HA logs tell you anything?

@proddy proddy closed this as completed Jul 10, 2023
@g6094199
Copy link

g6094199 commented Jul 12, 2023

2023-07-12 21:50:47.911 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on buderus-heatronic-da/boiler_data_ww (qos=0): b'{"wwsettemp":10,"wwseltemp":55,"wwtype":"Speicher","wwcomfort":"Hei\xc3\x9f","wwflowtempoffset":40,"wwcircpump":"an","wwchargetype":"3-Wege Ventil","wwhyston":-5,"wwhystoff":0,"wwdisinfectiontemp":60,"wwcircmode":"1x3min","wwcirc":"aus","wwcurtemp":31.5,"wwcurtemp2":31.5,"wwcurflow":0.0,"wwstoragetemp2":31.5,"wwactivated":"an","wwonetime":"aus","wwdisinfecting":"aus","wwcharging":"aus","wwrecharging":"aus","wwtempok":"aus","wwactive":"aus","ww3wayvalve":"aus","wwstarts":2934,"wwworkm":80786.0}' 2023-07-12 21:50:47.912 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '{"wwsettemp":10,"wwseltemp":55,"wwtype":"Speicher","wwcomfort":"Heiß","wwflowtempoffset":40,"wwcircpump":"an","wwchargetype":"3-Wege Ventil","wwhyston":-5,"wwhystoff":0,"wwdisinfectiontemp":60,"wwcircmode":"1x3min","wwcirc":"aus","wwcurtemp":31.5,"wwcurtemp2":31.5,"wwcurflow":0.0,"wwstoragetemp2":31.5,"wwactivated":"an","wwonetime":"aus","wwdisinfecting":"aus","wwcharging":"aus","wwrecharging":"aus","wwtempok":"aus","wwactive":"aus","ww3wayvalve":"aus","wwstarts":2934,"wwworkm":80786.0}' with variables {'entity_id': 'sensor.boiler_dhw_storage_extern_temperature', 'name': 'WW Externer Speichertemperatur', 'this': <template TemplateStateFromEntityId(sensor.boiler_dhw_storage_extern_temperature)>} and Template<template=({{'online' if value_json.wwstoragetemp2 is defined else 'offline'}}) renders=91> 2023-07-12 21:50:47.913 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '{"wwsettemp":10,"wwseltemp":55,"wwtype":"Speicher","wwcomfort":"Heiß","wwflowtempoffset":40,"wwcircpump":"an","wwchargetype":"3-Wege Ventil","wwhyston":-5,"wwhystoff":0,"wwdisinfectiontemp":60,"wwcircmode":"1x3min","wwcirc":"aus","wwcurtemp":31.5,"wwcurtemp2":31.5,"wwcurflow":0.0,"wwstoragetemp2":31.5,"wwactivated":"an","wwonetime":"aus","wwdisinfecting":"aus","wwcharging":"aus","wwrecharging":"aus","wwtempok":"aus","wwactive":"aus","ww3wayvalve":"aus","wwstarts":2934,"wwworkm":80786.0}' with variables {'entity_id': 'sensor.boiler_dhw_storage_extern_temperature', 'name': 'WW Externer Speichertemperatur', 'this': <template TemplateStateFromEntityId(sensor.boiler_dhw_storage_extern_temperature)>} with default value 'default' and Template<template=({{value_json.wwstoragetemp2 if value_json.wwstoragetemp2 is defined else 0}}) renders=91> .......

but the unit buderus-heatronic-da doesnt show in HA.

image

but the units "kesseltemperatur" and "temperatursensor 1" seems to be part of buderus-heatronic-da (temp values match with the visible temperatures at the unit").

@proddy
Copy link
Contributor Author

proddy commented Jul 13, 2023

sorry what is the kesseltemperatur ? Is that coming from EMS-ESP?

@proddy proddy reopened this Jul 13, 2023
@g6094199
Copy link

g6094199 commented Jul 13, 2023

"kesseltemperatur" is german for boiler temperature.

image

it must come from ems cause where should it alternativly come from? there are no not EMS devices in the network.

the "temperatursensor 1" has many WW entries and seems to hold the rest of the stuff.

image

also it seems we have also some sort of instability with ems. both units crash after some hours. since both devices are in different wifi networks with at least 20db snr its no wifi problem.

@proddy
Copy link
Contributor Author

proddy commented Jul 14, 2023

I still think it's old retained messages in your MQTT Broker, that need to be removed manually. As I mentioned earlier:

"Do make sure you remove all the MQTT before flashing, either from within HA or using something like MQTTExplorer"

@proddy proddy closed this as completed Jul 14, 2023
@g6094199
Copy link

missed that info.....will try and report back

@g6094199
Copy link

nope. there is still something wrong,

i did:
-unpowered both ems-esp units
-removed EVERY (also under HA topic) topic on mosquitto regardin one of the units.
-removed both units in HA
-rebootet HA
-powered buderus-heatronic-da only
-only buderus-heatronic-da showed up in HA (

  • buderus-heatronic-da
  • buderus-heatronic-da Thermostat
  • buderus-heatronic-da Boiler
    )
    -set up the unit in HA

everything fine so far.

but then:

-powerded junkers-heatronic-wdb

and instantly HA gets scrambled like so :

image

mqtt-ae1d8fb3e7846b8056f3cc976520beae-buderus-heatronic-da Thermostat-6a5ba23b82f457dd306a7ca52cce2e38.json.txt

@proddy
Copy link
Contributor Author

proddy commented Jul 15, 2023

Ok, that's not good. Thanks for taking the time to remove everything and test it again.

I'll need reproduce your setup to see what is happening. Can you send me the config for both EMS-ESPs please? This is the JSON output from http://<the DNS or IP address>/api/system. Don't worry, no passwords are saved in this file. Then I'll test today and try and see what is happening.

@proddy proddy reopened this Jul 15, 2023
@g6094199
Copy link

@MichaelDvP
Copy link
Contributor

"entity_format": 0, makes the uniqu_id identical, because it does not contain the base. You need set to multiple.

@proddy
Copy link
Contributor Author

proddy commented Jul 15, 2023

"entity_format": 0, makes the uniqu_id identical, because it does not contain the base. You need set to multiple.

I think that's it! I was just about to configure 2 EMS-ESPs and test but believe this is the problem.

@g6094199 in MQTT settings set the Discovery setting to 'Multiple Instances'

@g6094199
Copy link

ok,didnt know about this setting...

both ems are now set to "Multiple Instances, short name" and it seems to show correctly.

image

@proddy
Copy link
Contributor Author

proddy commented Jul 15, 2023

fantastic!

We'll update the documentation with 3.6.0 is released.

Enjoy the free software! :)

@proddy proddy closed this as completed Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants