Build real-time applications with PubNub pub/sub messaging
Does it follow best practices?
Evaluation — 88%
↑ 1.28xAgent success when using this tile
Validation for skill structure
A smart building management company operates sensors across multiple buildings. Each building has multiple floors, and each floor has sensors for temperature, humidity, and air quality. The operations team wants a monitoring dashboard where a facility manager can subscribe to all sensors in a specific building at once, or drill down to a specific floor. They also want the ability to subscribe to all temperature readings across all buildings simultaneously.
The company currently has 3 buildings, each with 5 floors, and 3 sensor types per floor. The engineering team needs a JavaScript module that structures the channel hierarchy for these sensors, provides functions for publishing sensor readings, and allows flexible subscription patterns that let managers monitor at different granularity levels (all sensors in a building, all sensors on a floor, or a specific sensor type across all buildings).
Produce a single JavaScript file named iot-sensor-channels.js that exports: