AppDaemon Q&A

You need to read the release notes :slight_smile: - I know you haven’t updated form the original because of the lack of windows support but that is fixed now hopefully (let me know)

If you change the logfile and error file to “STDOUT” and “STDERR” they will come to the screen - or you can leave them out entirely and they will default to the screen.

yeah i read that.
but i dont like it.

before it came to the screen AND it did go to the logfile, now i have to choose 1 or the other.

i liked that it got to the screen, because that is quick to see, but i want to see it in the logfile as well for reading back.

edit: and i did exactly like it said on the github. it works :wink:

Glad it’s working but it never went to both a log file and the screen unless you are a magician!

Thinking about it some more, maybe your special edited version did both because of the way you commented the lines out? I’ll take a look and see if I can figure a way of doing both.

i’m not sure now, if you say that.

i didnt actually look at the logfile, only the errorfile.
so it is possible that i got the logfile in my screen.

ill try if that satisfies me;)

That makes sense - it used to be log file to the screen and errors to a file if you started it on the command line. Let me know if it works for you as it is - I can’t disappoint my biggest fan!

1 Like

this is what i was missing when trying to install. perhaps you can highlight that on the github install instructions?

ta

at least for now i am happy.

also the temperary bugfix helps me going on.

i now have an app with some general functions that i call from another app.
it has to be seen how general i can make those functions, but for now it is working.

1 Like

Sure - I’ll make sure to call it out better.

2 Likes

A big THANK YOU to Andrew for creating and sharing AppDaemon.
For weeks I tried to get some automation for my Halloween project done but I was unable to do so with the normal scripting in HA. It took me only one hour and I had the job done by using AppDaemon.
And I love the fact that AppDaemon is reading changed Apps right away.

So long Rainer

1 Like

Excellent, really glad it is working for you :slight_smile:

i think there is an small bug in run_minutely:

2016-08-31 01:59:21,807 WARNING Unexpected error:
2016-08-31 01:59:21,807 WARNING ------------------------------------------------------------
2016-08-31 01:59:21,807 WARNING Traceback (most recent call last):
  File "c:\python34\lib\site-packages\appdaemon\appdaemon.py", line 362, in worker
    function()
  File "C:\Users\rene\AppData\Roaming\.homeassistant\apps\objectcontrole.py", line 19, in initialize
    self.run_minutely(self.object_controle_minutely, time)
  File "c:\python34\lib\site-packages\appdaemon\appapi.py", line 322, in run_minutely
    event = event.replace(minute = event.minute + 1)
ValueError: minute must be in 0..59

2016-08-31 01:59:21,807 WARNING ------------------------------------------------------------

May well be true - how did you call it?

  def initialize(self):
    self.listen_state(self.object_controle, self.args["object_type"])
    if self.args["time_gone_by"] == "true" or self.args["time_gone_by"] == "True":
      time = datetime.time(0, 0, 0)
      self.run_minutely(self.object_controle_minutely, time)

but it seems like it only happens when i start the app at ?:59 new.
and i seem to have another randomly occuring error that is bugging me, so if you dont see a problem in your code there may be something else happening here.

From the API documentation, the following line should be correct for retrieving a dictionary of the state data for all of my binary sensors:

state = self.get_state(“binary_sensor”)

However, I am getting this error in the log:

2016-08-30 23:59:46,037 WARNING Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py", line 364, in worker
    function(args["kwargs"])
  File "/home/hass/.homeassistant/appdaemon/conf/apps/alarm/check_home_secure_on_arming_alarm.py", line 17, in check_house_state
    state = self.get_state("binary_sensor")
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appapi.py", line 87, in get_state
    self._check_entity(entity_id)
  File "/usr/local/lib/python3.4/dist-packages/appdaemon/appapi.py", line 22, in _check_entity
    raise ValueError("{}: Invalid entity ID: {}".format(self.name, entity))
ValueError: check_home_secure_on_arming_alarm: Invalid entity ID: binary_sensor

OK, I’ll try and take a look at both of these today.

Ok, just pushed a bugfix release to address both issues:

2 Likes

Wow, that was fast! :grinning: Just can’t thank you enough!!!

1 Like

More importantly, does it work?

oke, so you found something :slight_smile:
i will update later, when i have the time.

Yep, it was a wrong assumption on my part about how the Python date libraries work - I changed the technique I was using to add 1 minute to the base time to fix it.

1 Like