Carbon Monoxide Sensor
UUID: 0000007F-0000-1000-8000-0026BB765291
Required Characteristics
Optional Characteristics
Example
The example below is automatically generated and may not be a complete example of what is required to create a working "Carbon Monoxide Sensor" Homebridge plugin. Note
// Example Carbon Monoxide Sensor Plugin module.exports = (api) => { api.registerAccessory('ExampleCarbonMonoxideSensorPlugin', ExampleCarbonMonoxideSensorAccessory); }; class ExampleCarbonMonoxideSensorAccessory { constructor(log, config, api) { this.log = log; this.config = config; this.api = api; this.Service = this.api.hap.Service; this.Characteristic = this.api.hap.Characteristic; // extract name from config this.name = config.name; // create a new Carbon Monoxide Sensor service this.service = new this.Service(this.Service.CarbonMonoxideSensor); // create handlers for required characteristics this.service.getCharacteristic(this.Characteristic.CarbonMonoxideDetected) .on('get', this.handleCarbonMonoxideDetectedGet.bind(this)); } /** * Handle requests to get the current value of the "Carbon Monoxide Detected" characteristic */ handleCarbonMonoxideDetectedGet(callback) { this.log.debug('Triggered GET CarbonMonoxideDetected'); // set this to a valid value for CarbonMonoxideDetected const currentValue = 1; callback(null, currentValue); } }