Hi,
I’ve installed appdaemon via the hassbian config installation and I have figured out as far as getting hadashboard and the hello world.py running, but I can’t for the life of my figure out how to get it to do stuff in HA. I’ve been tinkering with this now for about 5 days and was actually starting to think I should just try node red install but I must be missing something.
Ok here my appdaemon.yaml:
log:
accessfile: /home/homeassistant/appdaemon/logs/access.log
errorfile: /home/homeassistant/appdaemon/logs/error.log
logfile: /home/homeassistant/appdaemon/logs/appdaemon.log
log_generations: 2
log_size: 1024
appdaemon:
threads: 10
plugins:
HASS:
type: hass
ha_url: !secret home_asst_url
ha_key: !secret home_asst_key
hadashboard:
dash_url: http://192.168.1.49:5050
dashboard_dir: /home/homeassistant/appdaemon/dashboards
apps.yaml:
hello_world:
module: hello
class: HelloWorld
alarm_set:
module: alarmset
class: AlarmSet
test_app:
module: test
class: NightLight
All the logs and everything generate…I can see the Hello World:
2018-04-14 00:50:59.290451 INFO AppDaemon: Reloading Module: /home/homeassistant/appdaemon/apps/hello.py
2018-04-14 00:50:59.300016 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2018-04-14 00:50:59.309142 INFO hello_world: Hello from test AppDaemon
2018-04-14 00:50:59.316694 INFO hello_world: You are now ready to run Apps!
But when I try to run this app but on this example https://github.com/ReneTode/My-AppDaemon/blob/master/AppDaemon_for_Beginner/Part_1(listen_state_and_get_state).md
, nothing happens:
import appdaemon.plugins.hass.hassapi as hass
class NightLight(hass.Hass):
def initialize(self):
self.listen_state(self.turn_on_boolean,"input_boolean.test1", new="on")
self.log("test1")
def self.turn_on_boolean (self, entity, attribute, old, new, kwargs):
boolean_test = self.get_state("input_boolean.test2")
if boolean_test == "on":
self.log("it's on")
self.turn_on("input_boolean.test3")
self.log("test3")
I have 3 input booleans in HA
I have test2 on and I am toggling test1
|input_boolean.test1|on|friendly_name: test1|
|input_boolean.test2|on|friendly_name: test2|
|input_boolean.test3|off|friendly_name: test3|
2018-04-14 00:58:00.161769 INFO AppDaemon: Terminating test_app
2018-04-14 00:58:00.162544 INFO AppDaemon: Reloading Module: /home/homeassistant/appdaemon/apps/test.py
2018-04-14 00:58:00.163151 INFO AppDaemon: Loading App Module: test
2018-04-14 00:58:00.170765 WARNING AppDaemon: Removing associated apps:
2018-04-14 00:58:00.171475 WARNING AppDaemon: test_app
grrrrrrr - note it’s 1:03 am