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

Add Zendure #17149

Merged
merged 13 commits into from
Nov 9, 2024
Merged

Add Zendure #17149

merged 13 commits into from
Nov 9, 2024

Conversation

andig
Copy link
Member

@andig andig commented Nov 9, 2024

Fix #14797

Note that battery control is not supported. A local api is announced for 2025, we'll revisit then.

@andig andig added the devices Specific device support label Nov 9, 2024
@andig andig merged commit 189a3cf into master Nov 9, 2024
6 checks passed
@andig andig deleted the feat/zendure branch November 9, 2024 11:30
@Raudi1
Copy link
Contributor

Raudi1 commented Nov 10, 2024

This doesn't work if the global server is used which many advanced users even in Europe have chosen since it's supposedly more stable and offers newer devices faster etc.
For the global server the URL to get the credentials is:
https://app.zendure.tech/v2/developer/api/apply
So another optional parameter for the server is needed.
And a Hyper V is mentioned. That's not a Zendure product I know of. The Hyper 2000 is a bi-directional home battery+PV system and the Superbase V is a power station.

@andig
Copy link
Member Author

andig commented Nov 10, 2024

Thank you, will update asap.

@Raudi1
Copy link
Contributor

Raudi1 commented Nov 10, 2024

I'm preparing a pull request for the template with some additional examples etc. right now.

@linuxstony
Copy link

linuxstony commented Nov 12, 2024

First off all a HUGE THANK YOU ! To y'all for trying your damn hardest to implement the wishes of the users - you all have my deepest respect. (As I had a peek into the code there was no way in hell i could have accomplished this)

I don't want to be a PIA, but the current "Bad Request error" I get while trying to configure is related to the fact, that currently the EU server is used in general and not the global one - correct?

Error is:
cannot create meter type 'template': cannot create meter type 'zendure': unexpected status: 400 (Bad Request)
regardless if I use the username or the email i registered with.

@andig
Copy link
Member Author

andig commented Nov 12, 2024

Probably. Waiting for @Raudi1 if he wants to grab it.

@Raudi1
Copy link
Contributor

Raudi1 commented Nov 12, 2024

Probably. Waiting for @Raudi1 if he wants to grab it.

I already did the pull request. But only for the template. I could probably figure the rest out, but it would probably take me a couple of hours at least since I'd have to set up a dev environment and take a good look at all the code first and then do it wrong a couple of times before I get it right. I don't have the time for that right now since I'm a dentist with my own practice. The last quarter is always the most busy.

@Raudi1
Copy link
Contributor

Raudi1 commented Nov 17, 2024

I still can't add my Zendure device even with the correct server. When I try to validate it, I get the error
cannot create meter type 'template': cannot create meter type 'zendure': unexpected status: 400 (Bad Request)
Oddly enough I can't find anything in the logs even with the level set to trace.

@andig
Copy link
Member Author

andig commented Nov 18, 2024

I can confirm that the global login doesn't work. EU works find. Maybe the device can only be setup in the matching region?

@andig
Copy link
Member Author

andig commented Nov 18, 2024

Oddly enough I can't find anything in the logs even with the level set to trace.

Working find for me.

@linuxstony
Copy link

linuxstony commented Nov 18, 2024

Normally the device should be found on the corresponding server where the Hyper is connected to - either the global or the EU. Hence the different URLS. It should not make any difference - the response from the server should be the same.

I will try to remove the server on the global one and switch over to the European to see if that works.

Oddly enough I still find MQTT entries from my former tries to get the Hyper connected in my logs although it is not configured in the Yaml or the GUI.

[mqtt ] TRACE 2024/11/18 19:19:31 recv XXXXXXXX/XXXXXXX/state: '{"sn":"XXXXXHYMCFM230063","remainOutTime":398}'

I thought maybe that was my problem that entries are double, but I am not able to remove it at the moment.

@Raudi1
Copy link
Contributor

Raudi1 commented Nov 18, 2024

I can confirm that the global login doesn't work. EU works find. Maybe the device can only be setup in the matching region?

I have the official MQTT and the ioBroker adapter working. If I use the manual method with
curl -i -v --json "{'snNumber': 'HubSeriennummer', 'account': 'Emailadresse'}" https://app.zendure.tech/v2/developer/api/apply
I get the correct response:
{"code":200,"success":true,"data":{"appKey":"xxxxxxx","secret":"xxxxxxxxxxxxxxx","mqttUrl":"mqtt.zen-iot.com","port":1883},"msg":"Operation successful"}* Connection #0 to host app.zendure.tech left intact

edit: I just set up a testing instance and was able to get the trace log. It still tries to use the EU server, even if I select global in the dropdown:
[zendure] TRACE 2024/11/18 21:07:18 POST https://app.zendure.tech/eu/developer/api/apply
So it's just a small bug in the code. I took a look through it, but I couldn't find anything obvious. But then again, I'm no developer.

@linuxstony
Copy link

Sorry - i could have caught that bug - but I didnt - I can confirm this find.

[zendure] TRACE 2024/11/18 22:02:01 POST https://app.zendure.tech/eu/developer/api/apply

@andig
Copy link
Member Author

andig commented Nov 19, 2024

Ah, region was missing from the template, fixed!

@linuxstony
Copy link

linuxstony commented Nov 19, 2024

Fix works - i was able to add the battery with the nightly build. (I dont use the Hyper as inverter) Thanks @andig!

However @Raudi1 can you confirm that when the Hyper is discharging it is shown as "Batterie laden" instead of "Batterie entladen"?

OutputHomePower should be the value discharging (as in Battery-Output-to-Home-Power)
GridInputPower for charging the battery (as in Grid-to-Battery-Input-Power)

Please correct me if I am wrong.

@Raudi1
Copy link
Contributor

Raudi1 commented Nov 21, 2024

However @Raudi1 can you confirm that when the Hyper is discharging it is shown as "Batterie laden" instead of "Batterie entladen"?
I will test it next release. Might even add a second Hyper. They just went down a lot. Only around 900€ for the Hyper with 1.92kWh or 2325€ for the Hyper with 7.68kWh and 2 solar panels.

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

Successfully merging this pull request may close these issues.

Add support for Zendure batteries and inverters
3 participants