Closed dougkillmer closed 7 years ago
+1
Ditto for 'ContactSensor' and 'MotionSensor'.
Made a PR for MotionSensor support https://github.com/webdeck/homebridge-indigo/pull/15
Another one for ContactSensor support https://github.com/webdeck/homebridge-indigo/pull/16 There you go @blysik , once this is merged, you will have all you wanted. Sorry @dougkillmer I don't have devices with temperature/humidity/barometer attributes so I can't test anything. Would have added it but I don't want to push untested code.
Thanks for the PR - merged and published to NPM.
@etiennetalbot I don't see a way to access custom attributes with the REST API, so I think I'm stuck with the thermostat device type and its built-in attributes (inputTemperatureVals, inputHumidityVals). I ended up adding a separate device type and then borrowed code from the thermostat to update these attributes.
`function IndigoTemperatureSensorAccessory(platform, deviceURL, json) { IndigoAccessory.call(this, platform, Service.TemperatureSensor, deviceURL, json);
this.service.getCharacteristic(Characteristic.CurrentTemperature)
.setProps({minValue: -50})
.on('get', this.getCurrentTemperature.bind(this));
this.service.addCharacteristic(new Characteristic.CurrentRelativeHumidity)
.on('get', this.getCurrentRelativeHumidity.bind(this));
} `
The main issue I had with the default thermostat was the minimum value of the CurrentTemperature characteristic. Anything below 0C would cause an error value in Homebridge.
I added the minValue of -50 to thermostat current temperature.
Perfect, thanks @webdeck!
It would be great to have a treatAsSensor parameter in the config. I've got devices with temperature, humidity and barometer attributes. Right now, my only option is to identify these devices as thermostats so I can access some of these values in HomeKit.