Mongoose OS pub MQTT -> /devices/‘device.id’/state
Mongoose OS sub MQTT <- /devices/‘device.id’/config
Document device-config/‘device-id’/
{
online: true,
state: {}
}
functions.pubsub.topic(‘’).onPublish(async (message) => {
deviceId = message.attributes.deviceId;
})
functions.firestore.document(‘’).onWrite(async (change, context) => {
})