If your device's capabilities include 'devices.capabilities.event', then you can listen for the event in the following ways.

Connection parameters:

Host: mqtts://mqtt.openapi.govee.com

Port: 8883

Username: [Your Api-Key]

Password: [Your Api-Key]

Topic: GA/ [Your Api-Key]

For example:

const mqtt = require('mqtt')
const apiKey = [Your Api-Key];  
const emqx_url = 'mqtt.openapi.govee.com';  

const options = {  
    clean: true,  
    username: apiKey,  
    password: apiKey,  
}

const connectUrl = 'mqtts://' + emqx_url  
const client = mqtt.connect(connectUrl, options)

client.on('connect', () => {  
    console.log('Connected to the broker.')  
    client.subscribe(apiKey, (err) => {  
        if (!err) {  
            console.log('Subscribed to topic apiKey')  
        }  
    })  
})

client.on('message', (topic, message) => {  
    console.log(`Received message ${message} from topic ${topic}`)  
})
  • If your ice machine(H7172) is out of water, you will receive the following message.
{
    "sku": "H7172",
    "device": "41:DA:D4:AD:FC:46:00:64",
    "deviceName": "H7172",
    "capabilities":[
        {
            "type": "devices.capabilities.event",
            "instance": "lackWaterEvent",
            "state": [
                {
                    "name": "lack",
                    "value": 1,
                    "message": "Lack of Water"
                }
            ]
        }
    ]
}
  • Presence Sensor(H5127): You will receive notifications of Presence
{
    "sku": "H5127",
    "device": "06:30:60:74:F4:45:B9:DA",
    "deviceName": "Presence Sensor",
    "capabilities": [
        {
            "type": "devices.capabilities.event",
            "instance": "bodyAppearedEvent",
            "state": [
                {
                    "name": "Presence",
                    "value": 1
                }
            ]
        }
    ]
}
  • Presence Sensor(H5127): You will receive notifications of Absence
{
    "sku": "H5127",
    "device": "06:30:60:74:F4:45:B9:DA",
    "deviceName": "Presence Sensor",
    "capabilities": [
        {
            "type": "devices.capabilities.event",
            "instance": "bodyAppearedEvent",
            "state": [
                {
                    "name": "Absence",
                    "value": 2
                }
            ]
        }
    ]
}
  • Dehumidifier(H7151):Full water notification.
{
    "sku": "H7151",
    "device": "06:30:60:74:F4:45:B9:DA",
    "deviceName": "Dehumidifier",
    "capabilities":[
        {
            "type": "devices.capabilities.event",
            "instance": "lackWaterEvent",
            "state": [
                {
                    "name": "lack",
                    "value": 1,
                    "message": "Lack of Water"
                }
            ]
        }
    ]
}