Xiaomi Smart Home Komponenten

Begonnen von FosCo, 21 Dezember 2016, 18:59:59

Vorheriges Thema - Nächstes Thema

okiberlin

Das Gateway hat die Firmware 1.4.1_150.0143

Im Log steht irgendwie nicht sooo viel mehr. Ich hoffe es hilft.


2017.11.21 11:26:53 5: Xiaomi.GW1: Read> Read start
2017.11.21 11:26:53 5: Xiaomi.GW1: Read> {"cmd":"heartbeat","model":"gateway","sid":"286c07f0a2a3","short_id":"0","token":"SoZDlMocm3gGIGgN","data":"{\"ip\":\"192.168.1.100\"}"}
2017.11.21 11:26:53 1: PERL WARNING: Use of uninitialized value in string ne at ./FHEM/71_XiaomiSmartHome.pm line 147.
2017.11.21 11:26:53 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/71_XiaomiSmartHome.pm line 149.
2017.11.21 11:26:53 5: Xiaomi.GW1: Read> Change HASH Ref to
2017.11.21 11:26:53 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/71_XiaomiSmartHome.pm line 163.
2017.11.21 11:26:53 5: : Reading> Reading start
Can't call method "incr_parse" on an undefined value at ./FHEM/71_XiaomiSmartHome.pm line 164.
2017.11.21 11:26:58 5: PRESENCE (Anton.Handy) - ping command returned with output:
PING 192.168.1.46 (192.168.1.46) 56(84) bytes of data.


Merkwürdigerweise kommt nach dem 71_Xiaomi Fehler noch etwas ping von PRESENCE. Dann ist FHEM aber weg.

Viele Grüße

torte


wollo

Mein Passwort stimmt!
ich habe es auch schon 3- mal geändert, das Gateway ausgesteckt und neu eingesteckt. Das Passwort wurde gespeichert.
Ändert nichts.
Was mich wundert, dass ich in den Readings immer Token 0 habe. Früher stand da ein Code drin.
Ausserdem hatte der sich früher mit den Switches auch unterhalten, ohne dass das Passwort gesetzt war. Das brauchte man doch nur für die Änderungen des Gateways, oder?

torte

Ohne Token geht das schreiben aufs Gateway nicht.
Entweder du hast eine Firewall zwischen FHEM und dem Gateway oder der LAN Mode am GW ist nicht eingeschaltet.
Port 9898 und 4321 muss auf sein.

Wenn Du sicher bist das alles richtig ist, würd ich mal das GW komplett reseten.

okiberlin

ein list kann ich leider nicht machen, da FHEM abraucht, wenn das Xiaomi GW drin ist


define Xiaomi.GW1 XiaomiSmartHome 192.168.1.81
attr Xiaomi.GW1 devStateIcon {Color_devStateIcon(ReadingsVal($name,"rgb","000000"))}
attr Xiaomi.GW1 room MiSmartHome
attr Xiaomi.GW1 webCmd pct:rgb:rgb ff0000:rgb 00ff00:rgb 0000ff:on:off
attr Xiaomi.GW1 verbose 5

blueberry63

Zitat
Zeile 243 muss so aussehen, ist aber nur ein Warning, kommt im nächsten Release.
$temp = nearest($arround[$round-1] ,$temp );

...in Zeile 250 kommt das auch nochmal vor ;-)

Gruß
Blueberry63
FHEM auf BBB mit Wheezy: 1x CUL_HM_HM_SCI_3_FM, 1x INSTAR CAM3010, 1x HM-LC-SW1-PL2, 1x HM-LC-Bl1PBU-FM, 1x HM-Sen-MDIR-O, Viessmann Heizung, Gaszähler via GPIO, Klingel via HM-LC-Bl1PBU-FM an FBox, Mailcheck, AVR, XBMC, NanoCUL 433+668 an Raspi per Ethernet, Funksteckdosen (Pollin, IT), Automower

torte

mit welcher Fehlermeldung. Hast du alle benötigten Perl Module installiert.

torte

Zitat von: blueberry63 am 21 November 2017, 12:56:13
...in Zeile 250 kommt das auch nochmal vor ;-)

Gruß
Blueberry63

jop für hum

okiberlin

Ich habe mal probeweise alle Xiaomi Geräte bis auf das Gateway aus der Konfig entfernt. Das Resultat ist das gleiche. FHEM startet, die Webseite ist erreichbar und einige Sekunden später nicht mehr. Ich denke beim Auslesen der Geräte aus dem Gateway knallt irgendwas gewaltig


2017.11.21 14:27:43 5: Xiaomi.GW1: Read> Read start
2017.11.21 14:27:43 5: Xiaomi.GW1: Read> {"cmd":"heartbeat","model":"gateway","sid":"286c07f0a2a3","short_id":"0","token":"w8C4okmvkt8wK4Ho","data":"{\"ip\":\"192.168.1.100\"}"}
2017.11.21 14:27:43 1: PERL WARNING: Use of uninitialized value in string ne at ./FHEM/71_XiaomiSmartHome.pm line 147.
2017.11.21 14:27:43 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/71_XiaomiSmartHome.pm line 149.
2017.11.21 14:27:43 5: Xiaomi.GW1: Read> Change HASH Ref to
2017.11.21 14:27:43 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/71_XiaomiSmartHome.pm line 163.
2017.11.21 14:27:43 5: : Reading> Reading start
Can't call method "incr_parse" on an undefined value at ./FHEM/71_XiaomiSmartHome.pm line 164.


Ich habe noch ein zweites Gateway. Das soll in Zukunft Reichweitenprobleme lösen, war aber bisher noch nicht in FHEM drin. Also das erste (IP 1.81) raus und das neue (IP 1.100) in der fhem.cfg eingetragen. In der Original App sind übrigens beide Gateways drin.


define Xiaomi.GW2 XiaomiSmartHome 192.168.1.100


Der Fehler ist der gleiche.


2017.11.21 14:33:30 5: Xiaomi.GW2: updateAllReadings> Starting UpdateALLReadings
2017.11.21 14:33:31 4: Xiaomi.GW2: Write> Get all Sensors
2017.11.21 14:33:31 4: Xiaomi.GW2: Write> {"cmd" : "get_id_list"} 192.168.1.100
2017.11.21 14:33:31 5: Xiaomi.GW2: Write> End 192.168.1.100
2017.11.21 14:33:31 5: Xiaomi.GW2: Read> Read start
2017.11.21 14:33:31 5: Xiaomi.GW2: Read> {"cmd":"heartbeat","model":"gateway","sid":"34ce00889222","short_id":"0","token":"8qZPWXFOlR3qdG1l","data":"{\"ip\":\"192.168.1.81\"}"}
2017.11.21 14:33:31 1: PERL WARNING: Use of uninitialized value in string ne at ./FHEM/71_XiaomiSmartHome.pm line 147.
2017.11.21 14:33:31 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/71_XiaomiSmartHome.pm line 149.
2017.11.21 14:33:31 5: Xiaomi.GW2: Read> Change HASH Ref to
2017.11.21 14:33:31 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/71_XiaomiSmartHome.pm line 163.
2017.11.21 14:33:31 5: : Reading> Reading start
Can't call method "incr_parse" on an undefined value at ./FHEM/71_XiaomiSmartHome.pm line 164.


Mir fällt jetzt auf, dass in dem Read mit dem Fehler jeweils die IP des anderen Gateways steht. Evtl. stolpert das Modul ja über das ausgelesene Device Gateway...

wollo

OK, ich komme der Sache schon etwas näher.
Zuerst mal danke für den Hinweis, dass der Port 8383 offen sein muß.
Das erklärt vielleicht, warum es zum Schluß auf meinem Raspi Probleme gab.
Dort benutze ich nämlich das Modell ESPeasy und habe es gemäss dieser Anleitung https://wiki.fhem.de/wiki/Sonoff die ESPBridge angelegt. Dort wird ebenfalls dieser Port für die ESPBridge verwendet. Ich vermute mal, daß dies zu Konflikten führt.

Ich kann das jetzt auf die schnelle nicht testen, da ich im Moment neu FHEM auf meinem Server als Docker Container hochgezogen habe, damit ich schneller und reproduzierbarer neu installieren und testen kann.
Hier sehe ich aber jetzt ein mögliches zweites Problem:

In den Internals sehe ich das Reading FHEMIP 172.18.0.4. Die ist aber nicht die IP unter der der Gateway FHEM erreichen könnte, sondern die IP des Docker Container im internen Docker Netzwerk.
Kann ich die richtige IP dem Modul irgendwie setzen?


torte

Guten morgen,

es war aber Port 9898 und 4321.

Das Modul sucht eine NIC und bindet sich dann auf diese IP/NIC (FHEMIP).
An dieser NIC werden dann die Gateway Antworten erwartet.

Grüße
Torte


leif

#671
Guten Abend,

erst einmal Danke für dieses wunderbare Modul - eigentlich funktioniert alles wunderbar. Allerdings habe ich ein äußerst seltsames Problem.

Sobald ich dieses Modul installiere startet bei mir FHEM nicht mehr mit dem Raspberry Pi 3 mit - ich muss es immer manuell starten (sudo /etc/init.d/fhem start).   Was ich noch seltsamer finde ist dass es mit der gleichen SD Karte und im selben Netzwerk auf meinem Raspberry Pi Zero W weiterhin startet. Ist FHEM einmal gestartet läuft alles normal, die Sensoren werden erkannt und ich kann zuverlässig schalten.

Was kann das sein?


Der Log

2017.11.23 02:59:16 0: Server shutdown
2017.11.23 02:59:21 1: Including fhem.cfg
2017.11.23 02:59:21 3: telnetPort: port 7072 opened
2017.11.23 02:59:22 3: WEB: port 8083 opened
2017.11.23 02:59:22 3: WEBphone: port 8084 opened
2017.11.23 02:59:22 3: WEBtablet: port 8085 opened
2017.11.23 02:59:22 2: eventTypes: loaded 831 events from ./log/eventTypes.txt
2017.11.23 02:59:22 3: wz_computerlicht: I/O device is Hue
2017.11.23 02:59:22 3: fl_flurlicht: I/O device is Hue
2017.11.23 02:59:22 3: wz_sofalicht: I/O device is Hue
2017.11.23 02:59:23 3: wz_tischlicht: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup3: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup6: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup16: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup20: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup19: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup5: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup0: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup2: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup17: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup4: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup18: I/O device is Hue
2017.11.23 02:59:23 3: HUEGroup1: I/O device is Hue
2017.11.23 02:59:23 3: YeeLight bz_badlicht defined at 192.168.178.219:55443
2017.11.23 02:59:23 3: Opening bz_badlicht device 192.168.178.219:55443
2017.11.23 02:59:23 3: Can't connect to 192.168.178.219:55443: Network is unreac                                                        hable
2017.11.23 02:59:23 3: Opening bz_badlicht device 192.168.178.219:55443
2017.11.23 02:59:23 1: PERL WARNING: Use of uninitialized value $model in string                                                         eq at ./FHEM/32_YeeLight.pm line 172, <$fh> line 216.
2017.11.23 02:59:23 3: TelegramBot_Define telebot: called
2017.11.23 02:59:23 2: TelegramBot_DoUrlCommand telebot: FAILED http access retu                                                        rned error :https://api.telegram.org/botxxxxxxx382:AAGxxxxxxxxxxLaLF9ceHnJVl8CbGp                                                        LuRQA/getMe: Can't connect(1) to https://api.telegram.org:443: IO::Socket::INET:                                                         Bad hostname 'api.telegram.org:443':
2017.11.23 02:59:23 3: XiaomiFlowerSens (hawaipalme) - defined with BTMAC C4:7C:                                                        8D:65:A9:B5
2017.11.23 02:59:23 3: XiaomiFlowerSens (hawaipalme) - set interval to 900
2017.11.23 02:59:23 3: XiaomiFlowerSens (chili) - defined with BTMAC C4:7C:8D:65                                                        :CA:E2
2017.11.23 02:59:23 3: XiaomiFlowerSens (chili) - set interval to 900
2017.11.23 02:59:23 1: PERL WARNING: Prototype mismatch: sub main::round ($$) vs                                                         none at /usr/share/perl/5.24/Exporter.pm line 66, <$fh> line 313.
2017.11.23 02:59:23 1: PERL WARNING: Scalar value @arround[...] better written a                                                        s $arround[...] at ./FHEM/71_XiaomiSmartHome_Device.pm line 243, <$fh> line 317.
2017.11.23 02:59:23 1: PERL WARNING: Scalar value @arround[...] better written a                                                        s $arround[...] at ./FHEM/71_XiaomiSmartHome_Device.pm line 250, <$fh> line 317.
2017.11.23 02:59:23 1: Including ./log/fhem.save
2017.11.23 02:59:23 2: HUEBridge_OpenDev: error reading description: http://192.                                                        168.178.100/description.xml: Can't connect(1) to http://192.168.178.100:80: IO::                                                        Socket::INET: connect: Network is unreachable
2017.11.23 02:59:23 2: Hue: empty answer received for http://192.168.178.100/api                                                        /QSDnRzE1k7cTuA4NcgVMNxxx5RhuSykuAzqlfuj-/config
2017.11.23 02:59:23 2: HUEBridge_OpenDev: got empty config
2017.11.23 02:59:23 3: telnetForBlockingFn_1511402363: port 45701 opened
2017.11.23 02:59:23 1: usb create starting
2017.11.23 02:59:23 3: Probing CUL device /dev/ttyAMA0
2017.11.23 02:59:24 3: Probing TCM_ESP3 device /dev/ttyAMA0
2017.11.23 02:59:24 3: Probing ZWDongle device /dev/ttyAMA0
2017.11.23 02:59:24 3: Probing FRM device /dev/ttyAMA0
2017.11.23 02:59:29 1: usb create end
2017.11.23 02:59:29 0: Featurelevel: 5.8
2017.11.23 02:59:29 0: Server started with 58 defined entities (fhem.pl:15466/20                                                        17-11-20 perl:5.024001 os:linux user:fhem pid:431)
2017.11.23 02:59:29 3: Opening bz_badlicht device 192.168.178.219:55443
2017.11.23 02:59:30 3: ABFALL Muelltonnen - CALENDAR:Muelltonnen_Kalender trigge                                                        red, updating ABFALL Muelltonnen ...
Creating socket: Invalid argument
Set scan parameters failed: Input/output error


Die "Socket" Fehler erscheinen wenn ich FHEM dann nochmal manuell starte, die Karte im PI Zero habe oder dieses Modul nicht in Verwendung habe nicht.

RaspiLED

Hi,
Ist hier OT, also bitte eine neuer Thread, aber es hängt davon ab, wie Du den FHEM service startest. Meine Glaskugel sagt Du nutzt schon systemd und Dir fehlt ein After=network.target in Deiner fhem.service
Gruß Arnd


Raspi2 mit FHEM, CUL, Signalduino, MySensors, HomeBridge, Presence, Bravia, ...
Raspberry Pi mit FHEM, CUL, Signalduino, MySensors, HomeBridge, Presence, WifiLight2, Bravia, ...

leif

#673
Problem gelöst - ich musste die Ausführung von FHEM ein wenig verzögern.

okiberlin

Hallo Torte,

hast du schon eine Idee wie man mit 2 Gateways umgeht? Ich bin inzwischen sicher, dass mein Problem auftritt seit ich in der MiApp das zweite Gateway eingebunden habe.
Das "unrepeatete" Zigbee reicht aber nicht über 3 Etagen.

Viele Grüße
Olaf