How to use Data field in HttpLink

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
ronaldwillems
Posts: 2
Joined: Tuesday 27 March 2018 21:14
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Contact:

How to use Data field in HttpLink

Post by ronaldwillems »

I'm trying to use HttpLink to push my P1 meter data to the Google Cloud for extra analyses. I can't figure out what to put in the field 'Data'. I tried this:

Code: Select all

[{"time": "%t4","type": "%V","val": "%v"}]
When I do this my nodeJS client receives this as:

Code: Select all

{ '{"time": "2018-03-27T19:23:09Z","type": "Usage2","val": "793693"}': '' }
I tried a lot of other variants, but I'm not able to send a normal JSON object to my client. Does anyone have some tips for me?

I'm using Domoticz 3.8153 on my Synology NAS
ronaldwillems
Posts: 2
Joined: Tuesday 27 March 2018 21:14
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Contact:

Re: How to use Data field in HttpLink

Post by ronaldwillems »

I now used these settings:

Code: Select all

measures={ "type":"%V", "time":%t0, "value":%v }
In my NodeJS client I still have to do this to be able to get 'type', 'time' and 'value' fields:

Code: Select all

 var measuresObj = JSON.parse(req.body.measures);
I'm still interested in a better solution, but for now it works.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest