Link OH3 with OH1

I come back with new newbie’s question. Now i have 2 installation - main OH1 and new OH3. I want to link them, OH1 will change state OH3 Items. HTTP binding on OH1 side and REST API on OH3 side.
I try to change OH3 Item “os_alarm” by “curl -X POST --header “Content-Type: text/plain” --header “Accept: application/json” -d “ON” “http://{openHAB_IP}:8080/rest/items/os_alarm”” and it work fine.
I make OH1 “Switch os_alarm { http=”>[ON:POST:http://{openHAB_IP}:8080/rest/items/os_alarm:ON]" }" and it not work.
Set the log level for rest
org.openhab.core.io.rest x DEBUG
org.openhab.core.io.rest.core x DEBUG
And nothing error in log.
I try change POST to PUT and have ERROR “HTTP 415 Unsupported Media Type”
But with POST no error and no work.
Can somebody explain, how i can send state from OH1 to OH3, maybe another way?
thanks in advance

OH 1 doesn’t have a REST API. I think there is a URL you can use assuming you can ClassicUI installed (is that what it was called?) to command an Item but I don’t think there was a way to update Items.

You can use MQTT but I’m not sure the best way to set that up. Probably to configure the MQTT Event Bus on the OH 1.x instance and then use Marketplace MQTT Event Bus on the OH 3 side, but you’ll have to modify it to use the topic structure that the MQTT 1.x binding produced.

NOTE: I’m assuming you can even install the MQTT binding on OH 1 any more. About a year ago OH lost all the artifacts from before OH 2.5.12 so unless you happen to have a local copy of it you might be out of luck.

It might be roughly the same amount of work to update the OH 1 instance to OH 2.5.12 and then use the Remote openHAB binding.

It’s not correct. OH1 does have REST and i use it.
And also i can send command to OH1 Items, for example http://{openHAB_IP}:8080/CMD?os_alarm=OFF and it’s work fine.
But in not work in OH3. May be anyone know the right link for command OH3 Items?
I try PUT “http://{openHAB_IP}:8080/rest/items/os_alarm?state=ON” and also not work. May be some error in synatax, i don’n know.

That is something different than the REST API.
This thead may help:

Yes, thanks, this is what I was looking for.

1 Like