# Programatically Creating Devices (Gateways) and Devices (Peripheral)

**URL:** <https://forums.losant.com/t/programatically-creating-devices-gateways-and-devices-peripheral/1591>\
**Category:** Help\
**Tags:** devices\
**Created:** [March 5, 2019, 5:21pm UTC](https://forums.losant.com/t/programatically-creating-devices-gateways-and-devices-peripheral/1591 "2019-03-05T17:21:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leo\_Bach](https://avatars.discourse-cdn.com/v4/letter/l/e480ec/32.png) [@Leo\_Bach](https://forums.losant.com/u/Leo_Bach)\
**Post date:** [March 5, 2019, 5:21pm UTC](https://forums.losant.com/t/programatically-creating-devices-gateways-and-devices-peripheral/1591/1 "2019-03-05T17:21:48Z")

</div>

Is there a way to create Gateways and Peripheral devices programmatically?  
Example Application:  
One gateway with many vibration sensor connected to that gateway.  
The gateway will scan through all possible devices and will return only the ones that respond and publish these values to an MQTT topic.  
Once this topic is published, I would create a gateway device and devices for each sensor that responded to the gateway’s polls.  
After this dashboards for each sensor would be generated under a dashboard for the gateway they are connected to.

Any suggestions on how to tackle this problem or where to read about potential solutions would be much appreciated.

Best Regards,  
Leo

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [March 5, 2019, 6:56pm UTC](https://forums.losant.com/t/programatically-creating-devices-gateways-and-devices-peripheral/1591/2 "2019-03-05T18:56:09Z")

</div>

Hi @Leo_Bach,

The workflow engine is pretty powerful. Check out this post:

> **[How Devices Can Register Themselves in Losant](https://www.losant.com/blog/how-devices-can-register-themselves-in-losant)**
>
> An example of how devices can perform self-registration in the Losant IoT Platform.

It is a great article showing how devices can register themselves in Losant.

Overall, you can easily do this using the Device Create Node:

[https://docs.losant.com/workflows/data/create-device/](https://docs.losant.com/workflows/data/create-device/)

Let me know if you have any more questions, happy to help!

---

<div class="post-metadata">

**Author:** ![Leo\_Bach](https://avatars.discourse-cdn.com/v4/letter/l/e480ec/32.png) [@Leo\_Bach](https://forums.losant.com/u/Leo_Bach)\
**Post date:** [March 5, 2019, 8:22pm UTC](https://forums.losant.com/t/programatically-creating-devices-gateways-and-devices-peripheral/1591/3 "2019-03-05T20:22:54Z")

</div>

Your videos for on-boarding are awesome. Thanks!

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [March 8, 2019, 4:41pm UTC](https://forums.losant.com/t/programatically-creating-devices-gateways-and-devices-peripheral/1591/4 "2019-03-08T16:41:47Z")

</div>

Thanks @Leo_Bach! I really appreciate that 🙂
