UniFi-basierte Anwesenheitserkennung

Problemlösungen und Hinweise von allgemeinem Interesse zur Haussteuerung mit HomeMatic

Moderator: Co-Administratoren

Mtm87
Beiträge: 38
Registriert: 19.02.2018, 22:32
Hat sich bedankt: 9 Mal
Danksagung erhalten: 2 Mal

Re: UniFi-basierte Anwesenheitserkennung

Beitrag von Mtm87 » 17.10.2022, 20:46

MagicDude4Eva hat geschrieben:
16.10.2022, 16:52
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>
...
Hey MagicDude4Eva,

TANKS a lot it works very good. :-)

best regards
mtm87
Raspberrymatic (Home Assistant AddOn)
RPI-RF-MOD
HmIP-HAB
2x HomeMatic RF-LAN-Gateway

>135 Geräte
>190 Programme
>180 Systemvariablen

omicronCZ
Beiträge: 218
Registriert: 31.07.2011, 17:37
System: CCU
Wohnort: Czech Rep.
Hat sich bedankt: 83 Mal
Danksagung erhalten: 14 Mal

Re: UniFi-basierte Anwesenheitserkennung

Beitrag von omicronCZ » 20.10.2022, 20:30

Sorry a bit different problem - but hasn't anyone solved the management of individual PoE ports in UBNT Unifi PoE switch with some script directly from CCU?

I need to use PoE power to turn off and on some APs, IP cameras and other devices with PoE power from the Unifi switch.
According to different events in Homematic CCU.

MagicDude4Eva
Beiträge: 7
Registriert: 16.10.2022, 11:41
System: CCU
Danksagung erhalten: 1 Mal

Re: UniFi-basierte Anwesenheitserkennung

Beitrag von MagicDude4Eva » 24.10.2022, 09:04

Die API spec gibt es hier: https://ubntwiki.com/products/software/ ... roller/api - dort gibt es:

Code: Alles auswählen

devmgr	power-cycle	mac = switch mac ( required ), port_idx = PoE port to cycle ( required )

omicronCZ
Beiträge: 218
Registriert: 31.07.2011, 17:37
System: CCU
Wohnort: Czech Rep.
Hat sich bedankt: 83 Mal
Danksagung erhalten: 14 Mal

Re: UniFi-basierte Anwesenheitserkennung

Beitrag von omicronCZ » 24.10.2022, 11:11

Thanks, I know about that API, however my knowledge of HM scripting is not that far off.

Additionally, I would need not only a "Power Cycle", which is just a reset of the PoE port, but a full power off and on of the PoE port.

If anyone would like to look into this, I would be very happy to.

michael24179
Beiträge: 28
Registriert: 13.09.2017, 14:06
Hat sich bedankt: 1 Mal

Re: UniFi-basierte Anwesenheitserkennung

Beitrag von michael24179 » 19.12.2023, 07:30

Hat schon jemand das Ganze mit der letzten Version 8.0.24 und den Cloudkey 2 Plus am Laufen gebracht? Ich bekomme die XML nicht geladen.

Antworten

Zurück zu „HomeMatic Tipps & Tricks - keine Fragen!“