What tasks do you automate with Tasker?

hey, i am a beginner here and was looking for the same. thanks all for your responses. it was helpful for me.
best regards!

The openHAB app makes use of AlarmManager: https://developer.android.com/reference/android/app/AlarmManager.html

This class provides access to the system alarm services. These allow you to schedule your application to be run at some point in the future.

AlarmManager is the way to set up alarms, so I guess Sleep as Android uses this API. Smart Period is something non-standard, so I guess this wonā€™t work.

You are fully right, i have tested it.

That should be no problem in my usecase.
I needed a time before the alarm goes off and this was the solution so far.
When openHAB knows about the time the alarm will go off, i can build my own smart period. :slight_smile:

So can start doing some wake up stuff in openHAB now.

Anyways:
Tasker can fetch somemore stuff from sleep as android, so i am sure that i will find additional usecases for a sleep as android to openHAB bridge with a OH Tasker plugin. :slight_smile:

Correct me if Iā€™m wrong, but this pretty much assumes only one user can have an alarm that OH will react to. For example, if you have a couple who work different shifts they might have vastly different alarm times and might also have different routines. But if I set up this AlarmClock Item there will be no way to distinguish between the two. Only the latest one to have been changed will end up in AlarmClock.

If Iā€™m correct, Tasker integration could be a way to manage this use case.

You can configure the item name that is used within the app, so you could easily add an item per person you want to watch the alarm clock.

Of course you would have to implement a logic, that decides which alarm clock should be used for a possible wake up logic.

I could not find a setting for that anywhere. Is this a feature not yet released outside of beta? Iā€™m currently running 2.6.9 which is the latest version I see in the play store.

Being able to configure the Item name indeed would allow for the handling of different users.

Maybe I need to get on the beta channel for the Android app.

1 Like

Correct. Itā€™s a Feature of the beta app.

2 Likes

Itā€™s not available in the stable version yet. You can add an item name prefix, e.g. ā€œRichā€ => ā€œRichAlarmClockā€. If we add other things to upload, e.g. battery state, you donā€™t need to change the item name itself.

3 Likes

Cool, Iā€™ll have to give this some thought. Thanks for investigating it while I was asleep, folks!

I would be interested in the day of week logic. I am digging into it currently.

Itā€™s pretty simple as I only need a work day flag so I have a profile using the Day state and selected Mon-Friday. The entry task sets %RLK_WORKDAY and the exit unsets this variable. If you need something more interesting you should be able to create additional profiles for each day type and create a DOW variable that getā€™s set like the time of day.

Iā€™ve shared the time of day and work day profiles: https://taskernet.com/shares/?user=AS35m8kUuK3OLwOeerzwoTliAX%2B%2FTPWRXm474S3LSRumiYN32eEodwHjMBursvN2IFK1&id=Profile%3AWork+Day+State

1 Like

Yes, i am looking for a bit more logic for my case.
I am wokring on fridays only until noon, so i will have to split the friday.

Week and weekend should be straight forward and i already used the way you described.
Thanks for the reply and for the share anyways. :slight_smile:

That shouldnā€™t be hard. Set up your profile with a Day state and only select Friday and use the same task(s) as you do for your work day. Then add a Time state to the profile for monring until noon. Then set the exit task to be the same one you use for your weekend state.


https://taskernet.com/shares/?user=AS35m8kUuK3OLwOeerzwoTliAX%2B%2FTPWRXm474S3LSRumiYN32eEodwHjMBursvN2IFK1&id=Profile%3AFriday

Unlike in OH where the Rules language where it seems best to use as few Rules as possible and writing generic code, Tasker seems to be easier to use with lots of profiles that call the same tasks instead. Itā€™s not worth the effort trying to make one Profile that does it all, just create a new profile to handle the special cases. You can organize them into projects to keep them together.

Also, unlike with OH, States/Events that trigger a profile in Tasker always use AND, not OR. So the above works because it must be Friday AND between midnight and noon.

NOTE: the profile doesnā€™t show as active because I forgot to hit the check mark to activate changes before taking the screenshot.

Hereā€™s the first version of the app with plugin: https://github.com/openhab/openhab-android/pull/1338#issuecomment-489307359

3 Likes

There is a issue with the alarmclock thing innthe beta app. It is not working if you are using tasker! It obvious has a problem with the activated tasker app. If I am deactivating tasker everything works fine.

It might be that the problem is that you are using the tasker setting ā€œUse Reliable Alarmsā€. As far as I can make out that set an alarm every minute. If you turn this setting off, you can probably use the beta app and tasker at the same time.

However, ā€œUse Reliable Alarmsā€ has some benefits for tasker especially if the screen is off. I found the following workaround. You can also use this with the standard openhab app, or without the openhab app. I installed the app AutoAlarm (Not free) . It provides a plug in for tasker. With this plugin you can get information about the next alarm in tasker actions. You can even get the same functionality as the beta app by adding the tasker variable %TIMES to the AutoAlarm variable %milis using a Variable Set action in tasker. You can then post the result to an openhab item of choice using the first command-line REST api. If you do this while the screen is on, you avoid the reliable alarm problem.

Do note that AutoAlarm only finds the next alarm. If you snooze sleepasandroid, that means the next alarm is in 10 minutes, not the next day at your designated wake-up time. You can accommodate for this by only sending your wake-up time to openhab once you have dismissed your alarm.

1 Like

The Tasker action plugin is now in beta.

7 Likes

Thank you for the update.

When I try to create a profile using the State context, I cannot see all my items like Smoke Detectors, Water Sensors, Temperature, etc.

New items are shown without problems. The only issue is with the deconz items. It is very important to trigger a profile when smoke is detected.

Do you need any information?

With the current Tasker plugin you cannot listen for item updates, you can only send item updates.