custom-components / zaptec

zaptec charger custom component for home assistant
MIT License
67 stars 20 forks source link

Support for setting cable lock #102

Closed FluGanz closed 1 month ago

FluGanz commented 6 months ago

I would love if there was a switch to lock or unlock the cable

sveinse commented 6 months ago

There is no official API for setting the cable lock unfortunately. If we want it bad, we could reverse engineer the Zaptec portal web application. However, since this is undocumented, it's impossible for us to guarantee that the function will stay working.

FluGanz commented 6 months ago

Would be awesome if you could work it out, because there is alot of stealing cables in my area so it yould be nice to integrate cable lock with the alarm

isakrubin commented 2 months ago

same

sveinse commented 2 months ago

You could start by contacting Zaptec and ask for a mechanism for setting the cable lock from the Zaptec API. That would be a lot better way of fixing it than trying to hack something together that isn't officially supported.

c0mplex1 commented 1 month ago

I thought let's try contacting Zaptec support and ask if they have a solution for the cable lock function via the API. This was my question:

Hi,

Please add a mechanism for setting the cable lock from the Zaptec API (not only in the Zaptec app or Zaptec Portal), because there is a lot of stealing cables in my area, so it would be nice to integrate cable lock. Thank you.

Kind regards, Frank.

and received this answer:

Hi Frank,

Thanks for your message. It's possible to activate the permanent cable lock function via the API: https://zaptec.objects.frb.io/assets/PDFs/Integrating-with-Zaptec-charging-systems.pdf Does this helpt with your case?

Best regards, Wouter Francken Zaptec

sveinse commented 1 month ago

Thank you. I've read through the PDF, but unfortunately it does not give any guidance on how to configure the PermanentCableLock state 😢 . It mentions that it support unlocking keys (not completely sure what that means) when using OCPP. However, the Zaptec integration is not using OCPP. Nor do I think the integration should meddle with it, because there are several users that are using the Zaptec integration with chargers that is shared among several users and with payment systems attached.

c0mplex1 commented 1 month ago

Should I answer the mail from Zaptec support and if so, what should I ask? I am not a programmer or familiar with API structure.

sveinse commented 1 month ago

I'd say something like "The information provided unfortunately does not contain any information on how to change the PermanentCableLock state from the API. I'd like information on how to do that from an API call please."

c0mplex1 commented 1 month ago

I have received an answer from Zaptec.

Hi Frank,

Thank you, just checked and this is not available at this time but I created a request for this on our roadmap. I cannot say at what time this will be developed, but it's on our roadmap. Currently this function is only available via the portal or via the app.

Best regards, Wouter Francken

sveinse commented 1 month ago

A fix for the issue have been pushed to master. Please install the "master" version and test if this fixes the observed problems. @FluGanz @c0mplex1

FluGanz commented 1 month ago

Can't find the "master" version, can only find 0.7.1

sveinse commented 1 month ago

It seems HACS have removed the ability to download master. I'll see what I can do.

sveinse commented 1 month ago

I've created a beta/pre-release "0.7.2b1" available for download and test.

FluGanz commented 1 month ago

Tried the function and it works like a charm 👌🏻 Will make some automations and try it out 😃

c0mplex1 commented 1 month ago

I added the feature to my automation and it works as expected.