Using the AppDaemon setup I’m getting 500 errors in the logs. I’m at a loss as to what I need to do to resolve this. No entities in HA are being created, I had assumed this was automatic but if not, how do I manually create them?
Both HA and Appdaemn are running in docker containers if that of any use, both however are using the host network
Server got itself in trouble
2023-05-20 15:57:28.861294 INFO unifi_monitor: Leeloo-Switch Port 13 Port 13 is off
2023-05-20 15:57:28.863124 WARNING unifi_monitor: unifi_monitor: Entity binary_sensor.unifi_Leeloo-Switch_port13_link not found in namespace default
2023-05-20 15:57:28.865267 INFO AppDaemon: unifi_monitor: Entity binary_sensor.unifi_Leeloo-Switch_port13_link created in namespace: default
2023-05-20 15:57:28.877273 WARNING HASS: Error setting Home Assistant state default.binary_sensor.unifi_Leeloo-Switch_port13_link, {'state': 'off', 'attributes': {'friendly_name': 'Port 13', 'device_class': 'connectivity', 'model': 'US24PRO'}}
2023-05-20 15:57:28.878309 WARNING HASS: Code: 500, error: 500 Internal Server Error
I’m trying to get this working, but I’m stuck on the login it seems, and I don’t have a clue how to solve it.
My Home Assistant (2023.5.3) is running in a Docker image on my NAS (Synology DS418 play with DSM7), which has IP address 192.168.0.2. The Unifi Controller (7.3.83) is running in another Docker image on the same NAS. Both are running fine.
I’ve followed the instructions here (GitHub - w1tw0lf/Unifi-Device-info: Unifi AP Device info via API for home assistant) to get the integration going for 2 AP’s, but when I look at the sensors in Home Assistant they are all in status “Unknown”. So I’ve tried to run the script for one of the AP’s from a terminal window using the command:
‘python3 /config/scripts/unifi_ap_liv.py’
and the result is this:
/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py:1045: Insecure
RequestWarning: Unverified HTTPS request is being made to host '192.168.0.2'. Ad
ding certificate verification is strongly advised. See: https://urllib3.readthed
ocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(
Traceback (most recent call last):
File "/config/scripts/unifi_ap_liv.py", line 21, in <module>
client = Controller(host, username, password, port, version,
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 113
, in __init__
self._login()
File "/usr/local/lib/python3.10/site-packages/pyunifi/controller.py", line 195
, in _login
raise APIError(
pyunifi.controller.APIError: Login failed - status code: 405
So first I get a warning about SSL, which I don’t mind. But it seems I get an HTTP error 405, and I have no idea why.
Here is my config:
host = '192.168.0.2'
username = 'davyvr'
password = 'XXXXXXXXX'
version = 'UDMP-unifiOS'
#### version ####
## the base version of the controller API [v4|v5|unifiOS|UDMP-unifiOS] ##
## this would be for the version of the controller you are running ##
#################
site_id = 'default'
port = '8443'
verify_ssl = False
target_mac = 'fc:ec:da:16:c8:8f'
Any suggestions as to what I could try? How to get this solved?
Looks like the release Home Assistant Core 2023.5.4 does not (fully) work with Unify. At least I lose the stream of the video.
Any suggestions on how to solve?
Not sure how to check if the python part is correctly, but the configuration.yaml part (command line and template part) is giving me errors. When importing your config the formatting is not correct so could also be formatting issues. I even downloaded your config file and uploaded into mine (and ofcourse changed login etc)…