Smart Home (part 3) – Schedule

It takes almost 2 moths since my last article about Smart Home app. It is a lot of time and also a lot is changed in my app. Application is working fine but I had one problem. I have an electric heater connected via S26E in my bathroom. I would like to turn it on one over before I get up and then turn off when I finish morning bath.

This problem was so frustrating that I decided to resolve it as quickly and simple as possible. This was the reason to create Schedule Module in my application (new version of application – 1.3.0 is available on github).

Schedule Module has some basic assumptions:

  • schedule is based on simple actions
  • each action has:
    • type of action: Turn On/Turn Off
    • day of action: multiple choice of days of week
    • time when action should be executed (hour and minute)
  • each action could be: Deactivated or Activated
  • each action could be Deleted

So first change is that in main screen – List of device, icon Info was changed to dropdown menu, menu you can choose option: Details (the same functionality as Info icon had) and Add Schedule option, which open add schedule dialog.

In that dialog you can: set type of action, day on which it should be execute and the time. After Save schedule you can find it on device details screen. In the right top corner you can find Watch icon with information about numer of set schedules for that device. Click on that icon opens panel with List of schedule.

On that screen you can also Add schedule using proper button on the bottom of that panel, but also you can Activate or Deactivate single schedule. If some of schedule is not necessary you can Remove it.

On backend side of application I created Schedule Worker, which is responsible for checking every minute if there is any schedule to execute. Every schedule has information in database about time of last execution.

And that is all. Now I can sleep well and every they when I get up and go to bathroom the electric heater is on.

I know that this functionality is less configurable than Ewelink application, but I have full control on it. For me is enough, but maybe for you not. If you would like to participate in that project I’am open for cooperation and new ideas. Do not hesitate to contact me.

Smart Home (part 3) – Schedule
Przewiń na górę