Hi,
I am trying to post my sensor values to Librato. Therfore I have created a webhook and use Spark.publish in my code.
JSON
{
"eventName": "data",
"url": "https://metrics-api.librato.com/v1/metrics",
"requestType": "POST",
"auth": {
"username": "my email",
"password": "Librato Tokken"
},
"json": {
"gauges": [
{
"name": "hum",
"value": "{{SPARK_EVENT_VALUE}}",
"source": "{{SPARK_DEVICE_ID}}"
},
{
"name": "temp",
"value": "{{SPARK_EVENT_VALUE}}",
"source": "{{SPARK_DEVICE_ID}}"
},
{
"name": "baro",
"value": "{{SPARK_EVENT_VALUE}}",
"source": "{{SPARK_DEVICE_ID}}"
},
{
"name": "duration",
"value": "{{SPARK_EVENT_VALUE}}",
"source": "{{SPARK_DEVICE_ID}}"
}
]
},
"mydevices": true
}
Code
sprintf(publishString,"{"hum": %.2s, "temp": %.2s, "baro": %u, "duration": %u}",String(humi).c_str(),String(tempe).c_str(),pressure,dur);
Spark.publish("event", publishString);
Dashboard result:
{"data":"{"hum": 61, "temp": 24, "baro": 96141, "duration": 4862}","ttl":"60","published_at":"2015-08-30T01:51:44.388Z","coreid":"my core id","name":"data"}
particle subscribe mine result:
Subscribing to all events from my personal stream (my devices only)
Listening to: /v1/devices/events
{"name":"data","data":"{"hum": 61, "temp": 24, "baro": 96141, "duration": 4862}","ttl":"60","published_at":"2015-08-30T01:51:44.388Z","coreid":"my core id"}
Altough it seems to work, all my values in Librato are 0.
I would be very grateful if you could help me to solve this problem.