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

Senec V4 #45

Open
ullrichspace opened this issue Jun 30, 2023 · 23 comments
Open

Senec V4 #45

ullrichspace opened this issue Jun 30, 2023 · 23 comments

Comments

@ullrichspace
Copy link

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
Copy link

marq24 commented Jun 30, 2023

[EDIT]
A initial working HA Integration supporting SENEC.Home V4 Sytems has been released (as BETA) - the update procedure is described here - marq24#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
Copy link
Author

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
Copy link

marq24 commented Jun 30, 2023

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
Copy link
Author

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

@ullrichspace
Copy link
Author

Where are you located? Germany?

@marq24
Copy link

marq24 commented Jun 30, 2023

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
Copy link
Author

ullrichspace commented Jun 30, 2023 via email

@Ich-h4lt
Copy link

Ich-h4lt commented Jul 14, 2023

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
Copy link
Author

ullrichspace commented Jul 14, 2023 via email

@mstuettgen
Copy link

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
Copy link

marq24 commented Aug 17, 2023

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
Copy link

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
Copy link

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
Copy link

marq24 commented Aug 17, 2023

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):

  • It will work with the current V2, V3 AND V4 hardware...

CONS:

  • only the data Senec web frontend is willing to show is available to HA
  • Update frequency not adjustable [I'll read the data every 2 seconds]
  • You rely on an additional external service (Senec Servers)
  • No option to adjust/set values via HA to your senec (it will be just one-way - might be not so important right now - cause the options are anyhow very limited)

... 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
Copy link

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
Copy link

marq24 commented Aug 19, 2023

@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 (marq24@97d0cb0), 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
Copy link

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

  • EPS (?)
  • CAN X
  • WB (Wibutler?)
  • RS-1
  • RS-2
  • RS-3
  • PM/GSB CSC-OUT
  • GPP-QD

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
Copy link

marq24 commented Aug 26, 2023

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
Copy link

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
Copy link

marq24 commented Aug 26, 2023

...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
Copy link

...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
Copy link

marq24 commented Aug 26, 2023

@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
Copy link

mstuettgen commented Aug 26, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants