Hi
I have a device (an ESP32) which returns the following when pinged:
[{“deviceId”:“163350134616381”,“water”:“709”,“humidity”:" 71.00",“temperature”:" 27.00"}]
I have the JSONPath Transformation installed.
The HTTP Binding is installed.
I recognize that this is an Openhab1 binding so I understand I am not to use PaperUI but rather items and rules files alone…
My items file reads as follows:
String Temperature_json "Temperature [JSONPATH($.temperature):%s °C]" { http="<[http://192.168.0.150:81/:6000:REGEX(.*?<html>(.*?)</html>.*)]" }
Number Temperature "Temperature [%1.f °C]"
My rules file reads as follows:
rule "Temperature"
when
Item Temperature_json changed
then
val newValue = transform("JSONPATH", "$.temperature", Temperature_json.state.toString)
Temperature.postUpdate(newValue)
end
My sitemaps file reads as follows:
Text item=Temperature label="Current Temperature [%s]" icon="temperature"
However my sitemap shows a “-” where a figure for the temperature should be visible.
Frontail log provides the following error message:
2020-02-13 00:01:55.327 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state ‘NULL’ on item ‘Temperature_json’ with pattern ‘JSONPATH($.temperature):%s °C’: Invalid path ‘$.temperature’ in ‘NULL °C’
with subsequent errors:
2020-02-13 00:01:58.927 [ERROR] [org.openhab.io.net.http.HttpUtil ] - Fatal transport error: java.net.SocketTimeoutException: Read timed out
2020-02-13 00:01:58.931 [ERROR] [ab.binding.http.internal.HttpBinding] - No response received from 'http://192.168.0.150:81/
Would be grateful for your advice.
thanks