Announcement: AppDaemon 1.3.0/1.3.1

Please Read Carefully - there are breaking changes

EDIT: Since you can’t have too much of a good thing I have added release 1.3.1 which adds the ability to use the select_value() call to change an input slider

Hello everyone- I have been hard at work on today’s release - a couple of major additions, as well as a lot of work under the covers. We now have the ability to activate callbacks with random time periods within defined ranges, as well as the ability to check for state changes that have existed for a period of time (think “for: x mins” in yaml automations).

In addition, I have been working on some secret time travel technology that is intended to make things easier for testing, although they are currently undocumented - I mention this because it took some fairly significant changes to the scheduler, and the delay in this release is due to me wanting to test things thoroughly. Having said that, there may be a few bugs, so keep on the lookout and I will fix as necessary!

I will also add that the randomizations have paved the way to writing a full blown occupancy simulation app that people have been asking for - I am working on that and hope to have something usable in the next few days.

Enjoy!

1.3.1 (2016-09-04)

Features

  • Add convenience function to set input_selector called select_value() - contributed by Dave Banks

Fixes

None

Breaking Changes

None

1.3.0 (2016-09-04)

Features

  • Add ability to randomize times in scheduler
  • Add duration to listen_state() to fire event when a state condition has been met for a period of time
  • Rewrite scheduler to allow time travel (for testing purposes only, no effect on regular usage!)
  • Allow input_boolean constraints to have reversed logic
  • Add info_listen_state(), info_listen_event() and info_schedule() calls

Fixes

  • Thorough proofreading correcting typos and formatting of API.md - contributed by Robin Lauren
  • Fixed a bug that was causing scheduled events to fire a second late
  • Fixed a bug in get_app() that caused it to return a dict instead of an object
  • Fixed an error when missing state right after HA restart

Breaking Changes

  • run_at_sunrise() and run_at_sunset() no longer take a fixed offset parameter, it is now a keyword, e.g. offset = 60
2 Likes

After upgrading to v1.3.1, I get the following in my error.log on every start of appdaemon:

2016-09-04 13:12:37.001035 WARNING Scheduler clock skew detected - delta = 1.0008509159088135 - resetting

Is this something to be concerned about?

No - its just the AppDaemon attempting unauthorized time travel and being told to stop it …

I would be interested if it is every time - for me its about one time in 4 or 5.

In any case its harmless :slight_smile:

Yeah, it happens every time for me. I just restarted 5 more times, giving it about a minute or so between each restart and it gives the warning every time. So its been 12 restarts in total and 12 warnings in total. Maybe it depends on what apps I have and what they are doing which determines the frequency in which it occurs?

Yes, I think it is also performance related - I will take a look and see if I can get rid of it but it is totally harmless, thanks for the info :slight_smile:

1 Like

i have it also every time.
except my delta = 3.0… or 4.0… or 5.0…

but except that no problems and everything working great.

Glad to see the convenience function for input_select, which worked great for the 3 service calls I was making for input selects, but the input_select is kind of like the input_option, so the following change to appapi.py would be awesome as a convenience function as I have a lot of input_option service calls in my apps:

def select_option(self, entity_id, option):
  self._check_entity(entity_id)
  rargs = {"entity_id": entity_id, "option": option}
  self.call_service("input_select/select_option", **rargs)

I don’t know enough about git other than pulling down updates and pushing up my own projects, so I wouldn’t know how to go about doing a pull request or anything to submit this like Dave Banks did.

Obviously this is not a necessity, as it is only an alias convenience function, so no rush. I have already changed a copy of my appapi.py in the hopes this is included in a future update, otherwise I’ll just have to re-add it with every update LOL

I’ll add this - it’s pretty easy so no need for a PR I guess :slight_smile:

1 Like