I really have tried. I just can’t figure this out. Anything I try just says the entity not found in namespace default. Even if I add the “namespace: hass” argument to the appdaemon.yaml it still states ‘Entity *** not found in namespace default’??? Didn’t I just tell it not default by declaring the namespace as ‘hass’?. Do I even need to do this? The documents say no. All I am doing is modifying the example 'HelloWorld.py to include listening to my door sensor. If its open then turn on the light and add and entry into the log.Any help or insight would be greatly appreciate. I’m two days into just getting a simple script to turn on a light and I’m going mad.
My setup:
Unraid–> VM Hassio -> Appdaemon Addon
appdaemon.yaml:
secrets: /config/secrets.yaml
appdaemon:
latitude: **.****
longitude: -**.****
elevation: 2
time_zone: America/Chicago
plugins:
HASS:
type: hass
namespace: hass #<----- Tried with and without this line. Still same results.
ha_url: http://192.168.1.***:8123
delay: 0
token: eyJ0eXA****
http:
url: http://192.168.1.***:5050
hadashboard:
logs:
error_log:
filename: /config/appdaemon/logs/error.log
main_log:
filename: /config/appdaemon/logs/appdaemon.log
access_log:
filename: /config/appdaemon/logs/access.log
diag_log:
filename: /config/appdaemon/logs/diag.log
apps.yaml
hello_world:
module: hello
class: HelloWorld
hello.py
import appdaemon.plugins.hass.hassapi as hass
class HelloWorld(hass.Hass):
def initialize(self):
self.log("Hello from AppDaemon")
self.log("You are now ready to run Apps!")
self.listen_state(self.turnon, "binary_sensor.testdoor", new = "on")
self.listen_state(self.turnoff, "binary_sensor.testdoor", new = "off")
def turnon(self, kwargs):
self.turn_on("light.test")
self.log("Light On")
def turnoff(self, kwargs):
self.turn_off("light.test")
self.log("Light Off")
appdaemon.log
2020-05-25 07:50:08.571405 INFO AppDaemon: AppDaemon Version 4.0.3 starting
2020-05-25 07:50:08.571662 INFO AppDaemon: Python version is 3.8.2
2020-05-25 07:50:08.571893 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2020-05-25 07:50:08.572134 INFO AppDaemon: Added log: AppDaemon
2020-05-25 07:50:08.572380 INFO AppDaemon: Added log: Error
2020-05-25 07:50:08.572607 INFO AppDaemon: Added log: Access
2020-05-25 07:50:08.572922 INFO AppDaemon: Added log: Diag
2020-05-25 07:50:08.586650 INFO AppDaemon: Initializing HTTP
2020-05-25 07:50:08.587096 INFO AppDaemon: Using 'ws' for event stream
2020-05-25 07:50:08.597523 INFO AppDaemon: API is disabled
2020-05-25 07:50:08.597868 INFO AppDaemon: Admin Interface is disabled
2020-05-25 07:50:08.598237 INFO AppDaemon: Starting Dashboards
2020-05-25 07:50:08.605993 INFO AppDaemon: App 'hello_world' added
2020-05-25 07:50:08.606790 INFO AppDaemon: Found 1 total apps
2020-05-25 07:50:08.607432 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2020-05-25 07:50:08.608743 INFO AppDaemon: Running on port 5050
2020-05-25 07:50:09.612543 INFO AppDaemon: Scheduler running in realtime
2020-05-25 07:50:09.614921 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2020-05-25 07:50:09.616748 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2020-05-25 07:50:09.621425 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2020-05-25 07:50:09.687609 INFO hello_world: Hello from AppDaemon
2020-05-25 07:50:09.688697 INFO hello_world: You are now ready to run Apps!
2020-05-25 07:50:09.689796 WARNING hello_world: hello_world: Entity binary_sensor.testdoor not found in namespace default
2020-05-25 07:50:09.692740 INFO AppDaemon: App initialization complete
Error.log
None
Hassio Device Info:
Door Sensor- ZWave
Name Override: test1
Entity ID : binary_sensor.testdoor
Light- Zwave
Name Override: LightTest
Entity ID light.test