This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Parsing MQTT response
arthur
Member
I'm having a Sonoff TH16 module flashed with Tasmota firmware measuring Temperature and Humidity.
The MQTT message received from subscribing to the topic "tele/TH16/SENSOR" results in following: {"Time":"2018-02-28T20:09:35","AM2301":{"Temperature":22.6,"Humidity":39.7},"TempUnit":"C"}
How do I parse this string and get Temperature and Humidity values stored separately in eg. Better Logic variables?
Or is there a smarter way, eg. query the values directly?
I'm using the Mosquitto MQTT client and MQTT broker running on Homey.
The MQTT message received from subscribing to the topic "tele/TH16/SENSOR" results in following: {"Time":"2018-02-28T20:09:35","AM2301":{"Temperature":22.6,"Humidity":39.7},"TempUnit":"C"}
How do I parse this string and get Temperature and Humidity values stored separately in eg. Better Logic variables?
Or is there a smarter way, eg. query the values directly?
I'm using the Mosquitto MQTT client and MQTT broker running on Homey.