Heaty will die, Schedy be born!

Thanks Rene,
I thought that too and moved everything to the apps folder, but I am getting

2018-10-30 23:10:28.222268 INFO AppDaemon: Initializing app internet using class SchedyApp from module hass_apps_loader,
2018-10-30 23:10:28.223353 WARNING AppDaemon: ------------------------------------------------------------,
2018-10-30 23:10:28.223413 WARNING AppDaemon: Unexpected error initializing app: internet:,
2018-10-30 23:10:28.223457 WARNING AppDaemon: ------------------------------------------------------------,
2018-10-30 23:10:28.223652 WARNING AppDaemon: Traceback (most recent call last):,
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 2040, in check_app_updates,
    self.init_object(app),
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1565, in init_object,
    self, name, self.logger, self.error, app_args, self.config, self.app_config, self.global_vars,
  File "/conf/apps/hass_apps/loader.py", line 28, in _proxy_loader,
    app_mod = _import_app_module(app_package),
  File "/conf/apps/hass_apps/loader.py", line 24, in _import_app_module,
    return importlib.import_module(mod_name),
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module,
    return _bootstrap._gcd_import(name[level:], package, level),
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import,
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load,
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked,
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked,
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module,
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed,
  File "/conf/apps/hass_apps/schedy/app.py", line 14, in <module>,
    from . import __version__, config, util,
  File "/conf/apps/hass_apps/schedy/config.py", line 9, in <module>,
    from . import actor, schedule, util,
  File "/conf/apps/hass_apps/schedy/actor/__init__.py", line 7, in <module>,
    from .base import ActorBase,
  File "/conf/apps/hass_apps/schedy/actor/base.py", line 13, in <module>,
    import observable,
ModuleNotFoundError: No module named 'observable',
,
2018-10-30 23:10:28.223701 WARNING AppDaemon: ------------------------------------------------------------,```

hmm, i am not a docker user myself, but i think you need to add libs you want to use to the docker config and rebuild it.
i think observable is such a lib (because its no file from schedy if i look at the files)

Yes I figured so, I should be doing a pip install observable inside docker, but I have no idea how to do this from docker-compose or from portainer. Time to do some research.

1 Like

At least in the development branch of AppDaemon you can define requirements in a file named requirements.txt and the docker start script will search for such files and run pip install --upgrade -r requirements.txt. Don’t know what docker image you’re using, but if it’s based on the dev branch (probably isn’t) adding observable should be easy.

Otherwise, download the observable package from pypi manually and copy the observable directory from the archive over to your apps directory as well. That’s not nice, but until AppDaemon get’s the requirements.txt parsing released it’s the easiest way.

This is the approach i have adopted - the steps are also documented in the ‘heaty’ documentation (Which i have now rolled back to)

@DamianFlynn The installation documentation is for the whole hass-apps, not just Heaty or Schedy. And since the last release I removed this workaround in favour of the python_packages setting of the hassio appdaemon add-on. Of course this doesn’t work when using the plain appdaemon docker image.

that worked, thank you.

Hi @roschi,
would it be possible to use schedy with the new service homeassistant.update_entity?

I would like to use some google maps travel time sensors with a really high scan_interval and only update them then on demand.

Schedules and conditions could look like this:

entity: entity which should get updated : example: sensor.google_travel_time
  schedule:
   - interval: 5
     start: "7:00"
     stop: "10:00"
   - interval: 2
     entity: input_boolean.isHome
     state: "on"
   - interval: 15

Hi @eifinger

I’m not sure what these sensors do or how they work. However, calling a service with different values at different times is indeed possible. I recommend you read the documentation and try to use the generic actor type.

Best regards
Robert

1 Like

@eifinger I actually think it’s not possible the way you try to do it. You could create an input_number storing the desired interval (or a value to represent it) and account for different values of that input_number with one or more HA automations.

You can then control the value of that input_number with Schedy and its generic actor type.

Isn’t it possible to just set the scan interval with a service call? If so, you could skip the input_number stuff and just control the scan interval with Schedy.

I couldn’t find a service call to do that =(

How do you control the scan interval at all? And how is the currently configured interval exposed? As a state attribute?

It was in the release notes of 0.80 that you can set the scan interval in most of the platform configurations: https://www.home-assistant.io/docs/configuration/platform_options/#scan-interval You can manually trigger a scan via the homeassistant.update_entity service call.

Based on this I had the idea of an App/Automation which calls this service in a given interval and I schedule the interval just like you can schedule the temperature.

I think your approach to control an input_number with schedy and use that input_number as the interval in which an App/Automation calls the service is feasible.

I don’t quite like the extra entity in homeassistant and would prefer just an Appdaemon App and a configuration for that, but it’s definitely a first step.

EDIT: I don’t think the scan interval is an attribute which you can get/set

Would it be possible to use the generic actor to call a method in another Appdaemon app? e.g. MyServiceCallApp.setInterval(x)

No, what that actor type does is clearly stated in the documentation: call a service with some value. You’d need to use the custom actor type for this, but I don’t recommend it because it’s a little weird to set up for communicating with another AD app.

You’ll need an entity representing the scheduled value anyway in order for Schedy to understand the current value and whether it needs to be re-scheduled or not.

Totally agree, I will go ahead with the input_number implementation and will report back my results. Thank you very much for your input and patience!

Ok, get back and ask if you face any problems.