NEWS
Unifi Steuern ohne Adapter (Script,SSH)
-
ne ich hab ne udm pro
-
das ist die seite, wo ich die infos her habe - https://github.com/jens-maus/node-unifi
laut diesem issue, sollte es theoretisch funktionieren https://github.com/jens-maus/node-unifi/issues/227
-
wer interesse hat, was alles gehen sollte
https://github.com/jens-maus/node-unifi/blob/master/unifi.js
bei mir werden rechts die ganzen funktionen angezeigt:
-
bei mir sind wohl noch alte vouchers im system
mit diesem script sehe ich sie und könnte sie dann in der vis anzeigen ode rüber telegram versenden ...
log:
script.js.MYSTUFF.ALLERLEI.AAAUNIFI.unifi-wlan-schalten3: vouchers: [{"duration":123,"qos_overwrite":false,"note":"testthis","code":"6566218181","for_hotspot":false,"create_time":1717058841,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583d19108fed3b1dc7283c","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"7113118220","for_hotspot":false,"create_time":1717058021,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"665839e5108fed3b1dc72722","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"4515536233","for_hotspot":false,"create_time":1717057059,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583623108fed3b1dc725f0","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"8241421156","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67c","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"7446834263","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67b","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":525600,"qos_overwrite":false,"note":null,"code":"7358319725","for_hotspot":false,"create_time":1650354660,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e69e497578402ac2db679","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2729460620","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7096","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"1795017450","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7095","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2281225310","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7094","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0356279115","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7093","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"3544056744","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7092","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6426769406","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7091","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2298091277","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7090","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"8878654311","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708f","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6946187591","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708e","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0579279641","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708d","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0}]
im log ist der erste eintrag ein test mit 123... - wurde wohl angelegt - damit funktioniert es wohl
-
die info mit dem port dazu müsste ich ja den code ändern.
die letzte info mit den funktionen ist nützlich. wie bekommst die anzeige hin? mir wird das in github nicht angezeigt
-
@kmxak
das weiß ich nicht war einfach da - wie sieht es bei dir aus -
@liv-in-sky sagte in Adapter: ioBroker.unifi:
bei mir sind wohl noch alte vouchers im system
mit diesem script sehe ich sie und könnte sie dann in der vis anzeigen ode rüber telegram versenden ...
log:
script.js.MYSTUFF.ALLERLEI.AAAUNIFI.unifi-wlan-schalten3: vouchers: [{"duration":123,"qos_overwrite":false,"note":"testthis","code":"6566218181","for_hotspot":false,"create_time":1717058841,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583d19108fed3b1dc7283c","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"7113118220","for_hotspot":false,"create_time":1717058021,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"665839e5108fed3b1dc72722","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":123,"qos_overwrite":false,"note":"testthis","code":"4515536233","for_hotspot":false,"create_time":1717057059,"quota":0,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"66583623108fed3b1dc725f0","admin_name":"e","used":0,"status":"VALID_MULTI","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"8241421156","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67c","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":5760,"qos_overwrite":false,"note":null,"code":"7446834263","for_hotspot":false,"create_time":1650354689,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e6a0197578402ac2db67b","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":525600,"qos_overwrite":false,"note":null,"code":"7358319725","for_hotspot":false,"create_time":1650354660,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"625e69e497578402ac2db679","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2729460620","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7096","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"1795017450","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7095","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2281225310","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7094","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0356279115","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7093","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"3544056744","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7092","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6426769406","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7091","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"2298091277","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f7090","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"8878654311","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708f","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"6946187591","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708e","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0},{"duration":1440,"qos_overwrite":false,"note":null,"code":"0579279641","for_hotspot":false,"create_time":1627921177,"quota":1,"site_id":"5cadc7f53b6a3967dd7e5369","_id":"61081b1997578402177f708d","admin_name":"e","used":0,"status":"VALID_ONE","status_expires":0}]
im log ist der erste eintrag ein test mit 123... - wurde wohl angelegt - damit funktioniert es wohl
dazu müsste ich erstmal den login fixen. ich habe ja noch andere sachen da laufen die können sich verbinden. auch der protect adapter kann sich verbinden... mal sehen wenn ich mal zeit habe ... lege es auf den haufen mit todo
-
@liv-in-sky sagte in Adapter: ioBroker.unifi:
@kmxak
das weiß ich nicht war einfach da - wie sieht es bei dir aussorry mein fehler war mit dem browser nicht eingeloggt.
-
ah, jetzt geht es... falscher port
bekomme aber nur:
javascript.0 11:50:46.998 info script.js.User.Unifi.Unifi_Node: login: true javascript.0 11:50:47.064 info script.js.User.Unifi.Unifi_Node: vouchers: [object Object],[object Object],[object Object],[object Object],[object Object] javascript.0 11:50:47.084 info script.js.User.Unifi.Unifi_Node: logout: {"success":true}
der hier funzt nicht mit deinem aus dem code geht es
console.log("vouchers: "+ myVouchers)
-
@kmxak sagte in Adapter: ioBroker.unifi:
die info mit dem port dazu müsste ich ja den code ändern.
kannst du ja machen - die datei unifi.js liegt ja im verzeichnis vom iobroker
auf eigene verantwortung
-
@kmxak sagte in Adapter: ioBroker.unifi:
console.log("vouchers: "+ myVouchers)
mein fehler
so muss es heißen
console.log("vouchers: "+ JSON.stringify(myVouchers))
-
ja danke damit ging es und es funktioniert.
Damit kann ich ja weiterarbeiten.
-
hab gerade mal mit euch getestet, funktioniert hier auch, guter Ansatz, vielleicht bekommt man damit noch mehr gebacken.. aber die Vouchers funktionieren schonmal, brauch ich zwar nicht.. aber man weiss ja nie.. -
es gibt auch ein beispiel, wie man einen poe prot abschaltet
https://github.com/jens-maus/node-unifi/blob/master/examples/poe-switch-onoff.js
-
@liv-in-sky sagte in Adapter: ioBroker.unifi:
es gibt auch ein beispiel, wie man einen poe prot abschaltet
https://github.com/jens-maus/node-unifi/blob/master/examples/poe-switch-onoff.js
POE schalten kann der Adapter ja... einen ganzen Port disablen aber wohl nicht..
-
hab ich gelesen - aber evtl kann man daraus ableiten, wie man einen port blockiert oder disabled oder sowas
-
@liv-in-sky Habe mich jetzt mal kurz eingelesen. Der ioBroker Adapter baut ja genau auf diesen "node-unifi" auf. Kannst du Voucher erstellen? Die Abfrage ob es welche gibt funktioniert ja noch im Adapter... Nur die Anforderung nicht. Kann gerade nicht testen weil ich unterwegs bin und nur auf dem Handy schreiben kann
-
@draexler nee - -beim anlegen über adapter kommt eine fehlermeldung im log
-
@liv-in-sky bekommst du über beide wege die Meldung? Also Adapter ODER/UND Javascript Instanz?
-
@draexler fehler nur bei adapter beim anlegen von vouchers