Okay, so if you go through my post history, you’ll see I’ve had a few Appdaemon issues when using Appdaemon with Hass.io. Then I solved the problem, but got stuck at a limitation of Hass.io.
So I started from scratch with Raspian, installed Home Assistant in a venv as per this. Got that all working. Installed Appdaemon in a separate venv as per this video.
Firstly, the systemd service file:
…/…/etc/systemd/system/appdaemon.service
[Unit]
Description=Appdaemon for Hass
After=network.target
[Service]
Type=simple
User=pi
ExecStart=/home/pi/appdaemon/bin/appdaemon -D DEBUG -c "/home/pi/appdaemon/conf"
[Install]
WantedBy=multi-user.target
appdaemon.yaml
home/pi/appdaemon/conf/appdaemon.yaml
log:
logfile: /home/pi/appdaemon/conf/appdaemon.log
errorfile: /home/pi/appdaemon/conf/aderror.log
appdaemon:
threads: 10
app_dir: /home/pi/appdaemon/conf/apps
plugins:
HASS:
type: hass
ha_url: http://XXXXX:8123
token: <blah blah blah blah>
hasdashboard:
dash_url: http://XXXXX:5050
dash_dir: /home/pi/appdaemon/conf/dashboards
apps.yaml
home/pi/appdaemon/conf/apps/apps.yaml
testapp:
module: test
class: FirstApp
test.py
home/pi/appdaemon/conf/apps/test.py
import appdaemon.plugins.hass.hassapi as hass
class FirstApp(hass.Hass):
def initialize(self):
self.log("Test app initialized")
self.listen_state(self.run, "input_boolean.run_test_app")
def run(self, entity, attribute, old, new, kwargs):
self.log("Test app starting")
self.turn_on("light.dining_room")
self.log("Test app run")
And I uploaded the appdaemon.log file here because I couldn’t paste it or upload it here.
To generate this log, I removed the log file, stopped the appdaemon process and rebooted the Pi.
I just do not think the app is actually running? I’m not seeing any of my self.log printouts? (These should be in appdaemon.log right?) and the light is definitely not turning on…
What am I doing wrong?