Neues Modul - 74_Unifi - Für den Ubiquiti Networks (UBNT) - Unifi Controller

Begonnen von rapster, 23 August 2015, 02:12:04

Vorheriges Thema - Nächstes Thema

Michi240281

Ich hätte da einen Wunsch:

Wäre es irgendwie möglich, auf die Readings EInfluss zu nehmen? Ich bekomme da ja jedes Gerät angezeigt, ich brauche aber nur die beiden iPhones! Der Rest interessiert mich nicht! Jedoch "müllen" mir die Readings Fhem zu, damit meine ich der Prozessor wird belastet, was unnötig ist!

Ist das irgendwie denkbar?
FHEM 5.6 auf RPi2 / HM LAN Adapter / diverse HM-Devices
FHEM-Remote-App
QNAP 419P / Onkyo TX-SR 608
DM500HD / GM Spark One
Sony 52HX905

rapster

Klar, einfach Attribut "event-on-change-reading" oder "event-on-update-reading" konfigurieren.

Nicht Readings belasten fhem, sondern Events.

Gruß
  Claudiu

manfzimm

Hallo zusammen,

das neue Modul scheint genau das richtige für meine Zwecke zu sein. Anber ich bin vermutlich zu deppert, es (auch nach Umzug meines Conrollers 4.6.6 von Windows auf einen gesonderten Raspberry mit Wheezy) richtig einzubinden.

State lautet immer "disconnected"

fhem.cfg:
define UnifiHome Unifi 192.168.2.66 8443 account blablabla
attr UnifiHome disable 0
attr UnifiHome verbose 5

LOG:
2015.08.31 09:12:02 5: UnifiHome: Defined with url:https://192.168.2.66:8443/api/s/default/, interval:30, version:4
2015.08.31 09:12:02 5: UnifiHome (Unifi_Notify) - DEFINED|MODIFIED|INITIALIZED|REREADCFG - Remove all Timers & Call DoUpdate...
2015.08.31 09:12:02 5: UnifiHome (Unifi_DoUpdate) - executed.
2015.08.31 09:12:02 5: UnifiHome (Unifi_Login_Send) - executed.

Der Aufruf von https://192.168.2.66:8443/manage/s/default/dashboard gelingt (nach Abnicken des Zertifikathinweises)

Sollte der Status nicht auf einen anderen Wert als disconnected wechseln ?

Wäre Euch für einen Hinweis sehr dankbar.

Mein Lob an alle, die dieses tolle FHEM-Meisterwerk geschaffen haben !!!!

Liebe Grüße

Manfred

rapster

Hallo Manfred,

nach dieser Logmeldung
Zitat von: manfzimm am 31 August 2015, 09:31:52
2015.08.31 09:12:02 5: UnifiHome (Unifi_Login_Send) - executed.
sollte spätestens nach 5 Sekunden eine weitere Logmeldung erscheinen. Kommt da noch was bei dir?

Gruß
  Claudiu

manfzimm

Hallo Claudiu,

vielen Dank für Deine Rückmeldung.

Nee, leider erscheinen im Log keine weiteren Meldungen. (Zwei Minuten später erfolgen Meldungen zu anderen Geräten....)

Ich bin ziemlich ratlos....

Liebe Grüße

Manfred



rapster

Das ist seltsam, der Login Versuch kehrt bei dir nie mit einer Rückmeldung zurück... (Ansonsten würde ein weiterer Logeintrag mit weiteren Infos generieert werden.)

Dein restliches Fhem ist wahrscheinlich auch aktuell oder?

Kannst du mal bitte "attr global verbose 5" setzen, und die Logs posten (als Anhang oder in <code> Tags)? (hier wird jetzt von allen Geräten/Modulen deutlich mehr geloggt, insbesondere vom HttpUtils-Modul welches Unifi verwendet.)

Und auch mal bitte ein "list UnifiHome" machen, dein Passwort aus der Ausgabe entfernen, und ebenfalls mal hier posten (als Anhang oder in <code> Tags).

Gruß
  Claudiu

manfzimm

Schon mal 1000-Dank für die Unterstützung !!!

Jawöhler, FHEM ist vollständig aktualisiert.

{ use Data::Dumper;; Dumper($defs{UnifiHome}) } liefert:

$VAR1 = {
          'DEF' => '192.168.2.66 8443 xxx 111',
          'NAME' => 'UnifiHome',
          'NOTIFYDEV' => 'global',
          'NR' => 454,
          'NTFY_ORDER' => '50-UnifiHome',
          'READINGS' => {
                          'state' => {
                                       'TIME' => '2015-08-31 15:01:07',
                                       'VAL' => 'disconnected'
                                     }
                        },
          'STATE' => 'disconnected',
          'TYPE' => 'Unifi',
          'clients' => {},
          'httpParams' => {
                            'hash' => $VAR1,
                            'ignoreredirects' => 1,
                            'loginData' => '{"username":"xxx", "password":"111"}',
                            'loginUrl' => 'https://192.168.2.66:8443/api/login',
                            'loglevel' => 5,
                            'method' => 'POST',
                            'noshutdown' => 0,
                            'sslargs' => {
                                           'SSL_verify_mode' => 'SSL_VERIFY_NONE'
                                         },
                            'timeout' => 4
                          },
          'unifi' => {
                       'CONNECTED' => 'disconnected',
                       'interval' => 30,
                       'url' => 'https://192.168.2.66:8443/api/s/default/',
                       'version' => 4
                     },
          'updateDispatch' => {}
        };

list UnifiHome liefert:
Internals:
   DEF        192.168.2.66 8443 xxx 111
   NAME       UnifiHome
   NOTIFYDEV  global
   NR         454
   NTFY_ORDER 50-UnifiHome
   STATE      disconnected
   TYPE       Unifi
   Readings:
     2015-08-31 15:01:07   state           disconnected
   Clients:
   Httpparams:
     ignoreredirects 1
     loginData  {"username":"xxx", "password":"111"}
     loginUrl   https://192.168.2.66:8443/api/login
     loglevel   5
     method     POST
     noshutdown 0
     timeout    4
     Hash:
     Sslargs:
       SSL_verify_mode SSL_VERIFY_NONE
   Unifi:
     CONNECTED  disconnected
     interval   30
     url        https://192.168.2.66:8443/api/s/default/
     version    4
   Updatedispatch:
Attributes:
   disable    0
   verbose    5

LOG mit Vervose 5:
2015.08.31 15:26:14 5: Notify loop for global ATTR global verbose 5
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60013 GET /fhem?detail=global
2015.08.31 15:26:15 4: 1906:FHEMWEB:192.168.2.119:60013: /fhem?detail=global / RL:3536 / text/html; charset=UTF-8 / Content-Encoding: gzip
/
2015.08.31 15:26:15 5: CUL/RAW: /T0A57002200EB

2015.08.31 15:26:15 4: CUL_Parse: COC T0A57002200EB -84.5
2015.08.31 15:26:15 5: COC dispatch 810c04xx0909a0010a5700002200
2015.08.31 15:26:15 4: FHT FHT_EG_WoZi actuator: 0%
2015.08.31 15:26:15 5: Triggering FHT_EG_WoZi (1 changes)
2015.08.31 15:26:15 5: Notify loop for FHT_EG_WoZi actuator: 0%
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60013 GET /fhem/pgm2/style.css
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/jquery-ui.min.css
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/jquery.min.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/jquery-ui.min.js
2015.08.31 15:26:15 4: Connection accepted from FHEMWEB:192.168.2.119:60014
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/fhemweb_fbcalllist.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/fhemweb_knob.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/fhemweb_readingsGroup.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60014 GET /fhem/pgm2/fhemweb.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60013 GET /fhem/pgm2/fhemweb_colorpicker.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/fhemweb_readingsHistory.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/fhemweb_sortable.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/fhemweb_uzsu.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60014 GET /fhem/pgm2/RSS.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/js/webviewcontrol.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/defaultCommon.css
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60013 GET /fhem/pgm2/cordova-2.3.0.js
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/dashboard_style.css
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60013 GET /fhem/images/default/icoLicht.png
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/images/default/fhemicon.png
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60014 GET /fhem/images/default/icoEverything.png
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60013 GET /fhem?cmd={AttrVal(%22global%22,%22room%22,%22%22)}&XHR=1
2015.08.31 15:26:15 5: Cmd: >{AttrVal("global","room","")}<
2015.08.31 15:26:15 4: 1906:FHEMWEB:192.168.2.119:60013: /fhem?cmd={AttrVal(%22global%22,%22room%22,%22%22)}&XHR=1 / RL:21 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/
2015.08.31 15:26:15 4: HTTP FHEMWEB:192.168.2.119:60013 GET /fhem?XHR=1&inform=type=status;filter=global;since=1441027574;fmt=JSON×tamp=1441027578310
2015.08.31 15:26:17 4: BlockingCall created child (3352), uses telnetForBlockingFn to connect back
2015.08.31 15:26:17 5: PRESENCE_DoLocalPingScan: PresDreamFleck|192.168.2.44|0|4
2015.08.31 15:26:20 5: PRESENCE (PresDreamFleck) - ping command returned with output:
PING 192.168.2.44 (192.168.2.44) 56(84) bytes of data.
64 bytes from 192.168.2.44: icmp_req=1 ttl=64 time=0.820 ms
64 bytes from 192.168.2.44: icmp_req=2 ttl=64 time=0.741 ms
64 bytes from 192.168.2.44: icmp_req=3 ttl=64 time=0.781 ms
64 bytes from 192.168.2.44: icmp_req=4 ttl=64 time=0.791 ms

--- 192.168.2.44 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 0.741/0.783/0.820/0.034 ms
2015.08.31 15:26:20 4: Connection accepted from telnet:127.0.0.1:37562
2015.08.31 15:26:20 5: Cmd: >{PRESENCE_ProcessLocalScan('PresDreamFleck|0|present')}<
2015.08.31 15:26:20 5: PRESENCE_ProcessLocalScan: PresDreamFleck|0|present
2015.08.31 15:26:20 5: Triggering PresDreamFleck (1 changes)
2015.08.31 15:26:20 5: Notify loop for PresDreamFleck present
2015.08.31 15:26:20 5: HMLAN_Send:  HMLAN1 I:K
2015.08.31 15:26:20 5: HMLAN/RAW: /HHM-LAN-IF,03C4,LEQ0101658,26EE58,123ABC,001882D2,0020,01

2015.08.31 15:26:20 5: HMLAN_Parse: HMLAN1 V:03C4 sNo:LEQ0101658 d:26EE58 O:123ABC t:001882D2 IDcnt:0020 L:1 %
2015.08.31 15:26:20 5: Triggering HMLAN1 (1 changes)
2015.08.31 15:26:20 5: Notify loop for HMLAN1 loadLvl: low
2015.08.31 15:26:29 5: HMLAN/RAW: /E2D4592,0000,0018A666,FF,FFA2,37845E2D4592000000800CB700008E002A0902FE

2015.08.31 15:26:29 5: HMLAN_Parse: HMLAN1 R:E2D4592   stat:0000 t:0018A666 d:FF r:FFA2     m:37 845E 2D4592 000000 800CB700008E002A0902FE
2015.08.31 15:26:29 5: HMLAN1 dispatch A1437845E2D4592000000800CB700008E002A0902FE::-94:HMLAN1
2015.08.31 15:26:29 5: Triggering STAP_PM_Waschmaschine_Pwr (9 changes)
2015.08.31 15:26:29 5: Notify loop for STAP_PM_Waschmaschine_Pwr boot: off
2015.08.31 15:26:29 5: Triggering STAP_PM_Waschmaschine_SenF (1 changes)
2015.08.31 15:26:29 5: Notify loop for STAP_PM_Waschmaschine_SenF 49.98
2015.08.31 15:26:30 5: Triggering STAP_PM_Waschmaschine_SenI (1 changes)
2015.08.31 15:26:30 5: Notify loop for STAP_PM_Waschmaschine_SenI 42
2015.08.31 15:26:30 5: Triggering STAP_PM_Waschmaschine_SenPwr (1 changes)
2015.08.31 15:26:30 5: Notify loop for STAP_PM_Waschmaschine_SenPwr 1.42
2015.08.31 15:26:30 5: Triggering STAP_PM_Waschmaschine_SenU (1 changes)
2015.08.31 15:26:30 5: Notify loop for STAP_PM_Waschmaschine_SenU 230.6
2015.08.31 15:26:30 4: Connection closed for FHEMWEB:192.168.2.119:60013: EOF
2015.08.31 15:26:30 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem?detail=UnifiHome
2015.08.31 15:26:30 4: 1906:FHEMWEB:192.168.2.119:60012: /fhem?detail=UnifiHome / RL:2704 / text/html; charset=UTF-8 / Content-Encoding: gzip
/
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/style.css
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/jquery.min.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/fhemweb_colorpicker.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/jquery-ui.min.css
2015.08.31 15:26:31 4: Connection accepted from FHEMWEB:192.168.2.119:60021
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60014 GET /fhem/pgm2/jquery-ui.min.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/fhemweb_fbcalllist.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/fhemweb_knob.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/fhemweb_readingsGroup.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60014 GET /fhem/pgm2/fhemweb_readingsHistory.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60021 GET /fhem/pgm2/fhemweb.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/fhemweb_sortable.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/fhemweb_uzsu.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/RSS.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60014 GET /fhem/pgm2/cordova-2.3.0.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/defaultCommon.css
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60021 GET /fhem/js/webviewcontrol.js
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/dashboard_style.css
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/images/default/icoLicht.png
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/images/default/icoEverything.png
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60014 GET /fhem/images/default/fhemicon.png
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem?cmd={ReadingsVal(%22UnifiHome%22,%22clear%22,%22%22)}&XHR=1
2015.08.31 15:26:31 5: Cmd: >{ReadingsVal("UnifiHome","clear","")}<
2015.08.31 15:26:31 4: 1906:FHEMWEB:192.168.2.119:60012: /fhem?cmd={ReadingsVal(%22UnifiHome%22,%22clear%22,%22%22)}&XHR=1 / RL:21 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem?cmd={AttrVal(%22UnifiHome%22,%22room%22,%22%22)}&XHR=1
2015.08.31 15:26:31 5: Cmd: >{AttrVal("UnifiHome","room","")}<
2015.08.31 15:26:31 4: 1906:FHEMWEB:192.168.2.119:60010: /fhem?cmd={AttrVal(%22UnifiHome%22,%22room%22,%22%22)}&XHR=1 / RL:21 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/
2015.08.31 15:26:31 4: HTTP FHEMWEB:192.168.2.119:60021 GET /fhem?XHR=1&inform=type=status;filter=UnifiHome;since=1441027589;fmt=JSON×tamp=1441027593909
2015.08.31 15:26:35 4: Connection closed for FHEMWEB:192.168.2.119:60021: EOF
2015.08.31 15:26:35 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem?detail=UnifiHome&detail=UnifiHome&val.modifyUnifiHome=192.168.2.66+8443+yyy+111&cmd.modifyUnifiHome=modify+UnifiHome
2015.08.31 15:26:35 5: Cmd: >modify UnifiHome 192.168.2.66 8443 yyy 111<
2015.08.31 15:26:35 5: UnifiHome: Defined with url:https://192.168.2.66:8443/api/s/default/, interval:30, version:4
2015.08.31 15:26:35 5: Triggering global (1 changes)
2015.08.31 15:26:35 5: Notify loop for global MODIFIED UnifiHome
2015.08.31 15:26:36 5: UnifiHome (Unifi_Notify) - DEFINED|MODIFIED|INITIALIZED|REREADCFG - Remove all Timers & Call DoUpdate...
2015.08.31 15:26:36 5: Triggering UnifiHome (1 changes)
2015.08.31 15:26:36 5: Notify loop for UnifiHome initialized
2015.08.31 15:26:36 5: UnifiHome (Unifi_DoUpdate) - executed.
2015.08.31 15:26:36 5: Triggering UnifiHome (1 changes)
2015.08.31 15:26:36 5: Notify loop for UnifiHome disconnected
2015.08.31 15:26:36 5: UnifiHome (Unifi_Login_Send) - executed.
2015.08.31 15:26:36 5: HttpUtils url=https://192.168.2.66:8443/api/login
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem?detail=UnifiHome
2015.08.31 15:26:36 4: 1906:FHEMWEB:192.168.2.119:60012: /fhem?detail=UnifiHome / RL:2716 / text/html; charset=UTF-8 / Content-Encoding: gzip
/
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/style.css
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/jquery-ui.min.css
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/jquery.min.js
2015.08.31 15:26:36 4: Connection accepted from FHEMWEB:192.168.2.119:60022
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60014 GET /fhem/pgm2/jquery-ui.min.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/fhemweb_fbcalllist.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/fhemweb_colorpicker.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/fhemweb_knob.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60022 GET /fhem/pgm2/fhemweb.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/fhemweb_readingsHistory.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/fhemweb_sortable.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/fhemweb_uzsu.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60022 GET /fhem/pgm2/RSS.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60014 GET /fhem/pgm2/fhemweb_readingsGroup.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/pgm2/cordova-2.3.0.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/js/webviewcontrol.js
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60011 GET /fhem/pgm2/defaultCommon.css
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/pgm2/dashboard_style.css
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem/images/default/icoLicht.png
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60010 GET /fhem/images/default/icoEverything.png
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60022 GET /fhem/images/default/fhemicon.png
2015.08.31 15:26:36 4: HTTP FHEMWEB:192.168.2.119:60012 GET /fhem?cmd={ReadingsVal(%22UnifiHome%22,%22clear%22,%22%22)}&XHR=1

Hinweis: 192.168.2.119 ist mein Arbeitsplatzrechner (MacBook)


rapster

Super Infos!, würdest du bitte noch kurz deinen Beitrag bearbeiten und die Ausgaben(logs usw.) in Code-Blöcke einpacken? (das ist das #-Icon über dem Textfeld).

Es sieht so aus als ob deine HttpUtils.pm nicht aktuell ist, dadurch kann ich zumindest dieses Verhalten nachstellen.

Schau mal bitte in die Datei /fhem/FHEM/HttpUtils.pm was da in der zweiten Zeile steht, es sollte sein:
# $Id: HttpUtils.pm 9116 2015-08-23 11:30:20Z rudolfkoenig $
Falls dies nicht so ist mach mal ein "update force", falls "update" alleine nichts tun will.

Falls die HttpUtils.pm aktuell ist,
ersetze mal bitte Zeile 52 in der /fhem/FHEM/74_Unifi.pm durch diese:
sslargs         => { SSL_version => 'SSLv23', SSL_verify_mode => 'SSL_VERIFY_NONE' },
und probiere es nach einem Fhem-Neustart erneut.

Falls es dann immer noch nicht funktionieren sollte,
- prüfe mal was du erhälst wenn du per Browser auf die Seite https://192.168.2.66:8443/api/login gehst.
- und Prüfe mal mit diesem Linux-Shell Befehl welche IO::Socket::SSL version du auf deiner Fhem-Maschine verwendest: perl -M'IO::Socket::SSL' -e 'print "$IO::Socket::SSL::VERSION\n"'

Gruß
  Claudiu

rapster

    Habe eben eine neue Version eingecheckt, ist dann Morgen im Update.


    • Locate an/abschaltbar pro Accesspoint oder alle auf einmal. (Leider habe ich bisher keine Möglichkeit gefunden anzuzeigen ob locate i.M. aktiviert ist)
    • Alarmanzeige & Archivierung noch nicht archivierter Alarme.
    • Neustarten eines oder aller Accesspoints.
    • Disconnecten eines oder aller Clients. (z.B. nutzbar um bei einem schlechten SNR-Wert ein roaming zu erzwingen)
    • Anzeigen der letzten Events in der konfigurierbaren 'eventPeriod'
    • Eine Menge neuer Readings:

      • Jeder Client hat nun 6 readings für connection-state, SNR, uptime, last_seen-time, verbundener-AP und hostname.
      • Jeder AP hat nun 3 readings für state (kann i.M sein: 'ok' oder 'error'), essid's und connected-clients count.
        @Christoph.Goth: Ich kenne i.M. nur den state 1 (ok) und 0 (error), kannst du mir mal Daten mithilfe des fhem-Befehls {use Data::Dumper;;Dumper($defs{MeinUnifiFhemDevice})} zukommen lassen wenn sich ein AP im 'Bridged' Modus befindet?
      • Der unifi-controller hat nun 6 readings für event-count in konfigurierbarer 'timePeriod', unarchived-alert count, accesspoint count, overall wlan-state (kann i.M. sein: 'ok', 'warning' (wenn z.B. 1 von 2 AP down ist), oder etwas anderes evtl.  ;) ), connected user count and connected guest count.
    • Zwei neue Attribute:

      • attr eventPeriod: Um die Zeit der abzufragenden Events anzugeben. (default: 24h)
      • attr httpLoglevel: Damit man bei Problemen wie von @manfzimm nicht mehr global verbose hochsetzen muss, um die Logmeldungen des HttpUtils Moduls zu erhalten.
Und evtl. noch ein paar Kleinigkeiten die ich jetzt hier vergessen habe  :)

@manfzimm: Die beschriebene Änderung bzgl. sslargs habe ich ebenfalls in das Modul eingebaut, bitte probieren ob es nach einem Update dadurch bei dir funktioniert.

Habe das ganze allerdings erst mit Controller v4.x getestet, hoffe bei v3.x gibt es keine Probleme...

Gruß
  Claudiu

Christoph.Goth

@rapster:
Okay, ich schaue heute Abend mal was er anzeigt/reportet wenn der AP im Bridge Modus ist.

Habe mir mal ein paar ReadingGroups gebaut, evtl kann es der eine oder andere auch gebrauchen:
(http://bilder.2-cpu.de/fhem/wlan_unifi.PNG)

define Wifi_Clients_Status readingsGroup <Gerätename>,<Status>\
unifi_controller:Sandra_P8\
unifi_controller:Chris_LG_G4\
unifi_controller:Chris_HTC_HD2\
unifi_controller:Chris_Samsung_Note_10.1
attr Wifi_Clients_Status alias Wifi Clients Status
attr Wifi_Clients_Status group Wifi
attr Wifi_Clients_Status mapping { 'Sandra_P8' => 'Sandra P8', 'Chris_LG_G4' => 'Chris LG G4', 'Chris_HTC_HD2' => 'Chris HTC HD2',  'Chris_Samsung_Note_10.1' => 'Chris Samsung Note 10.1' }
attr Wifi_Clients_Status nameStyle style="color:yellow;;font-weight:bold"
attr Wifi_Clients_Status notime 1
attr Wifi_Clients_Status room Z_Groups
attr Wifi_Clients_Status valueStyle { if($VALUE eq "disconnected"){ 'style="color:red;;font-weight:bold"' }elsif($VALUE eq "connected"){ 'style="color:green;;font-weight:bold"' }}


define Wifi_APs readingsGroup <Gerätename>,<Status>\
unifi_controller:#AP.*
attr Wifi_APs alias Wifi APs
attr Wifi_APs group Wifi
attr Wifi_APs mapping { '#AP_AP Keller Vorne_clients' => 'AP Keller Vorne: Clients',  '#AP_AP Wohnzimmer Hinten_clients' => 'AP Wohnzimmer Hinten: Clients', '#AP_AP Keller Vorne_essid' => 'AP Keller Vorne: SSIDs', '#AP_AP Wohnzimmer Hinten_essid' => 'AP Wohnzimmer Hinten: SSIDs', '#AP_AP Keller Vorne_state' => 'AP Keller Vorne: Status', '#AP_AP Wohnzimmer Hinten_state' => 'AP Wohnzimmer Hinten: Status' }
attr Wifi_APs nameStyle style="color:yellow;;font-weight:bold"
attr Wifi_APs notime 1
attr Wifi_APs room Z_Groups
attr Wifi_APs valueStyle { if($VALUE eq "disconnected"){ 'style="color:red;;font-weight:bold"' }elsif($VALUE eq "ok"){ 'style="color:green;;font-weight:bold"' }elsif(($READING eq "#AP_AP Keller Vorne_clients" || $READING eq "#AP_AP Wohnzimmer Hinten_clients") && $VALUE < 7){ 'style="color:green;;font-weight:bold"' }elsif(($READING eq "#AP_AP Keller Vorne_clients" || $READING eq "#AP_AP Wohnzimmer Hinten_clients") && $VALUE >= 7){ 'style="color:red;;font-weight:bold"' }else{ 'style="color:grey;;font-weight:bold"' }}


define Wifi_Clients readingsGroup <Gerätename>,<Status>\
unifi_controller:#UC_wlan_state\
unifi_controller:#UC_wlan_accesspoints\
unifi_controller:#UC_wlan_users\
unifi_controller:#UC_wlan_guests
attr Wifi_Clients alias Wifi Clients
attr Wifi_Clients group Wifi
attr Wifi_Clients mapping { '#UC_wlan_state' => 'WLan Gesamtstatus', '#UC_wlan_accesspoints' => 'WLan Access Points', '#UC_wlan_users' => 'WLan Benutzer in Produktion', '#UC_wlan_guests' => 'WLan Gast Benutzer' }
attr Wifi_Clients nameStyle style="color:yellow;;font-weight:bold"
attr Wifi_Clients notime 1
attr Wifi_Clients room Z_Groups
attr Wifi_Clients valueStyle { if($READING eq "#UC_wlan_state" && $VALUE eq "error"){ 'style="color:red;;font-weight:bold"' }elsif($READING eq "#UC_wlan_state" && $VALUE eq "ok"){ 'style="color:green;;font-weight:bold"' }elsif(($READING eq "#UC_wlan_users" || $READING eq "#UC_wlan_guests") && $VALUE < 10){ 'style="color:green;;font-weight:bold"' }elsif(($READING eq "#UC_wlan_users" || $READING eq "#UC_wlan_guests") && $VALUE >= 10){ 'style="color:red;;font-weight:bold"' }else{ 'style="color:grey;;font-weight:bold"' }}



Ohne Garantie auf die sauberste Umsetzung, bin immer offen für Verbesserungsvorschläge ;)

manfzimm

Hallo Claudiu,

ein "update force" hatte ich zur Sicherheit einfach schon mal durchgeführt. Die HttpUtils.pm ist aktuell und zeigt genau die von Dir genannte Zeile.

Dannach habe ich die 74_Unifi.pm in Zeile 52 ersetzt. Nach reboot des beider Raspis (FHEM und Unifi) leider keine Änderung.

https://192.168.2.66:8443/api/login zeigt:
{ "data" : [ ] , "meta" : { "msg" : "api.err.Invalid" , "rc" : "error"}}

Meine IO::Socket::SSL-Version lautet 1.76

Zwischenzeitlich habe ich den Unifi-Controller (V. 4.6.6. auf dem Raspi 2) nochmals neu installiert.

Leider kein Erfolg - schnief....

Merci Merci !!!!

Manfred






rapster

Hallo Manfred,

denke das liegt an deiner IO::Socket::SSL Version, da diese schon relativ alt ist.

Mit der heutigen Version aus dem fhem-update funktioniert es warscheinlich auch nicht oder?

Ich schau mal was ich machen kann.

Gruß
  Claudiu

rapster

@Manfred:

Mach mal bitte folgendes:

1. aktualisiere das Unifi-Modul (fhem) auf die aktuelle Version über das fhem-update
2. ersetze die /fhem/FHEM/HttpUtils.pm durch anhängende.
3. setze an deinem Unifi-device das Attribute "attr httpLoglevel 1"
4. starte fhem neu

Jetzt sollte im Log eine Zeile kommen die so ungefähr anfängt:
https://192.168.1.66:8443/api/login: Can't connect(2) to .......

Die Fehlermeldung wird dann hoffentlich mehr Infos liefern :-)

Gruß
  Claudiu

manfzimm

Hallo nochmal ;-)

super Tip !!! Hier der Auszug aus dem LOG:
2015.09.01 20:21:29 5: UnifiHome: Defined with url:https://192.168.2.33:8443/api/s/default/, interval:30, version:4
2015.09.01 20:21:29 5: UnifiHome (Unifi_Notify) - executed. - Remove all Timers & Call DoUpdate...
2015.09.01 20:21:29 5: UnifiHome (Unifi_DoUpdate) - executed.
2015.09.01 20:21:29 5: UnifiHome (Unifi_Login_Send) - executed.
2015.09.01 20:21:29 1: HttpUtils url=https://192.168.2.33:8443/api/login
2015.09.01 20:21:29 1: https://192.168.2.33:8443/api/login: Can't connect(2) to https://192.168.2.33:8443:  SSL Version SSLv2 not supported error:00000000:lib(0):func(0):reason(0)

Mein FHEM-Raspi meldet nach einem
apt-get update
apt-get install libio-socket-ssl-perl

libio-socket-ssl-perl ist schon die neueste Version.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 332 nicht aktualisiert.

Vermutlich die richtige Ecke - aber mein Hirn bietet zu wenig Linux-kapazitäten....



rapster

OK, dann haben wir schonmal an der richtigen Stelle gebuddelt.

Laut Dokumentation http://search.cpan.org/~sullr/IO-Socket-SSL-1.76/SSL.pm#METHODS sollte es allerdings mit deiner SSL-Version generell funktionieren.

Probier mal bitte: "attr global sslVersion SSLv23" zu setzen, obwohl der default-Wert normalerweise i.M. vom Unifi-Modul genau damit überschrieben werden "sollte".

Um SSL selber upzudaten wirst du warscheinlich deine /etc/apt/sources.list anpassen, oder apt.pinning verwenden müssen.

Gruß
  Claudiu