Send json data to OH1 via http


I am using a small console application on another Linux system to get data from my heat pump. This data should be transfered with wget via http to OH1 and parsed into items. But I dont know how to do this.

HTTP binding? It seems to only can GET/POSt to another URl, but no “inbound” receiving.
Send whole JSON string with REST api to a single variable und strip data in rule to different items? Could this work?
Any other suggestion? I dont need sign into the right direction :slight_smile:

example json string

[{'resp': '9088.0', 'timestamp': 1512591106.425883, 'name': 'runtime_pump'}, {'resp': '4064.0', 'timestamp': 1512591106.534158, 'name': 'qdhw'}]

value 9088 to item runtime_pump
value 4064 to item qdhw

I am still using OH1 because KNX binding in OH2 had some problems with repeating telegrams.

Thank you for any advice

working fine with sending JSON and split in rule, like this

import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*

rule "parseRotexInput"
    Item RotexInput changed
    var String json = (RotexInput.state as StringType).toString
	  // [{'name': 'runtime_comp', 'timestamp': 1512592992.871856, 'resp': '6499.0'}, {'name': 'qdhw', 'timestamp': 1512592992.991773, 'resp': '4064.0'}]
    postUpdate(Rotex_runtime_comp, transform("JSONPATH", "$.[?( == 'runtime_comp')].resp", json).replace("\"",""))
1 Like