Expose items to cloud from 2 properties

I have two instances of openhab2 running, each in different houses. I have 2 myopenhab acounts, one for each house.
And 2 sitemaps, one for each house.

i would like to remove / delete one of the myopenhab accounts as I am aware that the number of myopenhab users is growing and I think two accounts are unnecesary.

i have googled for some time but can’t find an answer to how I can integrate the two houses into one sitemap… or easily switch between sitemaps from different accounts on habdroid.

It seems that some people use MQTT with a satellite broker to communicate between properties, I have also read that I could apply the same UUID and Secret to both openhab instances so that they use the same cloud account as long as all exposed items have unique names.

however, I am still unclear as to how I would connect the items into one sitemap?

stu

I may have a solution but would appreciate some input from the more knowledgeable members.

House 1 and House 2 both have openhab2 instances running but all item names are unique

House 1 and House 2 share the same secret and UUID and connect to one openhab cloud account.

Each house has its own sitemap and I use the habdroid menu to select sitemap.

But I don’t want to control houses across the internet if I am sat inside the house and connected to the local network…

SO… Both houses will have the same subnet and IP, port address for openhab2. I will enter the local IP and port into habdroid settings and then it will decide whther local control is possible depending on which sitemap I call upon?

Will this work?

Stu

If you want the Item from both houses on one sitemap the only approach I know of is to use the MQTT Event Bus configuration where the Item states from one OH instance gets forwarded to the other instance of OH. Then you can have the one sitemap served from one “Master” OH instance, or you can have both instances be a peer of the other and have each serve out their own sitemap with Items from both instances.

Your second approach sounds like it could work, but you will only have access to both houses when not on either house’s LAN in that configuration. When you are on a LAN, your app will only be able to see the sitemaps served by that OH instance.

Thanks Rich, makes sense - i knew it sounded to easy to be true… most of the items that I wish to control are MQTT anyway. I just like the fat that I trusted the openhab cloud and didn’t really want to open extra ports myself for MQTT as I don’t know much about security. I will look into how I will send MQTT msgs from one house to another over the net.

S

Should I use a service such as cloudmqtt to act as a middle bridge between both instances of opehab (which each also have their own local broker)… or should i use myopenhab.org which apparently can parse the mqtt msgs through the rest API?

S

Using a cloud mqtt is a good choice but only if you can use your own certs and set it up encrypted.

I do not think you can proxy mqtt through myopenhab.org, only OH’sv REST API, which is not the same.

Ok thanks… security for Mqtt is starting to sound quite complex but I will look into it.

I thought myopenhab.org was what makes the rest api available.

Do you know how I would use the rest api method to deliver a few item states to another openhab image?

I actually only have 5 switches and a temperature reading that I want to integrate with my main sitemap.

This would all be easier if I could have two versions of habdroid on a device but this can’t be done

It does but mqtt has nothing to do with the rest API. It is completely separate.

You would have to write roles to make HTTP calls to publish the commands and updates from one OH to the other. You can install the interactive rest API docs listed under UIs or Misc I think to see how to make the calls and experiment.

You would then use the HTTP binding or the send http Actions.

can you set up a VPN between your houses?

Thank Rich for the info - my logic tells me that if I go down the route of using the same UUID and Secret for both openhab installs - as you pointed out - I will only have both sitemaps available when I am connected to the net ‘outside’ of either LAN. When I am at one house and connected to the LAN - only that sitemap will be available. I can live with this…

However - notifications (via habdroid and cloud) pushed to my android device are essential and my logic says that my android device will still receive notifications from ‘both’ openhab instances regardless of my being on ‘one’ local network?

Sorry to keep asking the questions, normally I would just try it but I am unable to setup 2nd home for another few weeks until I go there!

@Olymp - yes, I spent a few hours last night looking at openvpn and trying to understand the setup procedure - lots of certificates and config file editing! But this may be the route i go…

Stu

I’ve no idea. You are the first person to propose such a setup on the forum. We eagerly await the results of your experiments.

Ha, thanks rich.

This is the lazy solution as myopenhab.org will take care of the secure connection but I will need to turn wifi OFF on my device and use my mobile data to see the remote site.

Will be testing in a few weeks.

Stuart