SOLVED - Error Displaying Humidity from TH-16 (mqtt)

  • Platform information:
    • Raspi PI 3
    • Raspian
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 2
  • Issue of the topic: issue displaying humidity from a mqtt sonoff
  • Please post configurations (if applicable):
    • I have a t-16 sonoff that is flashed with tasmota. It displays the temp and humidity just fine when you go into the sonoff web page ie by ip address. i use the temp reading to turn on fans and shutters in a greenhouse and that works great. i also display the indoor temp and that works fine.

i get an error however when trying to display the humidity. this is in the openhab andorid app. it just says err. every blue moon it will display the actually humidity but then it just err’s back out.

This is the Item code:

String Indoor_State "[%s]" (startpersist) {mqtt="<[broker:stat/sonoff-00th161/POWER:state:default]"} 
Number Indoor_Temperature "Indoor Temperature [%.1f °F]" <temperature> ["CurrentTemperature"] {mqtt="<[broker:tele/sonoff-00th161/SENSOR:state:JSONPATH($.AM2301.Temperature)]"}
Number Indoor_Humidity "Indoor Humidity [%d %%]" <humidity> {mqtt="<[broker:tele/sonoff-00th161/SENSOR:state:JSONPATH($.AM2301.Humidity)]"}
 

Sitemap

Text item=Indoor_Temperature
 Text item=Indoor_Humidity
  • If logs where generated please post these here using code fences:
2018-05-02 15:17:40.601 [vent.ItemStateChangedEvent] - Indoor_Humidity changed from 19.5 to 19.2

Thanks!

Change the formatting, it’s a decimal number:

Number Indoor_Humidity "Indoor Humidity [%.1f %%]" <humidity> {mqtt="<[broker:tele/sonoff-00th161/SENSOR:state:JSONPATH($.AM2301.Humidity)]"}

beautiful! that got it! thanks so much!

Good, could you mark the thread as solved, please?