# Custom events from device to widget

**URL:** <https://community.homey.app/t/custom-events-from-device-to-widget/122047>\
**Category:** Developers\
**Created:** [November 29, 2024, 3:20pm UTC](https://community.homey.app/t/custom-events-from-device-to-widget/122047 "2024-11-29T15:20:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emiliano\_Quetimporta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/emiliano_quetimporta/32/73402_2.png) [@Emiliano\_Quetimporta](https://community.homey.app/u/Emiliano_Quetimporta)\
**Post date:** [November 29, 2024, 3:20pm UTC](https://community.homey.app/t/custom-events-from-device-to-widget/122047/1 "2024-11-29T15:20:04Z")

</div>

hi I’m trying to update my widget based on an event from the device.  
In the device I have this.homey.emit(“myEvent”); (which works just fine if I call this.homey.on(“myEvent”) in the same device.

When I call this from the widget I don’t get any event:  
Homey.on(“myEvent”, () =\> doSomething());

does anybody have a tip? I couldn’t find this in the docs, it seems it could be here: [Custom Pairing Views | Homey Apps SDK](https://apps.developer.homey.app/advanced/custom-views/custom-pairing-views)  
but that link is not working

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [November 29, 2024, 3:30pm UTC](https://community.homey.app/t/custom-events-from-device-to-widget/122047/2 "2024-11-29T15:30:48Z")

</div>

Poorly (read: _not_) documented:

```auto
this.homey.api.realtime('myEvent', ...);

```

---

<div class="post-metadata">

**Author:** ![Emiliano\_Quetimporta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/emiliano_quetimporta/32/73402_2.png) [@Emiliano\_Quetimporta](https://community.homey.app/u/Emiliano_Quetimporta)\
**Post date:** [November 29, 2024, 3:59pm UTC](https://community.homey.app/t/custom-events-from-device-to-widget/122047/3 "2024-11-29T15:59:20Z")

</div>

Will try it later, thx!

---

<div class="post-metadata">

**Author:** ![Emiliano\_Quetimporta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/emiliano_quetimporta/32/73402_2.png) [@Emiliano\_Quetimporta](https://community.homey.app/u/Emiliano_Quetimporta)\
**Post date:** [November 29, 2024, 7:01pm UTC](https://community.homey.app/t/custom-events-from-device-to-widget/122047/4 "2024-11-29T19:01:47Z")

</div>

You are gold! thanks!  
For future reference:  
in the device:  
this.homey.api.realtime(“myEvent”, …);  
in the widget.html:  
Homey.on(“myEvent”, () =\> doSomething());

---

<div class="post-metadata">

**Author:** ![Elmar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/elmar/32/131852_2.png) [@Elmar](https://community.homey.app/u/Elmar)\
**Post date:** [December 11, 2024, 10:41am UTC](https://community.homey.app/t/custom-events-from-device-to-widget/122047/5 "2024-12-11T10:41:52Z")

</div>

anyone know if its possible to update the settings? I have 2 settings, and if I select one boolean the dropdown beneath needs to be cleared so set to null for example. I see you can only use getSettings(). normally you can do the.homey.settings.set but this is only for the app settings not the widget settings

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 11, 2024, 2:46pm UTC](https://community.homey.app/t/custom-events-from-device-to-widget/122047/6 "2024-12-11T14:46:50Z")

</div>

No, I also searched, but it seems it’s not possible.

---

<div class="post-metadata">

**Author:** ![Emiliano\_Quetimporta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/emiliano_quetimporta/32/73402_2.png) [@Emiliano\_Quetimporta](https://community.homey.app/u/Emiliano_Quetimporta)\
**Post date:** [December 11, 2024, 2:58pm UTC](https://community.homey.app/t/custom-events-from-device-to-widget/122047/7 "2024-12-11T14:58:12Z")

</div>

Is it maybe a workaround to pass the setting to the app, and store them with a widget id? When you initialize the widget you can retrieve them
