In which yaml am I supposed to put this?
I did add it to the requirements.txt as described here:
https://appdaemon.readthedocs.io/en/latest/DOCKER_TUTORIAL.html#python-packages
I do have a docker installation of apdaemon and home assistant. So no addons in home assistant.
EDIT:
Ist running now but giving me errors again. But at least sth
-removed error code-
Update:
Another step forward. The name of my switch flex mini hat blanks, which caused some of the errors.
main log looking like this now:
2024-04-03 19:39:17.441917 INFO unifi_monitor: Update Switches Started
2024-04-03 19:39:17.460458 INFO unifi_monitor: Switch Model: USMINI : 172.172.172.21
2024-04-03 19:39:17.468765 INFO unifi_monitor: SwitchFlexMini Port 1 Port 1 is on
2024-04-03 19:39:17.481253 INFO unifi_monitor: SwitchFlexMini Port 2 Port 2 is on
2024-04-03 19:39:17.492652 INFO unifi_monitor: SwitchFlexMini Port 3 Port 3 is on
2024-04-03 19:39:17.504548 INFO unifi_monitor: SwitchFlexMini Port 4 Port 4 is on
2024-04-03 19:39:17.516430 INFO unifi_monitor: SwitchFlexMini Port 5 Port 5 is on
2024-04-03 19:39:17.536772 INFO unifi_monitor: Update Health Started
2024-04-03 19:39:17.545368 WARNING AppDaemon: Logged an error to /conf/logs/error.log
2024-04-03 19:39:17.558758 INFO unifi_monitor: Updating WAN stats
2024-04-03 19:39:17.898569 WARNING AppDaemon: Logged an error to /conf/logs/error.log
2024-04-03 19:40:17.424946 INFO unifi_monitor: Update APs Started
2024-04-03 19:40:17.428500 WARNING AppDaemon: Logged an error to /conf/logs/error.log
But I do still get some errors:
2024-04-03 19:38:17.427087 WARNING unifi_monitor: ------------------------------------------------------------
2024-04-03 19:38:17.429412 WARNING unifi_monitor: Unexpected error in worker for App unifi_monitor:
2024-04-03 19:38:17.430499 WARNING unifi_monitor: Worker Ags: {'id': 'd86a23252b894c0ebf2d5858955664d9', 'name': 'unifi_monitor', 'objectid': '0f0d142cb5cb4c12944255c9a8d0b93e', 'type': 'scheduler', 'function': <bound method UnifiAPSW.update_aps of <unifi.UnifiAPSW object at 0x7fbe26e5f5e0>>, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'__thread_id': 'thread-1'}}
2024-04-03 19:38:17.431121 WARNING unifi_monitor: ------------------------------------------------------------
2024-04-03 19:38:17.433450 WARNING unifi_monitor: Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/appdaemon/threading.py", line 1022, in worker
funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
File "/conf/apps/unifi.py", line 77, in update_aps
for ap in self.args['aps']:
TypeError: 'NoneType' object is not iterable
2024-04-03 19:38:17.434134 WARNING unifi_monitor: ------------------------------------------------------------
2024-04-03 19:38:17.604157 WARNING unifi_monitor: ------------------------------------------------------------
2024-04-03 19:38:17.604698 WARNING unifi_monitor: Unexpected error in worker for App unifi_monitor:
2024-04-03 19:38:17.605190 WARNING unifi_monitor: Worker Ags: {'id': 'd8e5f202acfc4e45a6025be44f1e1c08', 'name': 'unifi_monitor', 'objectid': '0f0d142cb5cb4c12944255c9a8d0b93e', 'type': 'scheduler', 'function': <bound method UnifiAPSW.update_health of <unifi.UnifiAPSW object at 0x7fbe26e5f5e0>>, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'__thread_id': 'thread-1'}}
2024-04-03 19:38:17.605622 WARNING unifi_monitor: ------------------------------------------------------------
2024-04-03 19:38:17.606201 WARNING unifi_monitor: Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/appdaemon/threading.py", line 1022, in worker
funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
File "/conf/apps/unifi.py", line 141, in update_health
isp_upload = int(health[2]['xput_up'])
KeyError: 'xput_up'
2024-04-03 19:38:17.606621 WARNING unifi_monitor: ------------------------------------------------------------
2024-04-03 19:38:17.957155 WARNING unifi_monitor: ------------------------------------------------------------
2024-04-03 19:38:17.957672 WARNING unifi_monitor: Unexpected error in worker for App unifi_monitor:
2024-04-03 19:38:17.958120 WARNING unifi_monitor: Worker Ags: {'id': '0f2b97f7be90432aa2331fe70aca4448', 'name': 'unifi_monitor', 'objectid': '0f0d142cb5cb4c12944255c9a8d0b93e', 'type': 'scheduler', 'function': <bound method UnifiAPSW.update_wan of <unifi.UnifiAPSW object at 0x7fbe26e5f5e0>>, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'__thread_id': 'thread-1'}}
2024-04-03 19:38:17.958553 WARNING unifi_monitor: ------------------------------------------------------------
2024-04-03 19:38:17.960086 WARNING unifi_monitor: Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 31, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 139, in _read
return self._jsondec(response.text)
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 120, in _jsondec
raise APIError(obj["meta"]["msg"])
pyunifi.controller.APIError: api.err.UnknownDevice
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 36, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 139, in _read
return self._jsondec(response.text)
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 120, in _jsondec
raise APIError(obj["meta"]["msg"])
pyunifi.controller.APIError: api.err.UnknownDevice
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/appdaemon/threading.py", line 1022, in worker
funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"]))
File "/conf/apps/unifi.py", line 52, in update_wan
gw = self.client.get_device_stat(self.args["gateway_mac"])
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 326, in get_device_stat
return self._api_read("stat/device/" + target_mac, params)[0]
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 142, in _api_read
return self._read(self._api_url() + url, params)
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 38, in wrapper
raise APIError(err)
pyunifi.controller.APIError: api.err.UnknownDevice