Looking for state of the art plotly webhook example(s)

I’m looking for a current state-of-the-art webhook to upload data to plotly.

I just want to graph some time-series variables, the examples using Librato are not of direct use to me, because I don’t want to pay to graph these after the trial period with Librato.

I have 4 values that I report every 5 minutes via Spark.publish(), I currently format the 4 values as a single JSON payload. Now I’m looking to dump them into plotly for storage and viewing.

just a head’s up, but check with plotly… i believe the number of variables you can plot with a free account is quite limited (after a spell)

Hmm - they don’t go out of their way to make that clear, thanks for the heads up; will check (and report back.)

If anyone has suggestions other than plotly, I’m all ears.

I just want to plot a handful of things without signing up for yet-another-monthly-subscription (they can put ads on the page for all I care.)

@AndyW

If all you want is a simple realtime plotting for field values, then ThingSpeak is a decent option. It is free, you can have up to 8 channels, I believe, but they do have a 1/15sec POST limit–shouldn’t matter for your POST every few minutes. We at glowfi.sh support webhooks to ThingSpeak for our machine learning returns, and have used it for up to 6 fields in 1 channel (more is possible, I believe). The http requests are pretty straight forward:

The Json data is of the form: { “field1”: [1.0], “field2”: [3.6] }

Headers:
X-THINGSPEAKAPIKEY = {YOUR API KEY}
Content-Type = “application/json”

You can find out more from ThingSpeak docs here. It is worth noting that in our experience, ThingSpeak will only allow 1 field value per field key in each post–no lists.

mike

1 Like

Thanks for the suggestion - which naturally leads me to ask if anyone has a known working webhook example that posts to ThingSpeak ?

1 Like

News from plotly - they don’t have a restriction on the free tier, per se - but they do have some technical limitations that top out around 5000 data points. So, depending how they count things, that would be approx 17 or 3 1/2 days worth of data if I’m reporting 5 temperatures every 5 minutes.

Their suggestion was to record/downsample the data elsewhere and then dump it into plotly for display purposes.

I am looking at ThingSpeak, I’ll report back.

2 Likes

@AndyW

Hi Andy, you might like to take a look at Tinamous.com. (Heads up, I’m the founder)

We integrate with the Particle API to connect your devices into the Tinamous environment where you can track sensor measurements through the use of either Spark.Variable and Spark.Publish methods. No need for webhooks, once you connect your Particle account your devices get linked and we start collecting the measurements automatically.

From Tinamous you can control if and how often variables are collected and call exposed functions on the device, from the device you can push status posts and senml formatted measurements into Tinamous.

You can read more about it over at http://tinamous.com/Help/Bots/ParticleBot

You might like to look at the data from my Particle Core connected geiger counter (https://ddd.tinamous.com/Devices/Geiger2/cpm) to get an idea.

The Particle integration is something I’m working heavily on at present so if you have requests or suggestions I’d love to hear them.

3 Likes

I got it working with this webhook json:

{
    "event": "thingspeak",
    "url": "https://api.thingspeak.com/update.json",
    "requestType": "POST",
	"deviceid": null,
    "mydevices": true,
	"headers": {
		"Content-Type": "application/json",
		"X-THINGSPEAKAPIKEY": "YOUR WRITE KEY HERE"
		},
    "json": {
			"field1": "{{indoorTemp}}", 
			"field2": "{{outdoorTemp}}", 
			"field3": "{{wifi}}",
			"created_at": "{{SPARK_PUBLISHED_AT}}"
            }
}

My publish line is:

Spark.publish("thingspeak","{\"outdoorTemp\": "+ String(outdoorTemp) + ", \"indoorTemp\": "+ String(indoorTemp) + ", \"wifi\": "+ String(wifiRssi) +"}" ,60, PRIVATE);

More info here: https://thingspeak.com/docs/channels#update_feed

1 Like

@TinamousSteve How long should it take my devices to show up after adding the ParticleBot? It’s probably been an hour so far and nothing is showing up. I have 2 cores and a photon that are online.

Excellent - if a photon was publishing an already formatted json string, what would the syntax be to simple pass it through the webhook, without substitution ?

I assume it might look something like:

...
"json": {{some_magic_string}}
...

or is such a thing not possible ?

@Fragma It should be quick (10ish minutes). I hadn’t realised spaces are allowed in Particle device names which messed up adding them, I’ve pushed a fix for that and it appears they have been added now, you will need to click the refresh icon in the devices list for now as that doesn’t auto-update yet.

Let me know if you have any other problems.

Steve.

I’m not sure, I don’t have much experience with JSON. I tried a dozen variations but in every case what thingspeak received was:
field1: {
field2: s
field3: o
field4: m

basically 1 char each of “{some_magic_string}”. It’s like the webhook engine didn’t like what I sent in via publish and thus didn’t do the replacement.

Thanks, it’s working now.

{some_magic_string} was a placeholder for some webhooks magical keyword that I don’t think I know yet. I was kinda hoping one of the webhooks developers might chime in.

Ok. I was assuming you wanted to send the full json payload yourself, simplified example that doesn’t work:

Spark.publish("thingspeak","{\"some_magic_string\" : {field1: " + String(outdoorTemp) + "}}" ,60, PRIVATE);