Heaty will die, Schedy be born!

I’m seeing this error in the appddaemon log

2018-10-05 22:08:26.084896 INFO AppDaemon: Initializing app schedy using class SchedyApp from module hass_apps_loader
2018-10-05 22:08:26.085504 WARNING AppDaemon: ------------------------------------------------------------
2018-10-05 22:08:26.085968 WARNING AppDaemon: Unexpected error initializing app: schedy:
2018-10-05 22:08:26.086370 WARNING AppDaemon: ------------------------------------------------------------
2018-10-05 22:08:26.087089 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 2040, in check_app_updates
    self.init_object(app)
  File "/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1562, in init_object
    app_class = getattr(modname, app_args["class"])
AttributeError: module 'hass_apps_loader' has no attribute 'SchedyApp'

Can I just check I am understanding this;

room:
  room_name:
    actors:
      switch.some-switch:
        schedule:
      switch.another-switch:
        schedule:

@baz123 You don’t run the version from the schedy branch. You either didn’t install it or didn’t restart AppDaemon.

The config’s structure is wrong. a room has a schedule and actors, actors have no schedule… Maybe read the chapter I wrote about the concept.

Ok thanks. Yes I had not restarted appdaemon. Somewhere I read it was not necessary but that will be after it has been restarted the first time :frowning:.

A comment on the structure, having a schedule per room means everything happens at the same time and also means that every actor has to be doing the same thing. If I have a thermostat and a switch in the room, they will have different values and need different schedules.

To control both, I’d need to create ‘virtual’ rooms.

Ah so I have it working sort of (added in an actor type).

I was expecting this to turn a switch off between the times and on otherwise. It is doing the opposite…

      schedule:
      - value: "off"
        start: "23:07"
        end: "23:59"
        name: Fancy Rule
      - value: "on"

[edit] Ah, Timezone is wrong. Logs in UTC and I’m on UTC+1

If you use the switch actor type, that should work.

Rooms are in fact a virtual concept to group actors that should behave identical together. It is also only one actor type allowed per Schedy instance… It’s all explained in the docs really.

1 Like

Hi all,

Apart from the custom actor type that probably will be used rarely anyway, the documentation is complete.

I’ve merged Schedy over to the master branch, hence the usual installation instructions for the development version as written in the docs now count for Schedy as well.

The latest docs are at https://hass-apps.readthedocs.io/en/latest/

You may now switch over from Heaty if you like.

Best regards
Robert

I am finding a problem with the Timezone.

My local time is 10:50 (UTC+1). Using this schedule, the switch is set to ‘off’ on initialisation. If I change the on time to 09:36, the switch initialises to ‘on’

      schedule:
      - value: "on"
        start: "10:36"
        end: "23:59"
        name: Fancy Rule
      - value: "off"

I have tired this loads of different ways. I have set the timezone in AppDaemon to UTC.

I have checked on Timezone settings here.

Schedy seems to be working to the same time as the log timestamps (which are UTC). I’m not sure if these should be local or UTC which may point to my problem.

I have just done a pull from master branch.

Then your system time zone is probably wrong. Please run

date

and post the output. If it’s a Debian-based system, you can configure the timezone with

sudo dpkg-reconfigure tzdata

Edit:
I’ve actually not set a timezone in appdaemon.yaml at all, just configured it in Home Assistant as Europe/Berlin in my case. And the system time zone is of course set correctly as well.

Edit 2:
I see you’re already discussing this in another thread and you’re using hassio. Schedy is definitely not the problem in your case, since AppDaemon gets a wrong time zone. Otherwise, its logs would be in local time as well. So you need to set the correct time zone in Home Assistant. Good luck.

1 Like

Yes thanks. I think it is but it is the VM image so no direct access to the base system. Cheers!

[edit] And working thanks.

I note the readthedocs is missing the schedy instructions and also the pages seem to be missing on the shedy branch of the docs.

As I wrote, it’s in master now. Use the latest docs.

Ah OK. Had not realised that https://hass-apps.readthedocs.io/ <> https://hass-apps.readthedocs.io/en/latest/apps/index.html

Cheers

Hi @roschi,

Is there a way of setting attributes 1,2 & 3 of an entity to x, y & z at one period of time, then set those attributes to a, b & c at a different period of time using Schedy?

Possibly I am going about this the wrong way :frowning:

I have also tried to use the thermostat actor on a generic thermostat. What attribute does the thermostat actor set with the value value?

  module: hass_apps_loader
  class: SchedyApp
  actor_type: thermostat
  rooms:
    sunroom:
      schedule:
      - value: 25
        start: "05:30"
        end: "16:40"
        name: Rule1
      - value: 14
      replicate_changes: true
      reschedule_delay: 1
      actors:
        climate.tank:

Attributes aren’t just set, that wouldn’t trigger any action. The appropriate services are called instead. The thermostat actor’s documentation describes quite comprehensive which services are called with which attributes.

For your other issue, you need to use the custom actor type and implement the actions needed to set the desired attributes yourself. Read the docs. I plan to add an example custom actor sometime, but don’t have time right now.

I have (read the docs) and I can’t get it to work.

What does “can’t get it to work” mean?

I cannot get the generic thermostat to react to a schedule.

Then enable debug logging in order to inspect what’s actually going on.

Presumable by adding debug: true. if so no output in the AppDaemon Log - is that where I shoudl be looking? All I get is a note the file has changed.

It should reload the app automatically if the config changed, restarting AppDaemon does it for sure.

If I change a different schedule I get

2018-10-19 17:58:00.948872 INFO AppDaemon: Reading config
2018-10-19 17:58:00.993937 INFO AppDaemon: /config/appdaemon/apps/schedy-apps.yaml added or modified
2018-10-19 17:58:00.994444 INFO AppDaemon: App 'schedy' changed
2018-10-19 17:58:00.997921 INFO AppDaemon: Terminating schedy
2018-10-19 17:58:00.998499 INFO AppDaemon: Initializing app schedy using class SchedyApp from module hass_apps_loader
2018-10-19 17:58:01.000972 INFO schedy: *** Welcome to schedy 0.1.0, running on AppDaemon 3.0.1.
2018-10-19 17:58:01.003900 INFO schedy: *** 
2018-10-19 17:58:01.005456 INFO schedy: *** This is an app from the hass-apps package.
2018-10-19 17:58:01.006961 INFO schedy: ***   DOCS: https://hass-apps.readthedocs.io/en/stable/
2018-10-19 17:58:01.008443 INFO schedy: *** 
2018-10-19 17:58:01.009877 INFO schedy: *** If you like this app and want to honor the effort put into it,
2018-10-19 17:58:01.012608 INFO schedy: *** please consider a donation.
2018-10-19 17:58:01.014431 INFO schedy: ***   DONATE: https://hass-apps.readthedocs.io/en/stable/#donations
2018-10-19 17:58:01.016241 INFO schedy: *** Thank you very much and enjoy schedy!
2018-10-19 17:58:01.019704 INFO schedy: *** 
2018-10-19 17:58:01.026323 INFO schedy: --- Actor type is: 'switch'
2018-10-19 17:58:01.043427 INFO schedy: --> [R:sunroom] [A:switch.ufh_heating] Received state of 'off'.
2018-10-19 17:58:01.146629 INFO schedy: <-- [R:sunroom] Value set to on.  [scheduled]
2018-10-19 17:58:01.150152 INFO schedy: *** Initialization done.
2018-10-19 17:58:02.024401 INFO schedy: --> [R:sunroom] [A:switch.ufh_heating] Received state of 'on'.

the thermostat schedule is

schedy:
  # Obligatory settings that tell appdaemon where to find the app.
  # You shouldn't need to change these two.
  module: hass_apps_loader
  class: SchedyApp
  actor_type: thermostat
  debug: true

  rooms:
    #A schedule for the hot water tank
    tank_shower:
      schedule:
      - value: 25
        start: "05:30"
        end: "19:00"
        name: Fancy Rule
      - value: 14
      # - min_temp: 14
      #   max_temp: 16
      replicate_changes: true
      reschedule_delay: 1
      actors:
        climate.tank:
          min_temp: 18
          max_temp: 25
          target_temp_service: 23

I have tried all sorts of different combinations. Rule should have a value of 25 right now.

The log you posted is from something completely different… That’s from a switch actor, and even without debug enabled.

You seem to have multiple apps named schedy defined, but app names have to be unique. Please check again.