Complete the code to define a topic pattern for device status updates.
topic = "devices/[1]/status"
The topic pattern uses device_id to specify which device's status is being updated.
Complete the code to subscribe to all temperature sensors in building 5.
topic = "building/5/[1]/temperature"
# which matches too broadly.The single-level wildcard + matches any sensor or device at that level in the topic hierarchy.
Fix the error in the topic pattern to correctly subscribe to all sensors in all buildings.
topic = "[1]/sensors/#"
# which cannot appear except at the end of the topic.The single-level wildcard + matches any building identifier, and # matches all subtopics under sensors.
Fill both blanks to create a topic pattern for commands sent to a specific device in a room.
topic = "[1]/[2]/commands"
The pattern uses room and device to target commands to a specific device in a room.
Fill all three blanks to create a topic pattern for publishing sensor data with building, floor, and sensor type.
topic = "[1]/[2]/[3]/data"
The topic pattern includes building, floor, and sensor to organize sensor data hierarchically.