telegraf/plugins/inputs/webhooks/particle/README.md

1.4 KiB

Particle Webhook

Particle Webhook Plug-in for Telegraf

Particle events can be sent to Webhooks. Webhooks are configured using Integrations. Assuming your Particle publishes an event called MY_EVENT, you could configure an Integration with:

  1. "Event Name" set to MY_EVENT
  2. "URL" set to http://MY_IP:1619/particle
  3. Leave "Request Type" set to "POST"
  4. Leave "Device" set to "Any"

Replace MY_EVENT and MY_IP appropriately.

Then click "Create Webhook".

You may watch the stream of Particle events including the hook-sent/MY_EVENT and hook-response/MY_EVENT entries in the Logs

Particle

See Particle Webhooks documentation.

The default data is:

{
    "event": MY_EVENT,
    "data": MY_EVENT_DATA,
    "published_at": MY_EVENT_TIMESTAMP,
    "coreid": DEVICE_ID
}

The following Particle (trivial) sample publishes a random number as an event called "randomnumber" every 10 seconds:

void loop() {
    Particle.publish("randomnumber", String(random(1000)), PRIVATE);
    delay(10000);
}

Events

Tags:

  • 'event' = event string
  • 'coreid' = coreid string

Fields:

  • 'data' = data int

Time:

  • 'published' = published_at time.Time (ISO-8601)