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

[mqtt.homie] Autodetect °F and °C unit, and provide a QuantityType #8076

Closed
ccutrer opened this issue Jul 4, 2020 · 2 comments
Closed
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@ccutrer
Copy link
Contributor

ccutrer commented Jul 4, 2020

If a Homie property contains a $unit attribute of °C or °F, OpenHAB should detect this and create a channel that provides a QuantityType with the proper temperature unit attached. This will allow OpenHAB to automatically convert say a provided C unit to F if OpenHAB is configured to use F generally. Note that Homie 3.0.0 doesn't explicitly list °C as a recommended unit, but does have it as an example. Homie 4.0.0 (which the binding says "3.0.0 or better") does explicitly list °C as a recommended unit (and I have several devices that provide °F, and one that provides °C).

Your Environment

  • openHAB 2.5.7
@ccutrer ccutrer added the enhancement An enhancement or new feature for an existing add-on label Jul 4, 2020
@ccutrer
Copy link
Contributor Author

ccutrer commented Jan 28, 2022

I believe this is fixed by #10727; testing....

@ccutrer
Copy link
Contributor Author

ccutrer commented Jan 28, 2022

Woohoo! It does! I have an Item:

Number:Temperature PrimaryWaterHeater_OutletWaterTemp "Primary Water Heater Outlet Water [%.1f °F]" <temperature_hot> (gPrimaryWaterHeater, gInflux) { channel="mqtt:homie300:mosquitto:waterheater:abc#current_2Dtemperature", expire="60s", alexa="CurrentTemperature" }

in MQTT its value is 40.5, with a $unit of °C. In OpenHAB its state is coming through as 123.575 °F!!

@ccutrer ccutrer closed this as completed Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

No branches or pull requests

1 participant