Android notifications not working with myopenhab

Since moving to the new myopenhab.org, my phone isn’t receiving notifications. I’ve reinstalled the app, and can connect to my openhab server and turn items on and off, and I see my broadcast notifications appear in the online notification list, but the phone doesn’t seem to register itself as a device with the myopenhab.org service at https://myopenhab.org/devices.

Any ideas how to debug?

(This is solved in post #15, but the solve link doesn’t seem to be working)

Did you make sure to connect remotely to the cloud? F.e. by turning off Wifi? The device will not be registered as long as you are on a local (wifi) connection …

My phone is actually connected from a different wifi network to the one that my openhab server is running on.

If I turn off wifi altogether, it won’t connect using the app, even though with wifi still off I can get to myopenhab.org in the browser. So I’m now even more confused!

Hmmm, that looks like a network problem … I only have one network at home so am not of any help on this one.

Not a second home network, just my network at work. Seeing as I can control the status of items (checked the logs remotely to make sure it took) from my phone when connected, I’m not worried about it being able to connect. The only thing missing is the notifications.

Okay, so it is actually the “normal” use case.
Then the only thing you can do is verifying a second/third/fourth time that you have the right UUID/SECRET/Username/Password … because

Sure, because you are on a mobile data connection I guess …

The uuid and secret must be right because the server successfully broadcasts notifications to myopenhab, I see them in the list, and myopenhab reports the server as online. My username and password on the phone must be right because I can connect to myopenhab and update items, which does get reflected to the server. It’s just the notifications that aren’t working :frowning:

Hi

I have kind of the same issue, iIcan access things as I expect from myopenhab and send a message to my device from myopenhab. But if I use sendBroadcastNotification or sendNotification from a rule I haven’t changed after moving from my.openhab I get nothing…

Hi Thomas,

i had the same issue. For me it solved itself after some hours without doing anything. (see here)
I would suggest to wait a little before you dig deeper.

Did your devices always show in the devices list on the website? The problem I’m having is that the devices don’t seem to be registering at all.

Yes mine showed up from the beginning.

Unlikely to be the same problem then. And I really can’t work out how to debug, because everything appears to work apart from it appearing in the devices section of myopenhab.

If I get a chance I’ll try and figure out why it doesn’t work on mobile data for the two different phones I’ve tried it on now. Maybe the issues are related?

Is there any way for me to get access to the logs from the server side for my account?

Following. I’m having the same problem. The notifications show up in my openHab.org, but do not get pushed to my phone (Android). Nothing showing up in the logs.

OK, for my problem, it seems I hadn’t set up the remote url. Set that if you want notifications to work, or for access on a mobile network to work.

I don’t plan to connect direct to my server over my lan, as all I really want it for is the notifications, so hadn’t set up a local lan address. My server address was https://myopenhab.org, I didn’t have a remote server set.

It turns out, that the app will automatically use the remote server when not on a wifi network, which is why mine wouldn’t connect. After setting remote server to https://myopenhab.org it works. With a remote url, I guess it also triggered code to subscribe to notifications, so now my device is registered as well, and my notifications are working as expected.

It might be worth looking at how the app registers for notifications and how it chooses which url to use, from a high level perspective, to make it more consistent.

Not sure if anyone else can replicate my problem.

I have the android app set up for remote server only e.g https://myopenhab.org. When i create a rule to sendBroadcastNotification() it logs successfully in the notification history but there is no notification on the phone.

If i run the same rule but unlock my phone and have the screen on my phone gets a notification.???.

My phone has android 7.0 so don’t know if it’s an issue with the android app and android but it seems strangle it on works when my screen is on. I have even removed the security pin and same thing happens. No notification when screen is off, a notification when screen is on!.

Sorted.

Turns out it was due to battery optimization on the phone. Once openHAB app was added to the whitelist to ignore closing background processes it worked.

1 Like

Hi,

I’d like to revive this thread as I don’t receive notifications on my android phone as well (BUT the notification items are all visible in the openhab android app under “Notifications” menu). I am running my own openhab-cloud instance on Linux ARM.

What I’ve noticed (and I must admit I have no clue what this is):
In the app I click on “About” and then open the tab “openhab information”. Here I see:

Google Cloud Message Status
Device registration failed

What is the Google Cloud Message service and how do I fix this?

Stefan

no one? should I create a new thread for this issue?

Hi @StefanH I also had some problems at the begining (using the official myopenhab server). I remember that in the guideline somewhere was mentioned that you have to approve openhab or myopenhab as trusted application, as the application has then somehow access to your google account to be able to send you notifications. Did you followed the guide? Maybe you can try with the official server to check if it works there…

I tried to quickly search for details but don’t have much time… but I found in my account that you should also switch to allow less secure applications https://myaccount.google.com/lesssecureapps