lasthead0 / ioBroker.xiaomi-gateway3

Adapter for Xiaomi Gateway 3 integration
MIT License
6 stars 4 forks source link

Restart loop in v.0.3.0. #6

Closed neo4a closed 2 years ago

neo4a commented 2 years ago

Trying to connect to model lumi.gateway.mgl03 (FW 1.5.1_0032 Server CN). Provided token and IP address and telnet cmd #2

log error msg:

host.iobrokerSmartHome) | 2022-01-03 11:32:38.225 | info | host.iobroker(SmartHome) Restart adapter system.adapter.xiaomi-gateway3.0 because enabled -- | -- | -- | -- host.iobrokerSmartHome) | 2022-01-03 11:32:38.224 | error | host.iobroker(SmartHome) instance system.adapter.xiaomi-gateway3.0 terminated with code 6 (UNCAUGHT_EXCEPTION) xiaomi-gateway3.0 | 2022-01-03 11:32:38.078 | error | Cannot convert undefined or null to object xiaomi-gateway3.0 | 2022-01-03 11:32:38.078 | error | TypeError: Cannot convert undefined or null to object at Timeout._onTimeout (C:\Program Files\iobroker\SmartHome\node_modules\iobroker.xiaomi-gateway3\lib\utils.js:12:39) at listOnTimeout (internal/timers.js:555:17) at processTimers (internal/timers.js:498:7) xiaomi-gateway3.0 | 2022-01-03 11:32:38.077 | error | uncaught exception: Cannot convert undefined or null to object xiaomi-gateway3.0 | 2022-01-03 11:32:37.567 | warn | Terminated (UNCAUGHT_EXCEPTION): Without reason xiaomi-gateway3.0 | 2022-01-03 11:32:37.566 | info | terminating xiaomi-gateway3.0 | 2022-01-03 11:32:37.565 | error | Cannot set property '79769bf4dbeae735f6672ad6d333bade' of undefined xiaomi-gateway3.0 | 2022-01-03 11:32:37.565 | error | TypeError: Cannot set property '79769bf4dbeae735f6672ad6d333bade' of undefined at C:\Program Files\iobroker\SmartHome\node_modules\iobroker.xiaomi-gateway3\lib\utils.js:11:32 at new Promise () at sleep (C:\Program Files\iobroker\SmartHome\node_modules\iobroker.xiaomi-gateway3\lib\utils.js:8:12) at TelnetShell._shellExec (C:\Program Files\iobroker\SmartHome\node_modules\iobroker.xiaomi-gateway3\lib\shell.js:150:23) at async TelnetShell.getFwVersion (C:\Program Files\iobroker\SmartHome\node_modules\iobroker.xiaomi-gateway3\lib\shell.js:335:16) at async Gateway3.initialize (C:\Program Files\iobroker\SmartHome\node_modules\iobroker.xiaomi-gateway3\lib\gateway3.js:209:32) at async XiaomiGateway3.onReady (C:\Program Files\iobroker\SmartHome\node_modules\iobroker.xiaomi-gateway3\main.js:114:46) xiaomi-gateway3.0 | 2022-01-03 11:32:37.564 | error | unhandled promise rejection: Cannot set property '79769bf4dbeae735f6672ad6d333bade' of undefined xiaomi-gateway3.0 | 2022-01-03 11:32:37.564 | error | Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). xiaomi-gateway3.0 | 2022-01-03 11:32:36.930 | info | Xiaomi Gateway 3 adapter loaded.
lasthead0 commented 2 years ago

Hi. This was my mistake cause of global variables renaming. last commit have to fix issue.

neo4a commented 2 years ago

Reinstallaed adapter and instance and now it it's turning green :)

Thank you.

In object tree I can seee only device ID (I'm using this gateway for monitoring several BLE plant monitor devices). Would like to see some properties to include it in iobroker scripts. Any chance to get it?

lasthead0 commented 2 years ago

as i written in readme "BLE devices may not have states at first time after pairing because i don't know specs for devices and didn't define properties for all devices for now. States will added when device will update corresponding property." So, that means when monitor will send new value of temperature, for example, corresponding state will be added to device. Also will be added 'debug_output' which collect some useful information for me. You can give me this info after collection for few time. i can use this info to define device states and in future states will be in tree since adapter start.

neo4a commented 2 years ago

This is what I see in Mi Home app.

Bildschirmfoto 2022-01-04 um 14 20 23 (002)

This is what I see in iobroker.

Note: I've re-installed intance, deleted object tree: no device properties so far

Screenshot iobroker

Log entries:

xiaomi-gateway3.0 | Zeit | silly | Nachricht -- | -- | -- | -- xiaomi-gateway3.0 | 2022-01-04 14:13:08.653 | info | Xiaomi Gateway3 (192.168.178.72) firmware version = 1.5.1_0032 xiaomi-gateway3.0 | 2022-01-04 14:12:56.068 | info | Xiaomi Gateway 3 adapter loaded. xiaomi-gateway3.0 | 2022-01-04 14:12:56.059 | info | starting. Version 0.3.0 in C:/Program Files/iobroker/SmartHome/node_modules/iobroker.xiaomi-gateway3, node: v14.17.0, js-controller: 3.3.22 xiaomi-gateway3.0 | 2022-01-04 14:12:50.535 | info | Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason xiaomi-gateway3.0 | 2022-01-04 14:12:50.535 | info | terminating xiaomi-gateway3.0 | 2022-01-04 14:12:50.534 | info | Got terminate signal TERMINATE_YOURSELF xiaomi-gateway3.0 | 2022-01-04 14:12:49.238 | error | ERROR: Can't open telnet on device xiaomi-gateway3.0 | 2022-01-04 14:12:44.179 | info | Xiaomi Gateway 3 adapter loaded. xiaomi-gateway3.0 | 2022-01-04 14:12:44.170 | info | starting. Version 0.3.0 in C:/Program Files/iobroker/SmartHome/node_modules/iobroker.xiaomi-gateway3, node: v14.17.0, js-controller: 3.3.22
lasthead0 commented 2 years ago

I didn't test FW 1.5.1_0032, so i can't guaranteeing that adapter work with it. This firmware can have breacking changes compared with 1.5.0_xxx. You can enable "Debug log" and "Ble MQTT messages" and compare time of messages in log and in MiHome. I try to say that ble devices may not send messages if value not changed and you can look out this from MiHome. To check that more quicly you can put your device to water, only contacts of course).

lasthead0 commented 2 years ago

@neo4a this commit should add support for 1.5.1_0032. So you just have to update. I can't guarantee you will not get other bugs, but ble devices should work generally.

neo4a commented 2 years ago

BLE devices are now listed with their properties. Thank you very much.