How to send more than one sensor info via JSON
Posted: Saturday 09 January 2016 10:24
I have been succesfull in getting my particle core to send the data of a single temperature sensor to a dummy device in domoticz using the code below:
Now I would like to send the data of other sensors as well to different Domoticz devices.
What would be the best way to do this? I was able to copy past the whole code, including the, but perhaps I just only need to repeat .
Regards, Rutger
Code: Select all
if (client1.connect(server, 8080)){
client1.print("GET /json.htm?type=command¶m=udevice&idx=50&nvalue=0&svalue=");
client1.print(String(temp));
client1.println(" HTTP/1.0");
client1.println("Host: home.dtdns.net");
client1.println("Content-Length: 0");
client1.println();
ledStatus(2, 300);
delay(1000);
client1.flush();
client1.stop();
}
else {}What would be the best way to do this? I was able to copy past the whole code, including the
Code: Select all
if (client1.connect(server, 8080)){Code: Select all
GET /json............... HTTP/1.0Regards, Rutger