I recently jumped into AppDaemon bandwagon. Currently I am running HA in venv on Pi3. I converted a couple of my existing automations using AppDaemon but I got a lot of newbie questions.
Welcome @sbmlat!
Once you get the hang of a bit of python, AppDaemon and the interactions you can create within the program and HASS is REALLY powerful and really awesome! Let us know any time you have questions, there’s tons of users here that will pitch in to help you learn.
I’m going to assume you know absolutely nothing and explain in decent detail, even if you can follow perfectly, others might have the same question.
- Where do these logs write?
AppDaemon:
logfile: STDOUT
errorfile: STDERR
- I tried to change to a different file but got file access errors. Can I write these logs to existing HA log?
This is SORT of a trick question. The lines in your config are basically saying "print out all logs to the console, and don’t save any files at all. These are meant to be entirely optional and no-nonsense, in that you can see all your output directly in the terminal whenever you run AD. Check out this section of the documentation to get a bit more info on these parameters. You could change these to whatever FULL PATH you’d like. AppDaemon should have no problems writing within the venv, so make sure you pick something within that domain! If you put info.log
and err.log
in those two fields, they would produce files wherever you start AppDaemon from. /var/log/appdaemon.log
would work just fine so long as you have write permissions there.
- How do I send a notification to IFTTT from appdaemon? I tried following snippet (got from the forums only) but that didn’t trigger IFTTT notification.
I don’t believe IFTTT has native support from within the AppDaemon notify call. Try calling IFTTT as a service, if you have the component already set up within HomeAssistant.
def send_notification_msg(self, msg):
msg="Porch light and Kitchen lights turned on after sunset - Time now : {}".time.time()
self.call_service('ifttt.trigger', event='LightsOn', value1=msg)
# self.call_service('ifttt.trigger', event=self.args['notify_who'], value1=msg)
self.log(msg)
I do not use IFTTT, but this should do you alright. You can trigger the event to be custom per the args you set up, if, for example, you had an event that was the same value as what you set in notify_who
… this would change from ifttt
to something like notify_sbmlat
, for example. You’d need a webhook set up in IFTTT named notify_sbmlat
to be able to trigger this.
Hope this helps! Keep us updated on your progress. ![:slight_smile: :slight_smile:](https://community.home-assistant.io/images/emoji/twitter/slight_smile.png?v=12)
-SN