Closed retifrav closed 3 weeks ago
Thank you for the proposal.
The primary purpose of the Zaptec integration is to provide an interface to the Zaptec EVC. Zaptec sense is an AMS-HAN energy measurement, and I for my part does not have any plans on adding it to the current integration. Contributions through pull requests are welcome.
However, I'm a little uncertain if it should be included. Doing AMS-HAN data is somewhat different ballgame than EV charging and it would increase the scope for the integration. There exists other AMS-HAN implementation such as https://github.com/toreamun/amshan-homeassistant. It maybe worth checking if they have plans for integrating the Zaptec Sense device.
The HAN port delivers data every 2-10 seconds and once every hour. This is much more frequent that the current poll-rate of the Zaptec integration. Do you know if there are ways to subscribe to energy events instead of polling? It also worries me a little bit that the API is not documented. Does this imply that the API is not meant to be used by 3rd-party and can change at any moment?
These are good points, and I agree that such a feature would be something outside of the current scope.
I'll try to reach out to Zaptec support to check whether this API is at all meant to be used by 3rd-party, and if so, then does it have different quota/rates or what's the recommendation there. Also, being a device connected to the local network, hopefully it also exposes some local API, so it doesn't have to go through Zaptec servers. And yes, would be great if it also published data via MQTT or something.
Got a reply from Zaptec support (took them long enough to answer):
We do not have any documented and supported way of extracting metering values. Rate limits are not currently enforced for this endpoint, but will at some point. The ones that we do have documented in Swagger (https://api.zaptec.com/help/index.html) is the ones that should be used externally as of now
In other words:
So I have a ~1500 NOK device that occupies the HAN-port and does not let me use the data it collects from my electricity meter :) I guess I better get a proper (Zigbee-enabled) HAN-meter and use it in parallel with Zaptec Sense via RJ45 splitter.
This feature request can probably be closed then. It was out of scope in the first place, and even if it was implemented at some point, those potential polling rate limits would likely make it not very useful.
I might have missed something, but looks like data from Zaptec Sense isn't fetched at the moment, so this is a feature request then :)
Zaptec Sense is a module that is connected to the HAN port (a diagnostic port in a form-factor of RJ45) on the household electricity meter. Its main purpose is to read the current household power consumption and control the car charger so it wouldn't exceed a specified total power bracket.
I am mostly interested in fetching power consumption metrics, such as current household power consumption.
In Zaptec API this data is available from
https://api.zaptec.com/api/installation/{id}/energySensorData
, which doesn't seem to be documented (theenergySensorData
part). For example, a query like this (extracted from my browser console):returns a JSON response like this (truncated, otherwise it's too long):
So it's the
TotalEnergy
andReadings
metrics that I would be interested in, probably just the latest values. The reason why it returns series is because it has the following visualization in the user portal:You can see that the latest
TotalEnergy
value0.6650176952700221
became0.67
on the blue chart. And the orange line is theReadings
values. Of course, Home Assistant will have its own visualization, so there is no need to query for such a long series, this is just an illustration how the data is used by Zaptec Portal.I can for sure help you with providing more data and/or testing beta versions with my Zaptec Sense (as you probably don't have one?). Perhaps I could even help you with the actual implementation too, as I am more or less familiar with Python, although I would first need some time/pointers to look around the repository.