Seite 7 von 9

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 22.11.2021, 17:11
von my_idefix
Hi leider noch keine Zeit gehabt.
Hab mal auf die schnelle den normalen Unifi Controller
genommen. Damit geht es auf anhieb.

Der neue Unifi Controller V2 hat beim anmelden mit API ein Problem.
Wenn ich Zeit finde ( kann ein wenig dauern ) melde ich mich.

Gruss

Achso ich vergass wenn du die Daten von IBroker holen willst dann muss du die
Instanz: simple-api.0 noch installieren.
Info unter : https://github.com/ioBroker/ioBroker.si ... /README.md

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 29.11.2021, 10:28
von Erbit
Hi.

I use PING with CUxD for presence detection. It is a universal solution, independent of your local network system. The only condition is that you assign a fixed IP address to the device.
Screenshot 2021-11-29 at 10-32-57 HomeMatic WebUI.png
Screenshot 2021-11-29 at 10-33-18 HomeMatic WebUI.png

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 29.11.2021, 10:36
von Roland M.
Hello!
Erbit hat geschrieben:
29.11.2021, 10:28
I use PING with CUxD for presence detection. It is a universal solution, independent of your local network system.
The only problem with this is that since Android 6 or so this method isn't reliable any more due to power saving options.


Roland

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 29.11.2021, 10:40
von Erbit
In such a situation, any WiFi-based method will not be effective.

If it works for me, does it mean that I have energy saving turned off? :roll:

Screenshot 2021-11-29 at 10-43-44 HomeMatic WebUI.png
Screenshot 2021-11-29 at 10-43-44 HomeMatic WebUI.png (4.7 KiB) 1668 mal betrachtet

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 29.11.2021, 11:22
von Roland M.
Hello!
Erbit hat geschrieben:
29.11.2021, 10:40
In such a situation, any WiFi-based method will not be effective.
That's exactly the problem! ;)

If it works for me, does it mean that I have energy saving turned off? :roll:
If it works for you and your phone has a satisfying battery run time, just be happy! :D


Roland

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 29.11.2021, 12:00
von Erbit
Roland M. hat geschrieben:
29.11.2021, 11:22
If it works for you and your phone has a satisfying battery run time, just be happy! :D
I remember well how the Nokia battery lasted 7 days on a single charge, with a lot of calls. :D
Roland M. hat geschrieben:
29.11.2021, 11:22
...
That's exactly the problem! ;)
So why write a Unify script when my method is universal and just as effective / ineffective?


Robert.

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 29.11.2021, 12:12
von Roland M.
Hello Robert!
Erbit hat geschrieben:
29.11.2021, 12:00
So why write a Unify script when my method is universal and just as effective / ineffective?
Many roads lead to Rome... ;)


Roland

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 16.01.2022, 12:32
von tonischabloni
my_idefix hat geschrieben:
22.11.2021, 17:11
Hi leider noch keine Zeit gehabt.
Hab mal auf die schnelle den normalen Unifi Controller
genommen. Damit geht es auf anhieb.

Der neue Unifi Controller V2 hat beim anmelden mit API ein Problem.
Wenn ich Zeit finde ( kann ein wenig dauern ) melde ich mich.

Gruss

Achso ich vergass wenn du die Daten von IBroker holen willst dann muss du die
Instanz: simple-api.0 noch installieren.
Info unter : https://github.com/ioBroker/ioBroker.si ... /README.md
weiß nicht ob das was hilft, habe eine UDM Pro.
mit folgendem aufruf in einer linux shell bekomme ich den gewünschten outpoot... nur mit dem cux curl funktionierts nicht

curl --insecure -c /tmp/unifiCookie -H "Content-Type: application/json" --data '{"username": "blabla", "strict": "True", "password": "blabla"}' 'https://192.168.x.1:443/api/auth/login' --next 'https://192.168.x.1/proxy/network/api/s ... t/stat/sta' --insecure -b /tmp/unifiCookie -c /tmp/unifiCookie

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 07.07.2022, 00:44
von Mtm87
Hallo zusammen,

ich bin auch von einem Unifi Controller auf eine UDM Pro gewechselt.
Auf dem Unifi Controller hat es funktioniert. Jetzt mit der UDM Pro nicht mehr.
Hat schon jemand eine Lösung gefunden?

Gruß Matze

Re: UniFi-basierte Anwesenheitserkennung

Verfasst: 16.10.2022, 16:52
von MagicDude4Eva
Hope this helps, first-time user of a CCU - here is my change to make this work for UDM Pro - this should work:

Code: Alles auswählen

...
<snip>
string url_login = "https://" # unifi_ip_port # "/api/auth/login";
string cmd_login = " --insecure -c /tmp/unifiCookie -H \"Content-Type: application/json\" --data '{\"username\":\"" # usr # "\",\"password\":\"" # pwd # "\", \"strict\": \"True\"}'";

string url_dev_list = "https://" # unifi_ip_port # "/proxy/network/api/s/default/stat/sta";
string cmd_dev_list = " --insecure -b /tmp/unifiCookie";

! Login First
dom.GetObject("CUxD.CUX2801001:2.CMD_SETS").State("/usr/local/addons/cuxd/curl "#url_login#"" #cmd_login#" --next "#url_dev_list#"" #cmd_dev_list#"");
dom.GetObject("CUxD.CUX2801001:2.CMD_QUERY_RET").State(1);
string xml_result = dom.GetObject("CUxD.CUX2801001:2.CMD_RETS").State();

! vorher gesetztes Cookie wieder löschen:
dom.GetObject("CUxD.CUX2801001:3.CMD_EXEC").State("rm /tmp/unifiCookie");

<snip>
...