Subscribe to Events

To subscribe to events from a device, connect to the MQTT API and subscribe it to the events topic for that device.

To subscribe to all events the MQTT topic is: devices/{device.id}/events/+

To subscribe to a specific event the MQTT topic is: devices/{device.id}/events/{event.name}

Replace {device.id} with your device ID (should begin with dev_) and {event.name} with the name of the event you wish to subscribe to.

Example Code

Subscribe to all events using the Wia SDK

Javascript
Copy

Subscribe to only temperature events using the Wia SDK

Javascript
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard