Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help: How to integrate temperature sensor #44

Closed
TribuneX opened this issue Dec 25, 2015 · 1 comment
Closed

Help: How to integrate temperature sensor #44

TribuneX opened this issue Dec 25, 2015 · 1 comment

Comments

@TribuneX
Copy link

I'm the guy on twitter who asked for the netamo integration :)
I'm trying to integrate a temperature sensor. I can access the temperature via simple http requests. Can I adapt the thermometer class for this?
https://github.com/brutella/hc/blob/master/model/accessory/thermometer.go

I tried adding the temperature sensor to my devices like follows: 
thermometer_info := model.Info{
    Name:         "Netatmo",
    SerialNumber: "001",
    Manufacturer: "Netatmo",
    Model:        "Thermostaty",
    }

    model_thermometer := accessory.NewTemperatureSensor(thermometer_info, 10, 0, 100, 1)

But this will obviously give me 10°C as the temperature. Is there a func called when I access the sensor device via homekit? I would put the http call there. Thanks!

@brutella
Copy link
Owner

brutella commented Jan 8, 2016

As you can see from the NewTemperatureSensor method, the second argument is the temperature.

You can update the temperature using the SetTemperature(...) method.
I would recommend repeatedly update the temperature every x seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants