As someone just getting into this area I’m pretty lost in trying to get my data sent over to ThingSpeak. Going through some of the earlier posts I think I need to put this:
which I can obviously reformat if required. Currently I’m just having that sent out as email and SMS.
And help or links to good documentation would be greatly appreciated.
From my playing with thingspeak it wants stuff coming in as fields, you then set up what each field means on your channel.
So if you’re trying to set up a route then on your dash/whatever you’d construct the outgoing message as JSON.
HologramCloud.print("{ \"p\":");
HologramCloud.print(Pi); // i.e. the variable with 83.3 in it
HologramCloud.print(", \"v\":");
HologramCloud.print(Vent); // 78.3
HologramCloud.print(", \"a\":");
HologramCloud.print(Ambient); // 77.5
HologramCloud.print(",\"e\":");
HologramCloud.print(EnclT); // 29.0
HologramCloud.print(",\"d\":");
HologramCloud.print(DI); // 0 or 1
HologramCloud.print("}");
HologramCloud.attachTag("TS"); // whatever your topic is
HologramCloud.sendMessage();
HologramCloud.clear();
That should result in JSON (just use numbers, not 83.3F) that looks like:
{"p":83.3, "v":78.3, "a":77.5, "e":29.0, "d":1}
Then in your route with a “TS” topic the destination URL could look like:
More noob questions, but I try this and get a syntax error. I’m trying this with a Raspberry pi running Python 3. Should it work as written there or do I need to reformat?