Cant get push notifications to work

I have a rule that based on a switch is designed to test sending a push notification.

The rule looks like this:

rule "Test toggle"
when
    Item test_toggle changed 
then
    if (test_toggle.state.toString == "OFF") 
        {
        sendBroadcastNotification("test off")
        logInfo("test_toggle", "OFF")
        }
    if (test_toggle.state.toString == "ON") 
        {
        sendBroadcastNotification("test on")
        logInfo("test_toggle", "ON")
        }
    logInfo("test_toggle", "Through")
end

I have a connected myopenhab.org account, set up the service in openHAB and registered IOS device with the app.

When I toggle the switch to activate the rule, the log info details are shown and the rule looks to be working, however there is nothing happening on the mobile. No push and no notification within the app.

Can anyone advise on something I am doing wrong.

NB:
Running version openHAB 2.5.0 Release Build on Raspberry Pi 4
I can send a test push message from https://myopenhab.org/devices and it works fine

Thanks

Please use code fences

Code fences added. New to this so will do so from now on.

Do you see anything in the logs, particularly connection/disconnection or error messages?

How long do you wait? I’ve seen a significant delay sometimes when sending a notification.

In myopenhab.org, do you see these test messages in the Notifications tab?

I can’t see anything in the logs at all to do with notifications. I added the logInfo requests to ensure the rule was running as expected, but around the loginfo log entries there is nothing else to do with connection or notifications.

The message isn’t delayed, nothing has come through even after 24hrs. The test message I send from https://myopenhab.org/devices arrives on my phone within 10 seconds.

There is nothing in the notifications tab in the app or in the account area within myopenhab.org.

This is how I have openHAB Cloud configured within the paper UI - is this all correct?

Not with notifications, but you should see it connecting to the cloud server.

2019-10-22 10:08:08.705 [INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID =...

Search for/grep for log lines containing “CloudClient” and you should see if your OH is having difficulty connecting to the server.

I see, and yes I do have a log entry much like your example which shows that it has connected. This entry happened the last time I edited the config for openHab Cloud.

I rebooted my pi and now they are working. Must have been something gone wrong during the initial set up. Thanks

I have noticed this warning in my openHab log file. Any ideas what to do?

2020-02-20 21:14:44.611 [WARN ] [okhttp3.OkHttpClient                ] - A connection to https://myopenhab.org/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

I see this periodically. It’s benign and can be ignored. I can’t remember exactly what the cause is but it basically means a connection was lost prematurely or something like that.

1 Like