How to receive and store JSON indications

Hi,

I have this MEP card (power meter extension) that sends out indications about consumption every 20 seconds. I need to monitor these. I’m totally new to HA but figured that should be possible? The indications are JSON and the schema cannot e changed…so I need “something” in my HA that can be configured to accept this JSON and parse it.

I found some links but the use cases in those links are all about the HA polling some other API. But in this case I need to “create” the API in HA and just accept whatever the MEP card sends…Is that possible?

Thanks.

If it’s not polling, what protocol is used by your card to “push” updates?

It is just using HTTPS to send JSON formatted POST request.

Then, assuming you can configure the target url of those pushes, an automation webhook might fit the bill:

You’d have to use an input_number, and, in the automation, to extract values and use the input_number.set_value to position “variables”.

Might be a tad cumbersome, though…

Unfortunately I have zero configuration possibilities on the MEP card communication. It has a fixed IPv6 address and it pushes consumption indications to another fixed (!) IPv6 address. So I need to grab data on the url “https:<IPv6_TargetAddress>/meterdata”. This is crap I know but this is what is possible. So right now I have my Synology (where HA is installed) configured as that target IPv6 address so the indications are flowing - but something on my Synology (preferable HA) has to accept the JSON on the “/meterdata” endpoint.

Then, you will have to have a reverse proxy on the Synology. HA won’t accept “/metadata”.

Thanks koying, I ended up using a raspberry. Using nodeJs I have full control and can use the webhook features to get the data into HA…