Transform json-string from rtl_433

Hi there

I use (some) rtl_433 dongles to receive wireless-sensors. the mqtt-connection is ok, but I dont get things sorted with the values update in the items.

Item: Number Bresser5in1Temp "Aussentemperatur [%.2f °C]" (MMOG) { mqtt="<[broker:sensor/rtl433:state:JSONPATH($.temperature_C):.*\"model\"\\:Bresser-5in1,.*]"}

2019-04-30 12:40:40.254 [vent.ItemStateChangedEvent] - JSONTEST_Jsontest changed from {“time” : “2019-04-30 12:40:37.134333”, “protocol” : 76, “brand” : “LaCrosse”, “model” : “LaCrosse-TX29IT”, “id” : 18, “battery_ok” : 1, “newbattery” : 0, “temperature_C” : 12.100, “humidity” : 125, “mic” : “CRC”, “mod” : “FSK”, “freq1” : 868.325, “freq2” : 868.103, “rssi” : -11.671, “snr” : 16.855, “noise” : -28.527} to {“time” : “2019-04-30 12:40:40.066966”, “protocol” : 119, “model” : “Bresser-5in1”, “id” : 107, “temperature_C” : 9.900, “humidity” : 86, “wind_max_m_s” : 1.400, “wind_avg_m_s” : 2.000, “wind_dir_deg” : 90.000, “rain_mm” : 62.000, “mic” : “CHECKSUM”, “mod” : “FSK”, “freq1” : 868.336, “freq2” : 868.065, “rssi” : -0.125, “snr” : 30.258, “noise” : -30.383}

JSONPATH and REGEX-mappings are installed

any ideas?

regards
peter

I’m pretty sure you can’t use REGEX and JSONPATH both at the same time (and REGEX would fail because the service isn’t referenced)

I think, you have to use proxy Items and a rule for this. Use a String Item to receive the JSON. Trigger a rule to analyze the JSON. If message contains the correct model name, use JSONPATH to extract the value, then postUpdate the proxy Item to the value.

Another option would be to write a JavaScript script and to use JS service instead.