Odianosen25 / Monitor-App

Appdaemon App for Andrew's Monitor Presence Detection System
74 stars 9 forks source link

AttributeError: 'NoneType' object has no attribute 'entity_exists' #8

Closed codeclinic closed 4 years ago

codeclinic commented 4 years ago

I have Monitor setup on a Pi Zero W in the Garage and a Pi 4b as my main HA Server (in a venv) but with no Monitor setup.

I've got AppDaemon running on the Pi4b in its own venv, and am running into the following issue poping up in the AD logs:

Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.263388 INFO AppDaemon: Initializing app home_presence_app using class HomePresenceApp from module home_presence_app Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.270178 WARNING AppDaemon: Unknown Plugin Configuration in get_plugin_api() Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.271528 WARNING home_presence_app: ------------------------------------------------------------ Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.271999 WARNING home_presence_app: Unexpected error running initialize() for home_presence_app Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.272401 WARNING home_presence_app: ------------------------------------------------------------ Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.275186 WARNING home_presence_app: Traceback (most recent call last): Jan 09 22:13:54 HA-SERVER appdaemon[16601]: File "/srv/appdaemon/lib/python3.7/site-packages/appdaemon/app_management.py", line 145, in initialize_app Jan 09 22:13:54 HA-SERVER appdaemon[16601]: await utils.run_in_executor(self, init) Jan 09 22:13:54 HA-SERVER appdaemon[16601]: File "/srv/appdaemon/lib/python3.7/site-packages/appdaemon/utils.py", line 277, in run_in_executor Jan 09 22:13:54 HA-SERVER appdaemon[16601]: response = future.result() Jan 09 22:13:54 HA-SERVER appdaemon[16601]: File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run Jan 09 22:13:54 HA-SERVER appdaemon[16601]: result = self.fn(*self.args, **self.kwargs) Jan 09 22:13:54 HA-SERVER appdaemon[16601]: File "/home/appdaemon/.appdaemon/conf/apps/home_presence_app.py", line 25, in initialize Jan 09 22:13:54 HA-SERVER appdaemon[16601]: if not self.mqtt.entity_exists(self.monitor_entity): Jan 09 22:13:54 HA-SERVER appdaemon[16601]: AttributeError: 'NoneType' object has no attribute 'entity_exists' Jan 09 22:13:54 HA-SERVER appdaemon[16601]: 2020-01-09 22:13:54.275689 WARNING home_presence_app: ------------------------------------------------------------

Any ideas on what I'm doing wrong?

Thanks.

Odianosen25 commented 4 years ago

@codeclinic,

Glad you finally got AD installed. This error is happening, because you don’t have the MQTT plugin initialised. When you do, have the plugin name given to the MQTT plugin in appdaemon.yaml be called “MQTT”.

Regards

Odianosen25 commented 4 years ago

@codeclinic,

Can you kindly show me your appdaemon.yaml file setup for plugins?

Also you can follow the document, as you can then configure it.

Regards

codeclinic commented 4 years ago

I got it working thanks. It took a while to find the relevant bit in the docs since Google searches weren't turning up anything of value. Got there in the end.

Thanks.

gogui63 commented 4 years ago

@codeclinic finally how do you solve it ? I've same issue

kuchel77 commented 4 years ago

@gogui63

In case you haven't solved it, or for anyone else with the same problem. In your appdaemon.yaml file add

appdaemon:
...
  plugins:
    HASS:
      type: hass
    MQTT:
      type: mqtt
      client_host: 192.168.0.200
      namespace: mqtt

With the IP address of your broker instead of 192.168.0.200. There is additional items in mine relating to location and timezone that aren't relevant to this as well, hence the ...