fhempy: xiaomi_gateway3 (Xiaomi Gateway V3)

Begonnen von dominik, 11 Dezember 2020, 19:04:20

Vorheriges Thema - Nächstes Thema

xs3bt

Zitat von: dominik am 10 Oktober 2021, 20:16:23
Stell bitte mal beim xiaomi_gateway Device (das mit dem MQTT Logo) verbose auf 5 und mach dann einen Neustart von fhempy. Danach poste bitte das fhempy Log.

Habe bereits vorher alle Devices die was damit zutun haben auf verbose 5 gestellt, der log bleibt gleich.

Zitat2021-10-11 08:10:37,555 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-10-11 08:10:37,568 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-10-11 08:10:37,607 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2021-10-11 08:10:47,360 - INFO     - websockets.server: connection open
2021-10-11 08:10:47,364 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-10-11 08:10:48,029 - WARNING  - asyncio: Executing <Handle <TaskWakeupMethWrapper object at 0xb3b53f10>(<Future finis...events.py:396>) created at /usr/lib/python3.7/asyncio/tasks.py:368> took 0.317 seconds
2021-10-11 08:10:48,791 - DEBUG    - xiaomi_gw3: Check if device 408639306 exists
2021-10-11 08:10:49,810 - DEBUG    - xiaomi_gw3: Check if device 408639306 exists
2021-10-11 08:10:50,831 - DEBUG    - xiaomi_gw3: Check if device 408639306 exists

dominik

Mach bitte mal folgendes
telnet IP_GATEWAY
login: admin
cat /data/miio/mible_local.db


Poste dann mal den Inhalt hier, da sollten die Devices ersichtlich sein (auch wenn es etwas kryptisch aussieht).
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Vorhand

Hi dominik,
hab beim Gateway 03 Version 02LM nach deiner Anleitung ein downgrad vorgenommen. Funktioniert soweit. Außer, dass mein Lichtsensor lumisenillmgl01_0x54ef441000035650 nur "online" anzeigt, aber keine Lichtwerte anbietet.
Muss ich noch was tun?
Danke
Viele Grüße
Raspi,Homatic,ESP,Fronius,KIA-PHEV,DHW300,Mi,Shelly

Vorhand

Ach so ... mit der Handy App funktioniert die Lichtanzeige.
Viele Grüße
Raspi,Homatic,ESP,Fronius,KIA-PHEV,DHW300,Mi,Shelly

xs3bt

Zitat von: dominik am 12 Oktober 2021, 20:21:14
Mach bitte mal folgendes
telnet IP_GATEWAY
login: admin
cat /data/miio/mible_local.db


Poste dann mal den Inhalt hier, da sollten die Devices ersichtlich sein (auch wenn es etwas kryptisch aussieht).

Hallo,

hier die Ausgabe:

# cat /data/miio/mible_local.db
SQLite format 3@
▒▒▒▒




q       M
6▒      ▒▒▒O▒%''▒       tablemesh_group_v3mesh_group_v3CREATE TABLE mesh_group_v3(did CHAR(20) PRIMARY KEY, group_addr INTEGER, pdid INTEGER,templete_id INTEGER))▒ctablemesh_device_v3mesh_device_v3CREATE TABLE mesh_device_v3(did CHAR(20) PRIMARY KEY, mac CHAR(12),pdid INTEGER, uni_addr INTEGER, element_num INTEGER,group_addr INTEGER, retrans INTEGER, static_oob CHAR(40), device_key CHAR(40),netkey_id CHAR(4), appkey_id CHAR(20));O)indexsqlite_autoindex_mesh_device_v3_1mesh_device_v3▒%
         33▒qtablemesh_format_rule_v3mesh_format_rule_v3
CREATE TABLE mesh_format_rule_v3(vid CHAR(20) PRIMARY KEY, pdid INTEGER, siid INTEGER, piid INTEGER,model_id INTEGER, ack_opcode INTEGER, element_index INTEGER, format INTEGER,interval INTEGER, delta INTEGER, templete_id INTEGER, ttl INTEGER)E
▒f      ''▒te_autoindex_mesh_format_rule_v3_1mesh_format_rule_v3
           tablemesh_model_v3mesh_model_v3
CREATE TABLE mesh_model_v3(vid CHAR(20) PRIMARY KEY, pdid INTEGER,element_index INTEGER, model_id INTEGER, elements_num INTEGER,device_type INTEGER, adv_interval INTEGER, adv_timeout INTEGER)9
M'indexsqlite_autoindex_mesh_model_v3_1mesh_model_v3
                                                    %%▒)tablemesh_pdid_v3mesh_pdid_v3   CREATE TABLE mesh_pdid_v3(pdid INTEGER PRIMARY KEY, product_name VARCHAR(255))▒%%▒Gtablemesh_info_v3mesh_info_vCREATE TABLE mesh_info_v3(uni_addr INTEGER PRIMARY KEY, default_group INTEGER NOT NULL,iv_index INTEGER NOT NULL, iv_flags INTEGER NOT NULL,key_id CHAR(4) NOT NULL, netkey CHAR(40) NOT NULL, netkey_index INTEGER NOT NULL)▒5))▒%tablemesh_appkey_v3mesh_appkey_v3CREATE TABLE mesh_appkey_v3(key_id CHAR(20) PRIMARY KEY, netkey_id CHAR(4) NOT NULL,appkey CHAR(40) NOT NULL, appkey_index INTEGER NOT NULL);O)indexsqlite_autoindex_mesh_appkey_v3_1mesh_appkey_v3▒'11▒ytablegateway_rule_tablegateway_rule_tableCREATE TABLE gateway_rule_table(objid INTEGER PRIMARY KEY NOT NULL, interval INTEGER NOT NULL, delta INTEGER NOT NULL)▒)//▒tablegateway_pid_tablegateway_pid_tableCREATE TABLE gateway_pid_table(pid INTEGER PRIMARY KEY NOT NULL, objnum INTEGER NOT NULL, obj0 INTEGER NOT NULL, obj1 INTEGER NOT NULL, obj2 INTEGER NOT NULL, obj3 INTEGER NOT NULL, obj4 INTEGER NOT NULL, obj5 INTEGER NOT NULL, obj6 INTEGER NOT NULL)▒v55▒tablegateway_authed_tablegateway_authed_tableCREATE TABLE gateway_authed_table(macpid CHAR(16) PRIMARY KEY NOT NULL, mac CHAR(12) NOT NULL, pid INTEGER NOT NULL, token CHAR(24) NOT NULL, did CHAR(20) NOT NULL, beaconkey CHAR(40) NOT NULL)G[5i▒▒exsqlite_autoindex_gateway_authed_table_1gateway_authed_table
▒-%=3]269231342d5801aa269231342d58▒d8261b25e0807e0c8cb2cbecblt.3.17taeo9vge800b30100fbb1e212f63fcc1767b264db5550x▒-%=3]11f3daa8654c01aa11f3daa8654c▒fa8e8199888febea1b65effdblt.3.17tanciske80022d3580aa4ed309e93b26950b264db55debd16a0x▒-%=3]269231342d5801aa269231342d58▒d8261b25e0807e0c8cb2cbecblt.3.17taeo9vge800b30100fbb1e212f63fcc1767b264db55506fb08bw▒-%=1]65bfd2a8654c01aa65bfd2a8654c▒0a962f56e5957cb45cf39500blt.3.sg1od1bs4k004a1478b927c8e0a807ffb122b264db559e4a689bx▒-%=3]ddd9608d7cc40098ddd9608d7cc4▒e2d2f00734ba1c42e09a92a3blt.3.182e677bg5g0040be680d5ffba08dbd2d7470b264db5584a4e01dx▒-%=3]3468628d7cc400983468628d7cc4▒8d6b9eaa9d8ad2c08ec3d5c7blt.3.182g6l6aolo0040be680d5ffba08dbd2d7470b264db5584a4e01dx▒-%=3]7fce9138c1a4055b7fce9138c1a4[a24609bf3996008db142f67ablt.3.17skmoq90ls01a857f554b39ee359defdce64f440094281103fb9
||▒▒▒▒▒▒(ddd9608d7cc40-11f3daa8654c01a▒-ddd9608d7cc4009▒-65bfd2a8654c01a▒-7fce91▒▒▒▒▒[055▒-269231342d5801a▒-3468628d7cc4009▒
▒                                                                                      !
▒*                                                                             X▒▒?-000000000000000000c33322b25444c3dc7853095b28dd041cbec4b9b2  XX▒            X
▒▒007d0b60e1b4b0a64dc4eec464c9e180b659df6b38
PuTTYPuTTY

PuTTYPuTTYPuTTY
# PuTTYPuTTYPuTTYPuTTYPuTTYPuTTYPuTTY


dominik

Ein Inhalt ist zumindest da. Kannst du das File mal kopieren und hochladen, dann kann ich es bei mir drauf speichern und damit testen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

xs3bt

Zitat von: dominik am 15 Oktober 2021, 22:39:46
Ein Inhalt ist zumindest da. Kannst du das File mal kopieren und hochladen, dann kann ich es bei mir drauf speichern und damit testen.

Hey,

argh jetzt ist mir Mist passiert habe beim versuch die file mible_local.db zu laden, se aus versehen überschrieben, ich setzte die tage das ganze Gateway nochmal zurück.
Danke dir

RockFan

#22
Hallo dominik,

ich habe jetzt auch eine Gateway V3, da ich hoffentlich in Bälde 2 Rauchmelder, die nur noch über Bluetooth funktionieren bekommen werde. Aus dem anderen Post (https://forum.fhem.de/index.php/topic,117689.msg1197299.html#msg1197299) ist Dir ja vielleicht noch in Erinnerung, dass ich auch 2 Mitemp2 Sensoren habe. Nach einigen Anstrengungen, telnet über den Umweg Home Assistent auf dem Gateway aufzumachen, habe ich das Gateway nun in fhem.

Im fhempy Log bekomme nun folgende Fehlermeldungen zu den Sensoren:


2022-02-06 13:31:56,228 - ERROR    - fhempy.lib.xiaomi_gateway3.core.gateway3: Processing MQTT: ble/a4c1388a5024 b'{"humidity":37,"temperature":22.3,"battery":100}'
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/gateway3.py", line 663, in on_message
    await self.process_ble_retain(topic[4:], msg.json)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/gateway3.py", line 449, in process_ble_retain
    await self.add_entity(domain, device, k)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/helpers.py", line 66, in add_entity
    await self.setups[domain](self, device, attr)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/xiaomi_gateway3.py", line 177, in setup
    await handler(gw, device, attr)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/xiaomi_gateway3.py", line 145, in create_device
    "".join(filter(str.isalnum, device["model"])) + "_" + device["mac"]
TypeError: 'int' object is not iterable
2022-02-06 13:31:56,235 - ERROR    - fhempy.lib.xiaomi_gateway3.core.gateway3: Processing MQTT: ble/a4c138aa0cc5 b'{"temperature":23.5,"battery":100,"humidity":34}'
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/gateway3.py", line 663, in on_message
    await self.process_ble_retain(topic[4:], msg.json)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/gateway3.py", line 449, in process_ble_retain
    await self.add_entity(domain, device, k)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/helpers.py", line 66, in add_entity
    await self.setups[domain](self, device, attr)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/xiaomi_gateway3.py", line 177, in setup
    await handler(gw, device, attr)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/xiaomi_gateway3.py", line 145, in create_device
    "".join(filter(str.isalnum, device["model"])) + "_" + device["mac"]
TypeError: 'int' object is not iterable
2022-02-06 13:32:25,670 - ERROR    - wz_Lampe: Failed to send_command: status
2022-02-06 13:32:54,484 - ERROR    - fhempy.lib.xiaomi_gateway3.core.gateway3: Processing MQTT: log/ble b'{"did":"blt.3.199eag0985k00","eid":4102,"edata":"7a01","pdid":1371,"seq":78}'
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/gateway3.py", line 650, in on_message
    await self.process_ble_event_fix(msg.json)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/gateway3.py", line 399, in process_ble_event_fix
    await self.process_ble_payload(device, payload)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/gateway3.py", line 414, in process_ble_payload
    await self.add_entity(domain, device, k)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/core/helpers.py", line 66, in add_entity
    await self.setups[domain](self, device, attr)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/xiaomi_gateway3.py", line 177, in setup
    await handler(gw, device, attr)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/xiaomi_gateway3/xiaomi_gateway3.py", line 145, in create_device
    "".join(filter(str.isalnum, device["model"])) + "_" + device["mac"]
TypeError: 'int' object is not iterable


Fehlt noch die ein oder andere Aktion auf meiner Seite?

Update:
Im fhem-Log habe ich auch noch etwas gefunden:

2022.02.06 13:31:44 1: BindingsIo (local_pybinding): ERROR: Timeout while waiting for function to finish (id: 56211875)
2022.02.06 13:31:44 1:   args =>  ARRAY(0xb7b3aa8)
2022.02.06 13:31:44 1:   defargsh =>  HASH(0x81385c0)
2022.02.06 13:31:44 1:   PYTHONTYPE =>  xiaomi_tokens
2022.02.06 13:31:44 1:   msgtype =>  function
2022.02.06 13:31:44 1:   id =>  56211875
2022.02.06 13:31:44 1:   defargs =>  ARRAY(0x80f1c50)
2022.02.06 13:31:44 1:   argsh =>  HASH(0xa632b18)
2022.02.06 13:31:44 1:   NAME =>  xiaomi_tokens
2022.02.06 13:31:44 1:   function =>  FW_detailFn



Viele Grüße
Dieter
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

dominik

Danke für die Info. Probiere es bitte mit der neuen Version: 0.1.213
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RockFan

#24
Ist offensichtlich schon Version 0.1.214  ;)

Jetzt steht folgendes im Log:
2022-02-06 21:19:03,338 - ERROR    - 1371_a4c138aa0cc5: 1371 not yet supported, please report an issue here: https://github.com/dominikkarall/fhempy/issues


Nachtrag:
Und es sind zwei unsupported Devices angelegt worden.
Bsp:

{
  "Arg":"1371_a4c1388a5024",
  "Results": [
  {
    "Name":"1371_a4c1388a5024",
    "PossibleSets":"",
    "PossibleAttrs":"alias comment:textField-long eventMap:textField-long group room suppressReading userattr userReadings:textField-long verbose:0,1,2,3,4,5   IODev:fhempy_peer_192_168_178_77,fhempy_peer_192_168_178_88,local_pybinding event-aggregator event-min-interval event-on-change-reading event-on-update-reading oldreadings stateFormat:textField-long timestamp-on-change-reading DMX_B DMX_G DMX_R andFHEM_alias appOptions:textField-long assistantName:textField cmdIcon devStateIcon devStateIcon:textField-long devStateStyle fp_Dach fp_Eingang fp_Erdgeschoss fp_ErsterStock fp_Garten fp_Keller gassistantName:textField genericDeviceType:ac_unit,aircondition,airfreshener,airpurifier,awning,bathtub,bed,blender,blinds,boiler,camera,carbon_monoxide_detector,charger,closet,coffee_maker,coffeemaker,cooktop,curtain,dehumidifier,dehydrator,dishwasher,door,drawer,dryer,fan,faucet,fireplace,fryer,garage,gate,grill,heater,hood,humidifier,kettle,light,lock,remotecontrol,mop,mower,microwave,multicooker,network,outlet,oven,pergola,petfeeder,pressurecooker,radiator,refrigerator,router,scene,securitysystem,settop,sensor,shutter,shower,smoke_detector,sousvide,sprinkler,standmixer,switch,tv,thermostat,vacuum,valve,washer,waterheater,waterpurifier,watersoftener,window,yogurtmaker,aircooler,audio_video_receiver,freezer,speaker,streaming_box,streaming_stick,streaming_soundbar,soundbar homebridgeMapping:textField-long icon lightSceneParamsToSave msgContactAudio msgContactLight msgContactMail msgContactPush msgContactScreen msgParams msgPriority msgRecipient msgRecipientAudio msgRecipientLight msgRecipientMail msgRecipientPush msgRecipientScreen msgRecipientText msgTitle msgTitleShrt msgType:text,push,mail,screen,light,audio,queue realRoom:textField realtimePicker room_map sortby webCmd webCmdLabel:textField-long widgetOverride",
    "Internals": {
      "CFGFN": "",
      "DEF": "xiaomi_gateway3_device xiaomigw3_408874251 blt.3.199eag0985k00",
      "DID": "blt.3.199eag0985k00",
      "FHEMPYTYPE": "xiaomi_gateway3_device",
      "FUUID": "62002dfd-f33f-4546-2546-f0416bafea9173ca",
      "GATEWAY": "xiaomigw3_408874251",
      "IODev": "local_pybinding",
      "NAME": "1371_a4c1388a5024",
      "NR": "250315",
      "PYTHONTYPE": "xiaomi_gateway3_device",
      "STATE": "unsupported device: 1371",
      "TYPE": "PythonModule"
    },
    "Readings": {      "state": { "Value":"unsupported device: 1371", "Time":"2022-02-06 21:25:20" } },
    "Attributes": {
      "IODev": "local_pybinding",
      "group": "xiaomi_gateway3_device",
      "room": "fhempy"
    }
  }  ],
  "totalResultsReturned":1
}
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

dominik

Was ist das für ein Gerät? Temperature/ Humidity Sensor?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RockFan

Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

RockFan

Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

dominik

Passt, sollte jetzt klappen. Version 0.1.215.

Beim Rauchmelder bekommst du dann wahrscheinlich auch die Meldung, bitte diese hier posten.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RockFan

Danke für den Versuch!
Leider kommt mit der 215 noch die gleiche Meldung im Log und die Devices bleiben "unsupported"
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...