Best way to quick schedule an activity from android?

i see HabDroid doesn’t provide a way to set a simple timer or schedule an activity
(e.g:

  • turn OFF light in 1 hour,
  • turn ON AC at 6:30pm,
  • etc)

what’s the easiest methode to do this from android?

thanks

In fact, in openHAB there is no easy Set-Timer widget at all, instead you could use CalDAV-Binding to set timers with i.e. Google Calendar.
If you want a solution directly from the UI, maybe this link would help to implement.

i use a few dimmers for timers (limited to 100 minutes, or you can make each level a 5minute etc interval, allow for more). I have a rule run every minute and if the dimmer is greater than zero, decrease it, if it is now then zero, execute something.

for off at certain times, i have a bunch of switches, I just use it for my sons tv. swKidsTvOffAt2000, swKidsTvOffAt2030, swKidsTvOffAt2100 etc. Then just rules run at those times via and check if they are on, and if they are, turn off the tv.

Its not ideal, and requires you to set this up before hand. But it does work (and I only need it for my sons tv, so far…)

This is true. For the most part, OH easily supports cases where you define a behavior a priori (e.g. when the light turns on after dark turn it off after one hour) but it doesn’t easily support scheduling things on an ad hoc basis (e.g. setting a light to go off in an hour from the User Interface (UI)).

Philosophically I think this is because the developers of OH approached their designs from the perspective that a Home Automation (HA) system should primarily be about automation, not control. For example, the home should just do things based on events and not require one to manually control things from a UI. So any use case where the user needs to set a timer from the UI and why the Alarm Clock example @Udo_Hartmann linked to is so involved.

But as that example shows, there are always methods to make it work. You can implement voice control and rules that are smart enough to understand something like “turn on the living room light for an hour”, send a specially formatted email, PushBullet, text message, etc. to OH which then parses the message and performs the action, create some setpoints on your sitemap, one for each light which you can set the number of minutes to keep it on and then rules to count down until they turn off, etc. There are many ways to do this but they all involve:

  1. Get a message to OH telling it how long to keep the light ON
  2. Write rules with Timers to turn the light OFF at the indicated time

That being said, might I recommend thinking about your use cases. Do you really want to have that much manual control over your HA? Or would the system meet your same intent if you replaced your manual control with event based controls that do not require manual intervention. For example, rather than needing to set the AC to go on at 6:30pm manually would writing rules that turn on the AC 30 minutes before sunset on weekdays but only when you are home meet the same intent? Would it fit your desires to automatically turn your lights off after an hour automatically? Ultimately this approach to HA is going to be easier to implement and easier to use with OH.

Thanks for all responses and suggestions.
What I’m thinking is that it doesn’t have to be the OH that do the timing/scheduling, but let Android (UI) do the job.

For example, I’m using a Tasker task to tell my TV to go OFF in 1 hour, so…
profile: time 60min
task: call URI (openhab://sitemaps/home/home?item=TV&command=TOGGLE)

While this might work, Tasker itself isn’t easy nor intuitive :).
I’m hoping that there’s faster method (preferably from HabDroid) to set time and then choose an item and action to be executed.

Thanks again

You might look into IF and DO. Using my.openhab you can connect your OH up to IFTTT and set up DO recipies that updates the indicated OH Item after so many minutes after the button is pressed.

Agreed with the proposal of using ifttt and DO android app coupled with myopenhab,
I’m using this system on my setup and it is working quite well. The good point is that with IF you integrate your smartphone as a sensor to your HA system (using its GPS for instance).

Nevertheless with one year practice with HA I advocate that the best thing is to manage action related to events and not action with a schedule.