hannseman / homebridge-mi-hygrothermograph

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
MIT License
266 stars 52 forks source link

Publish dew point approximation to mqtt #130

Open micampe opened 3 years ago

micampe commented 3 years ago

Dew point is a more interesting value to assess human comfort than just pure temperature and humidity, this change calculates an approximation and publishes it to an mqtt topic.

Elgato Eve supports a custom characteristic for dew point as well, so it could be published there too.

Note that this change depends on my previous pull request for the configuration UI #129.

hannseman commented 3 years ago

Many thanks for you PR. I think it would be interesting to add the dew point characteristic, would you like to add it?

I also think that we should add new methods for "setting" and getting the dewPoint instead of using the setter/getter pairs for humidity and temperature. So on scanner.on("temperatureChange") and scanner.on("humidityChange") we could use a new method called setDewPoint() or updateDewPoint() which would use your dewPoint getter to publish the value on the MQTT-topic and update the elgato characteristic. What do you think?

micampe commented 3 years ago

Yes, that seems very reasonable. I can do it but I’m not very fluent in js/node and currently busy with other things so I’m not sure I’ll be able to pick it back up.

hannseman commented 3 years ago

@micampe no worries, I'll try to find the time to bring it over the finish line. Thanks for your input and effort!

github-actions[bot] commented 3 years ago

File Coverage Lines Branches Missing
All files 100% 100% 100% :white_check_mark:

Minimum allowed coverage is 100%

Generated by :monkey: cobertura-action against 9911ce9e0ab3636a28b0f87fd068ecd9d136c1f6