Link between an openHAB1 and another openHAB2 instance?

Hello together,

does anyone has an approach to tie two instances of different OH version together?
My idea would be to use the REST API to sync the two instances…

Any pointers or other ideas are appreciated!

Best regards, Guenther

Have a look for the MQTT event bus. A feature of openHAB 1 and still accessible on openHAB 2 with the MQTT1 binding (not v2)

1 Like

Why?? OH 2 has the OH1 compatibility layer that keeps us on Java 8. They are considering an option to remove that layer from OH3 and make it possible to link with OH2 to keep OH1 compatibility.

What is holding you back from moving to OH2?

Well these might well be different boxes, and why not leave a working system alone.

I would recommend an MQTT based approach as well. REST API is tied to openHAB version, I can’t think of any actual major OH1/OH2 changes, but who knows what OH3 may bring.
MQTT would be host independent, allowing you to upgrade one box without needing to make changes in the other.

2 Likes

Stability, performance, missing bindings. :disappointed_relieved:

Also possible with MQTT v2. See Marketplace MQTT Event Bus. If you are using JSR223, there is a library module you can use, MQTT Eventbus by rkoshak · Pull Request #257 · openhab-scripters/openhab-helper-libraries · GitHub.

There shouldn’t be any missing bindings. To my knowledge all current OH 1.x bindings will run on OH 2.

It is possible to mix and match the MQTT 1 event bus on your OH 1 and the above approach on your OH 2 instance.

IIRC, the OH 1 REST API may not be sufficient to provide a good federation between the two instances. But if it is, I suspect the effort to get it set up and working would be more than using MQTT.

NOTE: I federate two OH instances, one of which is 100 miles away.

1 Like