I have changed the way I publish my data to a StateString to use with Losant, and to save on data. I want to have a backup of that data sent to a google sheet. In the past I used a Webhook / Web Form or JSON. Now that my data is in a string I can’t seem to figure out how to change my Webhook to read that new data format. I have tried a number of different combinations… really just guessing but keep coming up blank. Is there a tutorial on how to do this that I missed? I did a number of searches but was not able to find anything that related.
Thank you.
Here is how my data is published. With @ScruffR’s and @RWB’s help.
if (Particle.connected()) {
publishStateString[0] = '\0'; // make sure the string is reset
if (millis() - lastpub2 > 600000) { // time for a full report?
lastpub2 = lastpub = millis(); // reset BOTH timers as the full report also features the short report data
snprintf(publishStateString // use this for losant format, removed ADC
, sizeof(publishStateString)
, "%.1f:%.2f:%.1f"
, flow, fuel.getVCell(), fuel.getSoC());
}
if (publishStateString[0]) // if the string was populated send it
Particle.publish("State", publishStateString, 60, PRIVATE, NO_ACK);
}
Here is my webhook with the JSON data parts removed. I assume that I need to do this differently than your typical JSON format. Maybe a custom body? I am just not sure. I can’t figure out how to separate data that is all within one set of " " and separated by :
Any ideas or tutorials I missed please share. Thank you for the help it is really appreciated.