Made it work whit this code.
Thanks
When.WebServiceCallReceived("HomeAutomation.NestLink/Update/", (jsonData) =>
{
dynamic data = JsonConvert.DeserializeObject(((String)jsonData).Substring(31));
// use the data object....
MigService.Log.Debug(data.devices.thermostats);
return "{ \"ResponseValue\" : \"OK\"}"
});
and here is my node.js part to send the data to Home genie
var http = require('http');
var options = {
hostname: 'hg.erxinfo.ca',
port: 8080,
path: '/api/HomeAutomation.NestLink/Update/',
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
auth: 'xxx:xxx',
};
var hreq = http.request(options, (hres) => {
hres.setEncoding('utf8');
hres.on('data', (d) => {
console.log(d);
});
});
hreq.on('error', (e) => {
console.error(e);
});
hreq.write(JSON.stringify(data));
hreq.end();
Still need some work on the Node.js module.... and to be able to read all the valid data inside Home genie