openhab / openhab-android

openHAB client for Android
https://play.google.com/store/apps/details?id=org.openhab.habdroid
Eclipse Public License 2.0
598 stars 317 forks source link

Enhanced Actions onClickAction ui and https not working #3755

Closed Mark-VG closed 1 month ago

Mark-VG commented 1 month ago

Hi

This has been reported as follows:

https://community.openhab.org/t/openhab-cloud-push-notifications-not-working/140571/110 https://community.openhab.org/t/oh4-2-0-notifications-with-android-app-actions/157204

Actual behaviour

I can get the command action to work successfully to turn ON a light, however I have not been able to get the ui and https Actions to work.

Using:

actions.NotificationAction.sendBroadcastNotification('***Gate has Opened! ***','presence','MvGTest','Gate Action','refID','ui:navigate:/page/OverviewOLD','null','null','null','null');

Results in the APP opening and the old default site map being displayed.

Using:

actions.NotificationAction.sendBroadcastNotification('***Gate has Opened! ***','presence','MvGTest','Gate Action','refID','https://openhab.org','null','null','null','null');

Seems to produce no result as not even the APP opens.

Expected behaviour

The click on actions to produce the correct page or url

Environment data

Client

Server

florian-h05 commented 1 month ago

For reference https://github.com/openhab/openhab-webui/pull/2622/files made the UI‘s command Item handling available to the apps. This is required for the Android app to handle the ui: command syntax

Mark-VG commented 1 month ago

I have now manually installed Android APP 3.15.2 and I am running openHAB 4.3.0 Build #4192 which should include the changes?

Still seeing the following (running via inline script in Blockly):

Opens APP to default SiteMap

actions.NotificationAction.sendBroadcastNotification('***Gate has Opened! ***','presence','MvGTest','Gate Action','refID','ui:navigate:/page/FloorPlanTest','null','null','null','null');

Doesn't open APP:

actions.NotificationAction.sendBroadcastNotification('***Gate has Opened! ***','presence','MvGTest','Gate Action','refID','https://openhab.org','null','null','null','null');
mueller-ma commented 1 month ago

Can you test https://github.com/openhab/openhab-android/releases/tag/3.15.3-beta ? Both issues should be fixed there.

Mark-VG commented 1 month ago

Hi

I updated to 3.15.3-beta as requested.

How I can get the ui action to work perfectly:

actions.NotificationAction.sendBroadcastNotification('***Gate has Opened! ***','presence','MvGTest','GateAction','refID','ui:navigate:/page/FloorPlanTest','null','null','null','null');

However the https action stil fails and doe snot opent he app at all:

actions.NotificationAction.sendBroadcastNotification('***Gate has Opened! ***','presence','MvGTest','Gate Action','refID','https://openhab.org','null','null','null','null');
mueller-ma commented 1 month ago

https:// shouldn't open the app, but your default browser. Can you check if that's the case?

Mark-VG commented 1 month ago

https:// shouldn't open the app, but your default browser. Can you check if that's the case?

I have tried again and nothing opens at all. All APPS are closed, click on notification and it just closes.

mueller-ma commented 1 month ago

Your code is a bit hard to read, because of the function with many parameters. Can you try that code?

actions.notificationBuilder("Test message")
  .withOnClickAction("https://openhab.org")
  .addActionButton("Website", "https://openhab.org")
  .send()
Mark-VG commented 1 month ago

Thank you. That just brings up the APP to the default sitemap.

Clicking on the Website button does nothing

mueller-ma commented 1 month ago

Can you try https://github.com/openhab/openhab-android/releases/tag/3.15.5-release?

Mark-VG commented 1 month ago

Can you try https://github.com/openhab/openhab-android/releases/tag/3.15.5-release?

Thank you. Works now. Appreciate it.