metbosch / homebridge-http-temperature

HomeBridge HomeKit Plugin for HTTP temperature endpoints
https://www.npmjs.com/package/homebridge-http-temperature
Apache License 2.0
33 stars 18 forks source link

Homebridge poling and push on change #10

Closed crashtestoz closed 6 years ago

crashtestoz commented 6 years ago

Is there a way to get the Homberidge to poll the http sensor and push a value to HomeKit when there is a change?

Or better yet, have an open connection to the http sensor to constantly measure for a change?

metbosch commented 6 years ago

You can use the option update_interval to specify the polling interval. If the response from the sensor takes more than the polling interval, the polling requests are avoided until the response arrives. In addition, you have timeout option to define the maximum time that the plugin waits for a request before fail.

Testing this plugin I realized that the ios Home app is not actively waiting for updates. Therefore, the ios device does not immediately show the new value when this plugin updates the current value in homebridge. However, the update seems to work nicely for triggers like: "start the cooling system when the temperature goes above XX" (https://github.com/metbosch/homebridge-http-temperature/issues/6)

You can check a discussion about that (from some weeks ago) it in: https://github.com/metbosch/homebridge-http-temperature/pull/8 The changes introduced to support such functionality are: https://github.com/metbosch/homebridge-http-temperature/pull/9

metbosch commented 6 years ago

@crashtestoz Did you realized some problem using this plugin?

crashtestoz commented 6 years ago

Not at all. I like it and I am using it with my DIY nodeMCU DHT22 Tee/Humidity sensor. After you added the polling interval it updates nicely. My nodeMCU also has a light sensor, So I am using your plugin to check on the statuses of 3 sensor values.

metbosch commented 6 years ago

@crashtestoz We can close the issue, right?

crashtestoz commented 6 years ago

yes thx.