particle-iot / cloud

A place to discuss issues, enhancements, features for: API, Cloud Compiler, Web IDE (Build), Webhooks, Console, and Device Setup
2 stars 0 forks source link

Add PARTICLE_DEVICE_NAME to list of pre-defined webhook variables #30

Open bryastring opened 6 years ago

bryastring commented 6 years ago

Feature Requests

I am using Twilio along with Webhooks to send SMS's to notify users of a condition indicating need for repair at various locations (NORTH, CENTRAL, SOUTH, etc. x 100). When creating the Webhook for this service, I found the documentation stating that the pre-defined webhook variables available for use in the message Body only include DEVICE ID, EVENT NAME, EVENT VALUE, and PUBLISHED AT.

However, I have named each device according to location and the repair notification process would be greatly simplified if the SMS could include the Device Name instead of the Device ID. Could you add Device Name as a pre-defined webhook variable?

IFTTT allows me to include Device Name as one of the possible variables but I would rather not use that for reliability reasons.

Thanks.

monkbroc commented 6 years ago

Thanks for the suggestion. I created an internal issue linked back here to implement this.

annerajb commented 5 years ago

Any update on this? would help reduce the amount of data being sent by the devices especially since the source of it is the server itself that publishes it.

PARTICLE_DEVICE_NAME would help a lot to also help tag data being sent by a device on the webhook side.

monkbroc commented 5 years ago

No, at this time it's still not possible to get the device name with the webhook data. It's still on the roadmap but requires deeper changes to webhooks before it can be added.

Naboo2604 commented 4 years ago

i have the same issue/request (based on Azure Integration) - we have a very large customer with a lot of iot devices and want to implement a solution with boron´s - lot of iot devices still exist in iot hub, and we need to send messages with "DEVICE_NAME" instead of "DEVICE_ID" (device_id will create automatically new devices in iot_hub which is great for small projects where no devices exist in iot hub, but a big problem if you have a lot of predefined devices...)

monkbroc commented 4 years ago

Thanks for writing about your use case. Since the device name can be blank or change whereas the device id never changes, it's currently only possible to link devices into an Azure IoT Hub using the device id, not the name.

SUPScientist commented 4 years ago

Hi, @monkbroc, I have the same question as @annerajb: can a PARTICLE_DEVICE_NAME be transferred via webhooks? I see your answer from Feb. 6 that this feature wasn't yet available and it doesn't show up as a solution in the docs, so I think that's the answer but I wanted to give an upvote of sorts to this request as it would be extremely useful in our (enterprise) development as well. Thanks!

monkbroc commented 4 years ago

It's not supported yet and it's a hard thing to add due to implementation of the webhook system right now. We plan some internal changes to the events system in 2020 and we'll keep this requirement in mind when we do so.

monkbroc commented 4 years ago

The workaround is to fetch the device name from the Particle API when an event is received. If you know that your device names don't change you can cache the value as well.

oraclerouter commented 4 years ago

@monkbroc Any update on the when the PARTICLE_DEVICE_NAME will be available via webhook? Also, can you elaborate on the workaround?

monkbroc commented 4 years ago

Device name will not be added to the webhook template in the near term. It will be added when the event subsystem gets reworked in the future.

The workaround is to do a Particle API call to get the device name from the device id using this endpoint https://docs.particle.io/reference/device-cloud/api/#get-device-information

AkshatHyperion commented 1 year ago

Any Update on this?