Custom events from device to widget

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
but that link is not working

Poorly (read: not) documented:

this.homey.api.realtime('myEvent', ...);
1 Like

Will try it later, thx!

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

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

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

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