Setup your own openhab-cloud (myopenhab) server/instance

Ok, after using Firebase the first time I could now understand your post :wink:

  1. login to Firebase with “normal” Google Account
  2. add a project
  3. add a mobile app
  4. in the properties of that mobile app there is the “cloud messaging”-Tab with ServerKey and SenderKey
  5. modify config.json like Joe_Lawrence describes:
    Jid = Your_Sender_Key@googleapis.com
    Password = server key

Now my device is listed in the openHABCloud web page and also the Information of the mobile app looks OK.
A am able to test a Pushup message with the openHABCloud web page.

Unfortunately my rule doesn’t send me a message. Any ideas?

rule "Test Push Notification"
when
	Item temp_nursery changed
then
	logInfo("TPN", "before sendBroadcastNotification")
	sendBroadcastNotification("Hello world!")
	logInfo("TPN", "after sendBroadcastNotification")
end

Found a solution for my problem.
I needed to deinstall “Pushover Action”.
Now the PushNotifications are working fine.

@ryandetzel great tutorial and very simplified, many thanks for that.

Isit possible to connect the created instance to 3rd party service like Amazon Alexa, IFTTT, …etc.?

OMG great tutorial!!
But I wonder how openhabcloud store its users’ information?
Like where it store the users’ email name and password?
I’m not a developer. Although I’ve read all the code on github page but I dont understand
Can anybody explain ?

Hi Felix,

sorry for this dumb question. What steps are required to “add a mobile app”?
I’ve found something like “add firebase to my android app”, but as soon as I click on this it asks for package name and SHA1 value :wink: Sorry I am lost

Stefan

Followed this tutorial and have everything running, except I cannot get the mobile app to connect to my OpenHAB Cloud remotely. I keep getting “SSL Handshake failed - maybe you need a valid client certificate”.

I’ve tried quite a few things, found a few similar posts but nothing i’ve done has worked. I can access the server on a mobile device remotely using chrome, and the app works locally.

My Setup
-OpenHab 2.1 on windows machine at home (no authentication or SSL via server IP&port)
-OpenHab Cloud running an Amazon Litesail instance (Ubuntu) (HTTPS Domain)
-Both linked and communicating great

I’ve tried enabling “Ignore” boxes in the android app
I’ve used “openssl pkcs12” to generate a .pfx key and imported it into the app. No Luck
I’ve ran a SSL Lab test and removed the ciphers that caused a B result. Everything is now an A
I’ve tried everything I can think of and every solution I could find.
I also don’t see anything in the nginx error.log

I’m not sure if this in a app issue or server setup so I though I would post this here. Seems a few people are having the same issue and haven’t been able to solve, or haven’t posted a solution. Maybe I’m missing something simple…

SOLVED:
The ssl-ciphers list in this tutorial did not work for me with the android app. I made a post about this and have now figured it out:
https://community.openhab.org/t/ssl-handshake-failed-maybe-you-need-a-valid-client-certificate/38080

Did anyone get the Alexa-Skill working with a self hosted instance of openhab-cloud?

I followed the official instructions on https://github.com/openhab/openhab-alexa and created all AWS/Alexa-stuff like in this article https://heathpaddock.com/2017/02/02/making-amazon-echo-alexa-sing-to-openhab2/

The REST-API is fully working on my own openhab-cloud instance and I can access it via a webbrowser with my credentials (BasicAuth)

Therefore I tried also to use BasicAuth in the lambda-node and configured the config.js with the userpass-option. Unfortunately, Alexa cannot find any device. In the lambda-logs it says the request ended prematurely and displays an error. Either the BasicAuth is not working correctly by just uncommenting the userpass line or OAuth2 is required for the Alexa-Skill to work.

Does anybody know how to configure the Alexa-Skill to use OAuth2 with a self hosted openhab-cloud instance?

Hi, spent all yesterday trying to do THE SAME.

I think the problem is that the lambda function uses message payload version 2 which is depricated for newly created alexa skills.

Thanks for your reply.

This can really be the problem as only payload version 3 was choosable for me today. Then I’m going to wait until the lamba function supports v3.

@jbr27 Is there anything that has to be configured to enable basic authentication against openhab-cloud or is it enabled by default?

I think it is enabled by default since I can connect to https://youropenhabcloud.tld/rest/items and view the json-data with my prior registered credentials.

EDIT:
I researched a little bit and found a migration guide to convert payload v2 to v3. (https://developer.amazon.com/de/docs/smarthome/smart-home-skill-migration-guide.html)

According to this guide the skill has to be completely rewritten because of the drastic changes.
As in v2 one item had only some simple actions in a list like “turnOn”, “turnOff” or “setPercentage”, version 3 introduces so-called “Controllers” like “Alexa.PowerController” and “Alexa.BrightnessController” with different capabilities.

It is really not impossible but will require some man hours.

In conclusion: at the moment it is not possible to use the existing openhab-alexa code for “new users” as amazon disabled the creation of new alexa skills with payload version 2. People who created a skill earlier with payload version 2 can rename it in the developer interface and use it with the existing code.

1 Like

hi all,

still hope that somebody can help me :wink:

In the enumeration above:

login to Firebase with “normal” Google Account
add a project
add a mobile app
in the properties of that mobile app there is the “cloud messaging”-Tab with ServerKey and SenderKey
modify config.json like Joe_Lawrence describes:
Jid = Your_Sender_Key@googleapis.com
Password = server key

Can someone point me to the right buttons for step “add a mobile app”?

Thx
Stefan

Hi Stefan,

sorry for the late answer.
I have no idea how to describe it in a better way.
Open: https://console.firebase.google.com/ -> add Project -> add App -> open properties
Maybe the following picture will help you?

I thought I reference my howto here: Tutorial: Own openhab-cloud and GCM / notifications (Firebase)

Maybe this is helpful for you, with a litlle trick it is possible to enable the v2 Radio Button Link

1 Like

Thank you very much!

Now the Alexa-Skill is fully working with my self hosted openhab-cloud :).

Wonderful! I’ll give it a shot tomorrow. I currently don’t have access to my vps, as the Hoster is patching the servers :grimacing:

Is the notification to mobil phones working if you setup your own openhab-cloud?

This is the only downside, no it isn’t. I could not find any documentation on how to configure it. But it isn’t that important for me, most of the notifications i need, I get from Apples HomeKit implementation i have configured with node red (garage door, windows, alarm system).

Hi,

Thought I’d provide a bit more information from the iOS side of things… the short version is it’s not a simple thing to get working.

In order to get push notifications to iOS devices, you need to be a member of Apple’s Developer Program. Then you could request an APN (Apple Push Notification) certificate and key that you’d place in the certs/ directory of the openhab-cloud application. This cert would be linked to a specific application id, which means you would need to recompile the OpenHAB client of iOS with that application identifier (since the official app is already using its identifier to receive notifications from the official cloud service).

It’s likely easier to use an app such as PushSafer or Prowl, or just send emails to your provider’s SMS gateway.

Hope this helps!

2 Likes