How to read air quality, humidity, contact and motion sensors
Many endpoints declare sensing next to their main job, so search by the reading you need as well as the product name. Candidates include AIR_QUALITY_MONITOR, AIR_PURIFIER, CONTACT_SENSOR, MOTION_SENSOR, HUMIDITY_SENSOR and TEMPERATURE_SENSOR. Check every authorized account before you say a sensor is missing. Fetch the exact interface from the directory before you rely on it. Sensor interfaces also cover concentrations such as carbon dioxide, PM2.5 and formaldehyde.
Query the exact endpoint and expand only the declared sensor capabilities with forceDeviceAttributeQuery=true. Only an available reading is a reading. A missing, errored or invalid value is unknown, not zero, closed or clear. A STALE value is the last known state: report it with its sampledAt (for example "Open as of 1 minute ago"), not as live. Report the unit and any timestamp the endpoint supplies. air-quality-sensor reports an air-quality-index value together with the standard it uses, so give both, and do not compare readings from different standards. Send get-air-quality only when the route declares it.
A contact-sensor detection-state of DETECTED means the door, window or garage door is open (contact broken), and NOT_DETECTED means it is closed; say "open" or "closed" to the customer, never the raw words, and never read DETECTED as closed. A motion or contact sensor reports the last state it sent. "No motion" does not prove that nobody is home, and an unreachable sensor does not mean a closed door. For indoor temperature use a temperature-sensor reading, not a thermostat setpoint; see the thermostat guide.
Air purifiers
A purifier may declare power and fan-control as well as air quality. Use only the commands it declares and read the fan setting afterward. Turning a purifier on or off is low risk and needs no extra confirmation when the customer asked. Accepted control proves dispatch only, so verify with a fresh observation and do not repeat a relative change. No Dyson plugin exists, so a Dyson purifier is available only through another connected provider.
Sensors are read-only. Do not promise alerts or automations unless a declared scheduling operation creates a verifiable job.