Thx for the update for the dream machine. I have done a fresh git pull, and selected the Dream machine option.
But still getting errors:
Code: Select all
2021-01-11 00:10:06.423 Error: (Unifi Presence) 'onStart' failed 'JSONDecodeError'.
2021-01-11 00:10:06.424 Error: (Unifi Presence) ----> Line 872 in '/home/pi/domoticz/plugins/Domoticz-Unifi-Presence/plugin.py', function onStart
2021-01-11 00:10:06.424 Error: (Unifi Presence) ----> Line 215 in '/home/pi/domoticz/plugins/Domoticz-Unifi-Presence/plugin.py', function onStart
2021-01-11 00:10:06.424 Error: (Unifi Presence) ----> Line 706 in '/home/pi/domoticz/plugins/Domoticz-Unifi-Presence/plugin.py', function detectUnifiDevices
2021-01-11 00:10:06.424 Error: (Unifi Presence) ----> Line 900 in '/usr/local/lib/python3.7/dist-packages/requests/models.py', function json
2021-01-11 00:10:06.424 Error: (Unifi Presence) ----> Line 518 in '/usr/lib/python3/dist-packages/simplejson/__init__.py', function loads
2021-01-11 00:10:06.424 Error: (Unifi Presence) ----> Line 370 in '/usr/lib/python3/dist-packages/simplejson/decoder.py', function decode
2021-01-11 00:10:06.424 Error: (Unifi Presence) ----> Line 400 in '/usr/lib/python3/dist-packages/simplejson/decoder.py', function raw_decode
Looking at this PHP client class from @mallepietje
https://github.com/Art-of-WiFi/UniFi-AP ... ag/v1.1.63, it seems that for querying the API an insert in the base URL should be made by adding /proxy/network/.
Code: Select all
if ($this->is_unifi_os) {
$url = $this->baseurl . '/proxy/network' . $path;
} else {
$url = $this->baseurl . $path;
}
Also some code is dedicated to doing smart stuff with the token:
Code: Select all
if ($this->is_unifi_os && $this->request_type !== 'GET') {
$csrf_token = $this->extract_csrf_token_from_cookie();
if ($csrf_token) {
$headers[] = 'x-csrf-token: ' . $csrf_token;
}
}
Not sure how to translate this to modifications to your python script.
(I have a lot of general programming knowledge but no python experience).
Hope this helps.