openhab / openhab-android

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

Accessing openHAB notifications when using automagic (similar to tasker) and use them as commands #1634

Closed andiwirs closed 4 years ago

andiwirs commented 4 years ago

Actual behaviour

I noticed some strange behaviour when trying to access the notifiction text coming from the openHab cloud using automagic which is similar to tasker. I would like to use the notifications to send commands from my openHab server to my phone, but when I parse them and show the content for debugging the message is always "0 new notifications" or in german "0 neue Benachrichtigungen". However the real message body is shown correctly in the notifications bar. The message title "openHAB" is being read out correctly. I tried with notifications from other apps and for some apps the notification is parsed correctly. So I assume the issue is on the openHab app side or at least can be solved there.

Expected behaviour

I expect to be able to parse the message that is being sent and not always "0 new notifications" while it is shown correctly in the notifications bar.

Steps to reproduce

Set up a tasker event on an incoming notification from openHab and try to parse the content and show it on screen or save it to a variable.

Environment data

Client

Android version: 9.0.0
Device model: Xiaomi Mi A1
Stock or customized ROM: Lineage OS 16.0 (official)
App version : 2.10.0
Build flavor : Play Store
Device language: German

Server

Server version: 2.4.0 M4
Reverse Proxy: No
Authentication method : None

openHAB Cloud

openHAB Cloud version: No idea
Self hosted cloud or myopenhab.org: myopenhab.org
Authentication method : User and password
andiwirs commented 4 years ago

I just noticed that this is not restricted to tasker. I have a Mi Band 3 and configured my replacement for the MiFit App (Notify & Fitness) to push OH messages to the watch. The messages arriving there are also "0 new notifications"

andiwirs commented 4 years ago

OK digging into the topic some more i found out that it is possible to access the notifications. It is just that there is one master notification und then as many sub-notifications as i received. I found a way that works acc. to my expectations, however it is not to nice... Closing this one :)