Announcement: AppDaemon beta 3

@turboc,

Oh ok, thought it was only necessary when it is more than a single dependency. Thanks and will do

Depends. Sometimes it works that way in HA, sometimes it doesnā€™t. At least in AD with one primary developer, things should be a little more consistent. :slight_smile:

if more people stumble on it, andrew probably will check if its a list or a string in a next version :wink:

In other places I have code that accepts it if its a single key, I guess I can make that an enhancement.

2 Likes

OK, it will work that way in the next beta.

1 Like

My personal opinion, sometimes better not to do exceptions: if it must be a list, it must be a list even for one element.

As a newbie myself I found confusing when things works in two different ways, in this specific case if a single element can be inline but two or more not.

1 Like

Iā€™m not a newbie anymore (well compared to Rene and Almc I am), but I tend to agree with you. Exceptions make things harder to understand. I would rather have a set of rules that are followed consistently. Thatā€™s not to say that the rules canā€™t be changed if there is a better way, but then the rule needs to be changed and the old way of doing things needs to be phased out. Like when we went from CFG files to YAML files. Iā€™m trying very carefully not to endanger some of the ā€œenhancementsā€ I have asked Aimc to make with my statementā€¦ :slight_smile:

Well itā€™s implemented now and Iā€™m not ripping it out - sorry :wink: There are clear examples of both in the docs now.

@turboc @aimc, thanks and making it a list did solve my issue. Another one I seem to have is using the function self.app_config.

For some reasons I keep getting key error. I have as seen above some configuration in my core module, which I want to pass on to other apps instead of replicating. This has been working fine until like last two days. Not sure what happened but its just not loading.

snips_core:
  module: snips_core
  class: SnipsProcess
  users:
    - User1
    - User2

in several of my apps, I have

self.allowed_users = self.app_config["snips_core"]["users"]

of late it gives me

2018-02-14 06:32:04.135872 WARNING AppDaemon: ------------------------------------------------------------
2018-02-14 06:32:04.137882 WARNING AppDaemon: Unexpected initializing app: news_intent:
2018-02-14 06:32:04.139642 WARNING AppDaemon: ------------------------------------------------------------
2018-02-14 06:32:04.370221 WARNING AppDaemon: Traceback (most recent call last):
  File "/srv/appdaemon/lib/python3.5/site-packages/appdaemon/appdaemon.py", line 1798, in check_app_updates
    self.init_object(app)
  File "/srv/appdaemon/lib/python3.5/site-packages/appdaemon/appdaemon.py", line 1438, in init_object
    self.objects[name]["object"].initialize()
  File "/home/homeassistant/appdaemon/apps/news_intent.py", line 14, in initialize
    self.allowed_users = self.app_config["snips_core"]["users"]  #self.args["users"]
KeyError: 'snips_core'

across all apps that have that line.

I had to temporarily resort to adding the users to each app, but can you help me with a fix please or if I am doing something wrong?

Thanks

Yeah, that should work, but you could also use global vars. Do you have your code up somewhere? Iā€™d love to take a look and see if there was any way to integrate our stuff at least to the point our intents were compatible since we seem to be working in the same direction.

This was a bug, thanks for reporting it. It will be fixed in beta 4.

@tschmidty, yeah could use the global_vars, but for some reason I am trying not to over use it as I might find it difficult to catch up with all my variables, and since its not threaded, well could screw things up. I donā€™t actually have my code loaded as I am new to using github as not a programmer by profession, and yes you right somethings kind of over lap. I was looking at making all my apps compatible with your javis_core, but havenā€™t had the time as I am working on different things. My code still buggy on different levels, but will work on seeing if I can have them uploaded on github as a form of backup this weekend. I manually backup everyday on Google for now.

@aimc thanks, and will wait on that update. Kind regards

1 Like

@Odianosen25 Cool. I have a plugin for mqtt proposed that will allow you to bridge snips and appdaemon directly. I also have kind of a cool dialogue function mostly working for longer conversations. Love appdaemon itā€™s definitely made building stuff like this so much easier (thanks @aimc !). So here is something cool I got working with the dialogue function (in case anyone is old enough to remember Zork!)

2 Likes

Hehe - love it :slight_smile:

Is it my imagination or does SNIPS have a Welsh accent?

@tschmidty, yeah I saw the video and I must say it was cool. Your work really inspires me, and unfortunately i canā€™t remember Zork :grin:. Appd as you said makes this easy, and I am even using it to manage the medicals of some remote ppl thanks to @aimc. I have some cool project in the works, and hopefully will get it done this week and post it. Unfortunately unlike you guys, it takes me ages to get some basic things done :persevere:

Kind regards

1 Like

@aimc Yep, he does. I actually use amazon polly to render the voices (which accounts for some of the delays if the voice isnā€™t rendered yet) and I prefer my butlers English! By default it uses picotts which is pretty robotic and doesnā€™t support ssml.

Ahh cool - I like the idea of SNIPS because it runs locally - but I guess you need the cloud to render Polly. Iā€™m pretty firmly entrenched in Alexa now since I just bought two Sonos Ones to go with my various Sots and Dots :slight_smile:

@aimc Please I have some questions to ask around scheduler functions, as I didnā€™t really understand the way they work from the docs.

Sometimes I get this timer skewed with some seconds in my log, what does that mean and what leads to it. Apologies I donā€™t have it now, so canā€™t present it but will do once it comes up again.

I have an app which has a couple of schedulers, and I run and cancel them. Now my questions are as follows:

  • Can I run more than 1 scheduler at the same time, for example multiple run_in or run_at

  • If I run different ones like run_in, using the same callback, will they all run or will there be some form of over ride. Sometimes I pass some arguments which I call ā€œTitleā€, can this be a differenciator for multiple run_in but with the same callback?

  • Must I use a handle to differentiate the different ones?

`Many thanks

Yeah, I have looked at some onboard tts systems and there are some decent options but nothing to the same quality as amazon polly unfortunately. I do cache the files so once a given utterance is rendered I don;t have to make the call again. Trying hard not to go down the rabbit hole of sending too much off to big brotherā€¦

1 Like

It means that the scheduler loop that runs every second took more than a second to execute which means that things might get out of sync so it corrects itself and logs a warning. One or two of these isnā€™t usually harmful, but if they are long delays it means that scheduled events might get delayed. This is usually caused by other things taking up the CPU of the box. It could be something else you are doing in AppDaemon, but itā€™s just as likely something else happening on the box. Bottom line, if you get it a lot it means your box is not powerful enough for what you are asking of it.

Each call to the scheduler results in an independant callback, and you can have as many as you want - really, I have tested 10s of thousands :wink: running at the same time

They will all run. They can even potentially run at the exact same time as AppDaemon is multithreaded. Passing arguments with the kwargs dictionary is the recommended way to differentiate between callbacks

No, handles are only really important when you want to cancel a callback- itā€™s better to differentiate using the kwargs mechanism.

1 Like