softwarecrash / Daly2MQTT

ESP8266 Connector to get Daly / XENES / HI-BMS / BullTron BMS Data into MQTT systems
Other
138 stars 30 forks source link

HA Integration doesn´t work anymore #136

Closed Emmpunkt closed 8 months ago

Emmpunkt commented 8 months ago

Is there an existing issue for this?

Used Hardware?

Wemos D1 Mini

What happened?

After updating to 2.10 the ha integration doesn´t work anymore. The switches are shown, but no cellvoltages etc.

The integration did not work (at least for me) properly before, evertime i had to restart homeassistant, i had to do a "/set?ha" again. After a restart/reboot everthing was gone. But now it shows no values, only the switches. Values = "Nicht verfügbar / Not available"

Screenshots / Fotos

Screenshot 2023-11-05 142257

Steps To Reproduce

No response

Version

2.x.x and above

Relevant livejson output

// 20231105142453
// http://192.168.2.152/livejson

{
  "Device": {
    "Name": "Daly2MQTT",
    "IP": "192.168.2.152",
    "ESP_VCC": 3.297,
    "Wifi_RSSI": -81,
    "Relais_Active": false,
    "Relais_Manual": false,
    "sw_version": "2.10.0",
    "Flash_Size": 4194304,
    "Sketch_Size": 440192,
    "Free_Sketch_Space": 3731456
  },
  "Pack": {
    "Voltage": 13.1,
    "Current": 0,
    "Power": 0,
    "SOC": 0.1,
    "Remaining_mAh": 280,
    "Cycles": 12,
    "BMS_Temp": 13,
    "Cell_Temp": 13,
    "cell_hVt": 3.65,
    "cell_lVt": 2.3,
    "High_CellNr": 3,
    "High_CellV": 3.3,
    "Low_CellNr": 1,
    "Low_CellV": 3.29,
    "Cell_Diff": 10,
    "DischargeFET": true,
    "ChargeFET": true,
    "Status": "Stationary",
    "Cells": 4,
    "Heartbeat": 12,
    "Balance_Active": false,
    "Fail_Codes": "SOC Low level 2"
  },
  "CellV": {
    "CellV_1": 3.29,
    "Balance_1": false,
    "CellV_2": 3.294,
    "Balance_2": false,
    "CellV_3": 3.3,
    "Balance_3": false,
    "CellV_4": 3.297,
    "Balance_4": false
  },
  "CellTemp": {
    "Cell_Temp_1": 13,
    "Cell_Temp_2": 13
  }
}

Which BMS is connected?

4s 200A UART

What browsers are you seeing the problem on?

Chrome

Emmpunkt commented 8 months ago

I think i found the main problem. In the naming-scheme for ha is now the device name. Changed from "Cell_Voltage_1" to "xxxxxxxx Cell_Voltage_1". Now there is still the problem that HA "forgets" the device after restart. Is it only in my installation?(Im using a docker container)

softwarecrash commented 8 months ago

with the 2.10 update nothing has changed on the HA function or mqtt. only the basic auth is added and some other smal fixes. so the configuration is changed and you must re enter all your data on the esp, when you enter different data like name or something, HA cannot regonize the new path and you must configure it again. or rename all to the old things

Emmpunkt commented 8 months ago

Yes, i did read it before upgrading. And i reconfigured all my data. Everything was still in my autofill of chrome, so there should no mistake in it. MQTT was still the same, nothing changed (my Node-Red/Grafana still works). Only the name scheme in HA was different...

softwarecrash commented 8 months ago

is see german in your picture, is this language better for you?

Emmpunkt commented 8 months ago

Might be easier for me ;) Also nochmal auf Deutsch: Eigentlich sollten alle Einstellungen wieder so sein wie sie waren, die waren bei mir noch noch im Chrome-Autofill vorhanden. Das ich die Einstellungen neu machen musste, war klar, stand ja da. An den Mqtt Sachen hat sich auch nichts geändert. Alles was ich über Grafana und Node-Red gemacht habe, läuft immer noch. Nur bei HA hat er neue Entitäten angelegt (hab ich erst nicht gesehn). Und auch nur bei den Messwerten, nicht bei den Schaltern. Die Entität hieß vorher z.B: Cell_Voltage_1, nachher dann Daly2MQTT_Cell_Voltage_1. Daly2MQTT ist der Device-Name.

Im Prinzip geht es ja jetzt und wenn mans neu macht fällt es noch nicht einmal auf. Bleibt aber immer noch die Frage warum ich die HA Konfiguration immer wieder mit /set?ha anstossen muss, wenn ich HA neu gestartet habe. Mach ich das nicht weil ichs vergessen habe, sind keine Werte da. Liegt das an meinen Docker-Container? Bei allem anderen was ich im HA habe, ist das aber nicht der Fall...

Edit: Das mit HA-Neustart war vorher schon so und hat nichts mit der aktuellen Version zu tun

softwarecrash commented 8 months ago

okay, also der name sollte da eigentlich nicht sein wenn er vorher da nicht war, ich schau mir das grad noch mal an. ggf nimmt HA aus der mqtt struktur alte config einträge und vermasselt da was.

softwarecrash commented 8 months ago

hab es grad mal probiert, bei mir tauchen diese seltsamheiten nicht auf grafik wie sieht den deine ESP config aus?

Emmpunkt commented 8 months ago

Da steht eigendlich nicht viel drin

image

softwarecrash commented 8 months ago

schau doch mal bitte mit mqttexplorer wie die struktur da aussieht bei dir und mach mal ein paar bilder

Emmpunkt commented 8 months ago

Was genau willst du sehen? image

Ich sehe gerade überall "name", ist das richtig?

softwarecrash commented 8 months ago

das sieht erstmal völlig normal aus, kann da grad kein fehler sehen

softwarecrash commented 8 months ago

das einzige was scheinbar anders ist bei dir jetzt ist das es vorher wohl daly-bms-to-mqtt hies und jetzt daly2mqtt. ggf hilft es wenn du alle DP im mqtt unter homeassistant/sensor und switch löschst, die entitäten dazu auch und dann noch mal neu generieren lässt vom esp

messageexplorer commented 8 months ago

As for me it is still working.

Emmpunkt commented 8 months ago

Ich guck später nochmal... Ist mir gerade noch aufgefallen Pack_Cell_Difference ist in mA anstatt mV image

softwarecrash commented 8 months ago

Ich guck später nochmal... Ist mir gerade noch aufgefallen Pack_Cell_Difference ist in mA anstatt mV image

das hat messageexplorer bereits angemerkt und ist korrigiert, bugfix release dazu folgt später

messageexplorer commented 8 months ago

@Emmpunkt, I can see issue in configuration. Seems you forgot fill MQTT Topic: image

Oh, no... looks like it OK. :( Maybe you can open /set?ha again? Because I saw it only when I updated MQTT Topic, but HA was waiting old one.

softwarecrash commented 8 months ago

@Emmpunkt, I can see issue in configuration. Seems you forgot fill MQTT Topic: image

Oh, no... looks like it OK. :( Maybe you can open /set?ha again? Because I saw it only when I updated MQTT Topic, but HA was waiting old one.

please use only ONE datapoint for the mqtt triggerpath, all other will create a lot of traffic. the trigger path is for things like another esp, when he send data the daly esp is triggered and send his own data asap, so you can get all data at the "same" time

Emmpunkt commented 8 months ago

So ich habs gerade nochmal getestet. In HA alles gelöscht. Im MQTT Explorer gelöscht und im ESP die Config neu schreiben lassen. Oder muss ich ihn komplett neu flashen? Hat jedenfalls nichts gebracht. Nach HA Neustart keine Werte mehr. ̶W̶a̶s̶ ̶i̶s̶t̶ ̶M̶Q̶T̶T̶ ̶D̶a̶t̶a̶ ̶T̶r̶i̶g̶g̶e̶r̶ ̶P̶a̶t̶h̶?̶

Das "daly-bms-to-mqtt" kommt übrigens von meinem Router (Netgear), da heisst er wohl so...

Jarnsen commented 8 months ago

Ich schaue mir das nochmal in der HA MQTT Doku an.

Emmpunkt commented 8 months ago

Ich schaue mir das nochmal in der HA MQTT Doku an.

Da sich niemand anders beschwert, finde ich das schon merkwürdig. Ich habe allerdings nur 2 Geräte über MQTT automatisch konfiguriert. Daly2MQTT und Espresence, daher kann ich nicht wirklich eine Aussage treffen ob meine Installation auch wirklich in Ordnung ist. Alles andere ist Tasmota,Tapo,Shelly,Tuya, Mitsubishi, Emoncms ... die jeweils ne eigene Integration haben Nach /set?ha ist auch alles wieder da. Da ich aber über die Batteriewerte Verbraucher auf 230V umschalten möchte bevor die Batterie leer ist, wäre es schon gut wenn das auch zuverlässig funktionieren würde.

Jarnsen commented 8 months ago

Schreib mir mal auf Discord… es reicht wenn dann hier die Lösung ist…

Emmpunkt commented 8 months ago

Schreib mir mal auf Discord… es reicht wenn dann hier die Lösung ist…

Wenn ich wüsste wie man das macht, hab ich noch nie benutzt....;D

softwarecrash commented 8 months ago

@Emmpunkt discord gehts hier lang alles andere wird dir dann erklärt, einfach in dem solar2mqtt kanal melden, dann ziehen wir dich in ein unterkanal

Emmpunkt commented 8 months ago

Are you closing this Issue?

messageexplorer commented 8 months ago

Hi, I rebooted today Home assistant and Daly2MQTT device was out, did /set?ha and it returned back. Seems in new version messages send without retained flag. As result HA lost configuration after reboot.

I created script to send this messages with retained flag and after HA reboot everithing works fine.

On Wed, 8 Nov 2023, 21:50 Emmpunkt, @.***> wrote:

Are you closing this Issue?

— Reply to this email directly, view it on GitHub https://github.com/softwarecrash/Daly2MQTT/issues/136#issuecomment-1802548735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUERWDTM4ZE6TL2TATTLXHTYDPO63AVCNFSM6AAAAAA66K4AL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBSGU2DQNZTGU . You are receiving this because you commented.Message ID: @.***>

Emmpunkt commented 8 months ago

Hi, I rebooted today Home assistant and Daly2MQTT device was out, did /set?ha and it returned back. Seems in new version messages send without retained flag. As result HA lost configuration after reboot. I created script to send this messages with retained flag and after HA reboot everithing works fine. On Wed, 8 Nov 2023, 21:50 Emmpunkt, @.> wrote: Are you closing this Issue? — Reply to this email directly, view it on GitHub <#136 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUERWDTM4ZE6TL2TATTLXHTYDPO63AVCNFSM6AAAAAA66K4AL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBSGU2DQNZTGU . You are receiving this because you commented.Message ID: @.>

You are talking about Ver.2.10.1?

softwarecrash commented 8 months ago

@messageexplorer pleased try the Last Release, it fixes it with retain flag

softwarecrash commented 8 months ago

fix with last release