To send a status update to openhab if the timer alarm is going off on the android phone we need some tools.
First we need the openhab app installed and configured with the tasker plugin enabled
Second we need tasker
Third we need Automate to read notifications and, create a little logic.
Automate Flow (OnePlus tested)
I will explain the Automate Flow wich required some work develop. Since it is dependent to the OnePlus (a custom Android by the brand OnePlus) Clock App it will not work on every android. I’m not sure if the behaviour of the Clock App is the same across android devices. The basic idea is to wait for a timer notification which will show up if a timer is going off.
The Problem is that the timer shows a notifcation every minute to inform about the remaining time. Like “1 minute left”. In contrast to that the final notification which is shown when the timer is going off does not contain any text and is different from a text notification (mode Alarm). So we can easily wait for a notification (No branch) from the Timer that does not has text (Yes branch).
If we follow the Yes branch we reach the Send Command block wich sends the ON command to openHAB. The AlarmRinging is just a Item of type Switch in openhab. To trigger the send we use the “Plug-in action” block for tasker. Then we hit the second notification block which blocks until the notification is dismissed. With exit of the block we reach the second Send Command which sends OFF to openHAB and shows a toast. From there the flow goes back to the beginning to await the next alarm.
On openHAB we receive the commands as the following log shows:
From there you can add rules to apply your required actions for that conditions. In my case I just let a LED strip blink to catch additional attention.