mchwalisz / home-assistant-senec

SENEC Battery integration for Home Assistant
Apache License 2.0
46 stars 23 forks source link

Senec V4 #45

Open ullrichspace opened 1 year ago

ullrichspace commented 1 year ago

I'm trying to use the integration with a Senec V4, however I can even get a connection to the devices. I keep receiving failed to connect to device. Any idea if it is working with a Senec v4? Thanks

marq24 commented 1 year ago

[EDIT] A initial working HA Integration supporting SENEC.Home V4 Sytems has been released (as BETA) - the update procedure is described here - https://github.com/marq24/ha-senec-v3/issues/14 - big thank you to @mstuettgen!

[ORIGINAL] If you know, to observer the Network traffic of your browser (via the 'Network' Tab after pressing F12) - then you can open the Original WebFrontend of your SenecV4 (just typing the http:\YOUR-LOCAL-IP-OF-SENECV4\ and check, if this frontend generates POST requests to the 'lala.cgi'...

If this is the case you might like to share here some examples of the POST-Payload the WebFrontend generates... IF there are no requests to a 'lala.cgi' then there is no quick solution - since then the interface to the senec has to be adopted (and that's probably require a local SenecV4)

ullrichspace commented 1 year ago

Well if I go to the Senec V4 IP it stays blank. However if I go to Senec-V4-IP/Lala.cgi I get the attached screenshot. Still blank, but seems like it is missing just some login information. Screenshot 2023-06-30 174748

marq24 commented 1 year ago

it's difficult to say (from remote) what is happening locally on your device - can be that requesting "something" different den index.html will cause a redirect? In any case looks like that your V4 does not react like my V3 here - Since I am really courious - can you open/call

http://SENEC-IP-HERE/display.html

?

ullrichspace commented 1 year ago

Well I gives me back a blank page. Screenshot 2023-06-30 182319

ullrichspace commented 1 year ago

Where are you located? Germany?

marq24 commented 1 year ago

yes - I am located in Germany - in the Gütersloh area - at least that's what my public git profile should tell you ;-)

so for me it really looks like the V4 is running an updated webserver - the V3 here is using jQuery v3.2.1 - from the screenshots it looks like your is running somehing different - if this is 253 is really the ip of your senec (you might like to double check that with the IP displayed on the physical display of the device)

ullrichspace commented 1 year ago

Ah dann auf deutsch. Ja ist .253 und der senec v4 hat kein Display mehr. Ip kommt direkt aus dem Router. Gütersloh ist dann doch ein wenig weit bis Frankfurt a. M. Ich schau mal die Tage was ich noch finde. Schönen Abend

Matthias Marquardt @.***> schrieb am Fr., 30. Juni 2023, 19:09:

yes - I am located in Germany - in the Gütersloh area - at least that's what my public git profile should tell you ;-)

so for me it really looks like the V4 is running an updated webserver - the V3 here is using jQuery v3.2.1 - from the screenshots it looks like your is running somehing different - if this is 253 is really the ip of your senec (you might like to double check that with the IP displayed on the physical display of the device)

— Reply to this email directly, view it on GitHub https://github.com/mchwalisz/home-assistant-senec/issues/45#issuecomment-1614939365, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6JGGMYQR267SFFXVN5PBYDXN4B4HANCNFSM6AAAAAAZZ2VQ5I . You are receiving this because you authored the thread.Message ID: @.***>

Ich-h4lt commented 1 year ago

Hi Zusammen, Ich bin auch stolzer Besitzer eines V4 ("Home 4" ist die offizielle Bezeichnung) und habe mich auch schon versucht irgendwas aus der Kiste rauszulesen. Das einzige brauchbare was ich bis jetzt rausgefunden habe ist, dass die Kiste mittels MQTT over TLS nach hause spricht. Lokal ist auf dem gerät außer blank pages und ein bisschen java script leider nix zu finden. Unterstütze hier sehr gerne. Grüße!

ullrichspace commented 1 year ago

Leider bin ich noch nicht viel weiter. Angeblich geht alles nur noch über das Portal, wo Anwender leider einen eher bescheidene Information erhalten. Allerdings liefert der SENEC auf detaillierte Daten, die kann aber nur der Service /Installateur sehen. Telnet per IP port 6666 geht und man landet auf dem Gerät. Allerdings in ein Oberfläche von Apache Felix go. Für mehr hatte ich noch keine Zeit.

Am Fr., 14. Juli 2023 um 13:27 Uhr schrieb Ich-h4lt < @.***>:

Hi Zusammen, Ich bin auch stolzer Besitzer eines V4 und habe mich auch schon versucht irgendwas aus der Kiste rauszulesen. Das einzige brauchbare was ich bis jetzt rausgefunden habe ist, dass die Kiste mittels MQTT over TLS nach hause spricht. Lokal ist auf dem gerät außer blank pages und ein bisschen java script leider nix zu finden. Unterstütze hier sehr gerne. Grüße!

— Reply to this email directly, view it on GitHub https://github.com/mchwalisz/home-assistant-senec/issues/45#issuecomment-1635724831, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6JGGM2E46VUBWNNDHYWHLTXQEUKRANCNFSM6AAAAAAZZ2VQ5I . You are receiving this because you authored the thread.Message ID: @.***>

mstuettgen commented 1 year ago

Hey everyone, I also own a Senec V4 since one hour and I am very dissappointed that the integration does not work. I would like to contribute if there is someone who can point me into the right direction.

I successfully connected with Telnet to port 6666. What are we looking for and which information do we need to get out from there?

marq24 commented 1 year ago

IMHO (who ever cares) it does not make much sense to try to use this (or any fork) as source for a Senec V4 HA integration - If there is no lala.cgi that can be requested then also the current response parser is more or less useless...

So with other words a enthusiastic V4 owner have to reverse engineer the existing web-frontend (if there is any - I still did not understood what ullichspace have said about the "Apache Felix go" FE... What you need to understand is, the request & response object the site is exchanging (typically JSON). Once you are able to fetch such a JSON (e.g. via wget) you can start writing a own/separate integration.

So the hard work is: finding the JSON data and the relation to the display in the GUI - once you know which "human-readable"-values comes from which JSON object(s) you are almost "done" - The principle of a HA integration (like this one) is to frequently request the JSON, parse it to HA Entities - that's it - no black magic (once you started to pick up that there are many different ways in python and HA in general to make web requests)...

Just again - this Senec V3 integration is working based on the availability from data from the lala.cgi... V4 does not provide this... You purchased a different Product from Senec - incompatible with the older generation hardware.

I agree, that it would save V4 owners a lot of time, if the documentation of this repo could be adjusted so that it's clear, that it will not work for V4 (so not everyone has to learn this on the hard way)...

You might like to check, if your build in inverter hardware (inside the Senec V4) has additional LAN connectors - they might serve alternative FE's...

mstuettgen commented 1 year ago

Thanks for the quick reply!

Instead of doing all this reverse engineering .... would it make sense to write an "integration" that just logs into the webportal of Senec and grabs the informations from there and provides it as sensor data to HA ?

Ich-h4lt commented 1 year ago

There is already a documentation for the Senec web api which can be found here:

https://documenter.getpostman.com/view/10329335/UVCB9ihW

I totally understand that it may not make sense to use the lala.cgi ha Plugin as the v4 still do not have any kind of webinterface.

Hopefully this will be released in the future by Senec so we can build a new connector, may in another GitHub project. At least we found here a group of people who are interested in.

pulling the data from the public Senec servers will not be reliable in my eyes as this service is not continues available (manly in the evening I am experiencing downtime’s)

So lets wait and hope for a local web gui where we could retrieve the data.

Regards!

marq24 commented 1 year ago

Of course that can be done/implemented too - with the down side, that the data first goes from your home to the senec servers and then from there you collect it...

PRO(S):

CONS:

... but looking at your GitHub profile - you should have the skills that are required to create such an integration - I also just have started with all this (cause of my new PV & heatpump) this year... YES "HA integration development" have quite a steep learning curve (since of the history of HA there are many (old -> not-so-smart-to-us-them any longer) examples)...

mstuettgen commented 1 year ago

I agree to all the CONS that you listed, but I think it might be better to have SOME solution instead of nothing. Even if I was only able to see all the data from the SENEC App / Homepage in HA without beeing able to change settings would have some benefits, e.g. only "don't turn on washing machine if the battery is empty" etc.... And I could also use those stats for HA Energy-Grid to keep track of power consumption.

So if anyone thinks that a "better-than-nothing" solution could be worth a try, I might spend some time on it.

Anyone got experience in setting up a custom integration? I already read the docs.... was quite overwhelming so I would appreciate hints and tipps.

marq24 commented 1 year ago

@Ich-h4lt - thanks for sharing the postman res... Looking at the JSON content making me to run away FAST... Great mixture of German and English - IMHO classic fail - at least in a hobby project I don't want to deal with such a design quality [please don't get me wrong - obviously this is Senec's epic fail]...

@mstuettgen - you might like to look into my latest commit of my fork (https://github.com/marq24/ha-senec-v3/commit/97d0cb0ace1fec0337dc650fa99da7e6a8a0d197), where I have integrated an additional/different type of communication to the build-in inverters (when wired) to the existing ha-integration... [not sure if this makes things more complicated or not]...

And just for curiosity... have you opened your Senec V4? [I just did this few days ago - and discovered unwired additional LAN connectors...] Of course I do not encourage you to do so - and what ever you do - you do it on your own risk! You might find additional hardware/IP's, that then might respond to http://magic-ip-here/versions.xml ? If they does you can try v3.0.0 of my fork...

mstuettgen commented 1 year ago

@marq24 : Thank you very much! I dismantled the top plate today and also discovered alot of additional connecting ports. There is:

Any tips on whats worth investigating?

Further more, I have just published my first version of "senecweb2mqtt" at https://github.com/mstuettgen/homeassistant-addons/tree/main/senecweb2mqtt and would be happy if some other senec owners could try that out. Its not really worth calling it an addon yet, but it works good for what it is so far!

marq24 commented 1 year ago

I just can guess, that the panel you found is some sort of similar to the "patch-field" build into the v3 (as documented in the install instructions)...

image

There are also very "few" cables plugged in - but in the v3 installation instructions manual theses connectors are explained/documented... The "others" that I found are directly at the inverter cases... [again just guessing - since I did not found a comparable installation-manual for the V4 - that also the v4 is just a case around different independent modules - like each of the batteries (V3 comes with Module A-D - the V4 must have space for a couple of more) ]... If you like we can continue this somewhere else?!

Your senecweb2mqtt looks promising!

merlinste commented 1 year ago

Thank you all! Just commenting to show that I am also interested in a solution. One more thing that I just would like to mention, in case you find something like this: if there is any possibility to manage charging the Senec from the grid (because of dynamic electricity tariff), especially in winter times. The v3 has the workaround “emergency charging” via http request, but it seems that this option is not possible anymore for the v4.

marq24 commented 1 year ago

...the v3 has the workaround “emergency charging” via http request...

in my fork (obviously for v3) I have integrated this as ha-switch... [called 'safety charging' (will also "respect" the limit forced by Senec central servers)]...

klaus1956 commented 1 year ago

...the v3 has the workaround “emergency charging” via http request...

in my fork (obviously for v3) I have integrated this as ha-switch... [called 'safety charging' (will also "respect" the limit forced by Senec central servers)]...

Would that work on the V2.1 too?

marq24 commented 1 year ago

@klaus1956 I "just" own a V3 hybrid duo - to my best knowledge the interface have not been changed (could be that additional fields are present in v3 that does not exist in v2 environments).

I hope you understand, that I can't make any recommendations - all what you do, you do on your personal risk.

You can verify if the default web frontend offers a "Vollaldung"/"Entladen freigeben" in the Setup->Wartung section.

mstuettgen commented 1 year ago

@marq24

]... If you like we can continue this somewhere else?!

Yes that would be great! Maybe discord? You can find my email adress at https://www.maskor.fh-aachen.de/staff/, feel free to contact me, then we can find a platform. I can also provide pictures of all the connections that are available.

Your senecweb2mqtt looks promising!

Thanks! I need to turn this into an addon or a custom integration, then the whole MQTT part could be skipped too, but I fail each time I try one of the official tutorials.... But I see that your integration also uses a dataupdatecoordinator, so I can get inspiration from there.