KraigM / homebridge-nest

Nest plugin for HomeBridge
210 stars 72 forks source link

Can you expose the humidity as a sensor? #99

Open zeve-zz opened 7 years ago

zeve-zz commented 7 years ago

I would like to set up automation based on the Nests humidity reading.

Is there a way to expose this value as a sensor in Homekit?

rtoohil commented 7 years ago

In taking a look at this (I'm trying to learn the homebridge plugin code a bit), this should be possible. Rather than binding the RelativeHumidity characteristic to the Thermostat service, we'd create another service under the Thermostat that would be Service.HumiditySensor, and bind the RelativeHumidity characteristic to the Humidity service rather than the Thermostat service.

I'm just eyeballing it right now, but it's something I'm hoping to play with when I have a few spare moments. It looks to me like it might not be more than a handful of lines of code.

The other thing I'm looking into is whether or not you can bind a characteristic to multiple services. If so, we could also expose a Temperature sensor. That would be useful if you ever wanted to do an automation where "if the temperature drops below X degrees, perform some other action".

zeve-zz commented 7 years ago

@rtoohil this would honestly be amazing. would really expand the possible use cases.

rtoohil commented 7 years ago

I've got this working in a development branch on my homebridge. However, right now, the sensors don't let you trigger any automations. I'm trying to see if that's a code thing (some other bit that needs to be enabled), a homebridge thing, or a HomeKit thing.

rtoohil commented 7 years ago

So, I think this is a limitation of the Home app, and you really don't need to expose the Humidity or Temperature sensors separately. The Elgato Eve app and the Home app) both can read the temperature and humidity off of the Nest via Homebridge and use them as triggers to rules.

Seems like this is purely a limitation of Apple's Home app. I've setup some rules in the Elgato app to see if they work.

Still, if you want to try out a version of the the Nest plugin with humidity and temp sensors exposed, check out my fork: https://github.com/rtoohil/homebridge-nest, and switch to the sensor branch.

fabriziorizzo commented 6 years ago

@roothil I just tried your code for the humidity sensor... I see the sensor, but as you say, cannot use it for automations. The homebridge-people plugin configures sensors that CAN be used for automation... so maybe there's something additional that you might need to add to the homebridge-nest code?

rtoohil commented 6 years ago

I think automation (in the Apple home app) only works for true/false sensors. There are other HomeKit apps the use sensor values for automation. Hopefully Apple improves the Home app in future releases

fabriziorizzo commented 6 years ago

Thanks Ryan!

Next question... I can add update the issue in git too, but thought I’d ask directly since I’m replying anyway...

How about some booleans for “heating”, “cooling”, “fan on” sensors? Would those be easy enough?

Trying to control a smart-plug for a room humidifier that I really only want to activate if heat or fan is on (and humidity < a fixed set-point (say 45%)).

The above boolean sensors would allow the first condition.

Configuring a humidity sensor trigger value in the config file would then allow a “humidity-achieved” boolean sensor to function.

That might accomplish the second condition, if indirectly... within limits of Apple app functionality.

Thoughts?

-- Frank

On Dec 27, 2017, at 5:04 PM, Ryan Toohil notifications@github.com wrote:

I think automation (in the Apple home app) only works for true/false sensors. There are other HomeKit apps the use sensor values for automation. Hopefully Apple improves the Home app in future releases

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

rtoohil commented 6 years ago

Definitely possible, but I might not have free time to do it for a few weeks at the earliest. I’ve also bought and Elegato Eve sensor that is my humidity sensor I use for automation, diminishing my need for the nest feature. But the nest feature could be helpful, so I may give it a shot.

In the interim, try the Elegato app or the paid Home app, which should let you build automations with the sensors as is.

fabriziorizzo commented 6 years ago

Ok. Thanks for taking the time to consider this and for the recommendations.

-- Frank

On Dec 28, 2017, at 7:02 AM, Ryan Toohil notifications@github.com wrote:

Definitely possible, but I might not have free time to do it for a few weeks at the earliest. I’ve also bought and Elegato Eve sensor that is my humidity sensor I use for automation, diminishing my need for the nest feature. But the nest feature could be helpful, so I may give it a shot.

In the interim, try the Elegato app or the paid Home app, which should let you build automations with the sensors as is.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jeffl78 commented 6 years ago

Can anyone tell me the file path to the Nest temperature sensor’s readings? I just need that to get my broadlink rm mini 3 controlling a window ac unit I have using the nest temp as a reference.