Vacation mode

@Mohlsson , thanks for the app. I’ve installed it according to your instructions and set up the yaml file, but AppDemon is reporting a compile error - any idea what might have gone wrong?

The error log in AppDemon shows:

2021-07-30 21:06:34.993525 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/replay_lights.py
2021-07-30 21:06:35.012090 WARNING Error: ------------------------------------------------------------
2021-07-30 21:06:35.013133 WARNING Error: Unexpected error loading module: /config/appdaemon/apps/replay_lights.py:
2021-07-30 21:06:35.013846 WARNING Error: ------------------------------------------------------------
2021-07-30 21:06:35.020016 WARNING Error: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 963, in check_app_updates
    await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 299, in run_in_executor
    response = future.result()
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 755, in read_app
    self.modules[module_name] = importlib.import_module(module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/appdaemon/apps/replay_lights.py", line 2, in <module>
    import pymysql.cursors
ModuleNotFoundError: No module named 'pymysql'
2021-07-30 21:06:35.020896 WARNING Error: ------------------------------------------------------------

This error is because changes to enable MariaDB requires PyMySQL to be installed even though it is not used. Even if you are not using MariaDB, try installing it as noted in the last paragraph in the readme.
/M

Bingo, thanks missed that.

One more question, I have lights in groups, do I need to exclude the groups or individual lights or is ok for both to be active?

I have my lights in groups but my light switches operate on individual lights, I really haven’t tried group actions. I guess light activity is stored separately per light in the database so the light activity when replaying should be triggered per light. Give it a try and if it doesn’t work it may be possible to do some changes.
/M

Oh I forgot, to see what actions has been scheduled check the Supervisor/AppDaemon/Log. All scheduled actions will be shown there even if they are not triggered.

OK, thanks that’s great. For now I’ve excluded the groups and looking at the log it looks like that will work.

Thanks for the help.

Thanks for the work on this. Any chance could be modified for include as opposed to exclude? Would be nice to just put lights in a group and config app to use that group as opposed to excluding every switch not desired. Especially helpful when you add new switches and all of a sudden they are going off and on unintentionally.