Hi, I started from a blank applications with one device and now I want to add more devices. I use webhook url method to trigger a dashboard. For the other devices to be added, must I create seperate webhooks , workflows and dashboards bearing in mind that each device is exactly similar in attributes and use the same application ?
Hi @SEAN_O_CONNELL,
You have a couple of options to create more devices, but the way you do so will depend on your use case. Are you looking to exclusively duplicate devices within your application? Or are you hoping to automate device creation in a workflow that is triggered by a Webhook?
I would also recommend checking out the following resources:
- Adding a Device Documentation
- Device Recipes Documentation
- Tuesday Tips: Self Register Devices, faster!
- Context Variables Documentation
Thanks so much!
Julia
Hi Julia, I want to add many devices using webhooks trigger in workflow. In addition, the devices have all the same attributes.
Thanks Sean.
Hi @SEAN_O_CONNELL,
Great, thank you for that information!
I would recommend creating a device recipe for your device. This will allow you to configure your workflow to quickly create new devices with the same set of attributes and tags.
Within your workflow, you have a Webhook Trigger Node. In order to create new devices on each trigger, you will need to add a Device: Create Node and configure it with your device recipe.
Here is an example of a workflow that creates a new device each time the webhook is triggered:
Please let me know if you have any further questions!
Thanks,
Julia
Hi Julia, I want to use only one webhook to trigger workflow and to create multiple devices. I have many devices running exact same code with the same webhook url in code.
Create node does not seem to create unique devices (using the same recipe) ?
Rgds Sean.
Hi @SEAN_O_CONNELL,
When you say the Device: Create Node is not “creating unique devices,” what do you mean?
A recipe will create new, unique Losant devices with the same configuration (unless you template the Device: Create Node with your payload data). However, to report state to your newly created device within the same workflow, you will need to do a couple of things.
At the bottom of your Device: Create Node, you have the option to place the resulting device creation data on the payload. I configured my path as working
:
When I trigger this workflow, I can see the object for my new device at working
(and the deviceId at working.deviceId
):
In order to update the state for my newly created device, I will have to template the Device: State Node in order to report for the correct device:
Please let me know if I can assist with any further questions!
Thanks,
Julia
I tried above working
sample flow and debug came back with `invalid device id"
Must I add something else to my application to solve this error ?
If I were to add a second device to above, what would flow look like ?
Basically for all devices used, this workflow will be triggered as I use same webhook.
It is how I seperate out each device in the workflow that I am stuck on.
Thanks
Hi @SEAN_O_CONNELL,
I’m going to need a bit more information to assist you further. Could you include screenshots of your workflow configuration, as well as your debug panel with the error? Seeing the structure of your payload and workflow will allow me to answer more comprehensively.
Are you trying to conditionally create devices or report state from the same workflow?
Thanks!
Julia
Hi Julia, attached is image of my updated workflow per your comments above. I used same working
deviceid as you mention.
Overall, I need to know how you make my workflow cater for 2 devices or more using same webhook. A lot of examples shown only cater for one device.
Thanks Sean.
Hi @SEAN_O_CONNELL,
You can handle more than one device by creating your own logic, possibly using a Conditional Node or Switch Node. The example I have shown is not for one device, it is for multiple. My examples can only help so much, which is why we have created such thorough resources like the following:
Could you please include the configuration of your Device: Create Node, your Device: State Node, and expand your working
object on the payload?
Thanks,
Julia
Julia, attached are some images requested. The error says device limit exceeded but I have less than 10 devices across all apps (9 devices).
Hi @SEAN_O_CONNELL,
It seems as though you have reached the device limit for a sandbox account. You can view your sandbox limits here in the bottom right quadrant of the page. The limits established for a sandbox account are hard limits, and cannot be increased. You can learn more about these limits within our documentation.
If you would like more information about an organization account with significantly higher limits, you can learn more here.
Thanks,
Julia
ok, I tried removing some devices and it would not allow me.
Is there a monthly quota as well here ?
Hi @SEAN_O_CONNELL,
You should be able to delete devices and create new ones, you are only limited on the total count. Could you include some screenshots if you are still unable to delete devices?
Thanks!
Julia
No luck with device deletion. I removed one application leaving just one active app with 5 devices and I deleted 2 to give 3 active devices. Then after refresh device number grew again to 4 and 5 and the sandbox resources still shows 10 devices ? Very strange behaviour.
Hi @SEAN_O_CONNELL,
You currently have a workflow that creates a device every time your webhook is triggered. It seems your webhook is firing a couple of times a minute. In this case, every time you manually delete a device, your workflow is creating another one.
Let me know if you have any additional questions.
Thanks!
Julia
Thanks Julia, I was trying to recreate your original flow using working device id. How do I prevent this happening ? I want to create a node from payload but only once.