holomekc / ioBroker.bshb

This adapter allows communication to Bosch Smart Home Controller
MIT License
20 stars 7 forks source link

No Connection after System reboot #31

Closed Scotty-89 closed 3 years ago

Scotty-89 commented 3 years ago

Hello,

thx for the well working adapter but i still found one point ma you can still improve ;)

if i reboot my system the Adapter shows all green / true for -> system.adapter.bshb.0.connected and -> system.adapter.bshb.0.alive

but if the system reboot contains also an reboot of the Bosch Bridge than nothing i working. i need to restart the Adapter again than all is working fine.

maybe its possible to add and functions which is checking of the Connection to the bridge etc ? like other Adapter also have (eg. vaillant.0.info.connection)

holomekc commented 3 years ago

Hi. Thx for the feedback. I theory this feature should be implemented already. I will take a look why it is not working. I tried to simulating it by cutting power and then reconnecting the controller. The controller needs a long time to boot up again. I thought I also added a message telling that controller is offline.

Nevertheless, I will take a look. Thx again!

Br, Christopher

Scotty-89 commented 3 years ago

Hello,

something new on this point ?

holomekc commented 3 years ago

Hi. I had no time yet. This weekend I will take a look.

holomekc commented 3 years ago

Hi. Ok I did a retest I still cannot see an issue. Here the "shortened" logs with explanation:

Bosch SmartHome Controller (BSHC) still online:

2020-11-20 23:44:19.267 - silly: bshb.0 (29903)
2020-11-20 23:44:19.268 - silly: bshb.0 (29903) response information:
2020-11-20 23:44:19.268 - silly: bshb.0 (29903) status: - [200]
2020-11-20 23:44:19.268 - silly: bshb.0 (29903) headers: - [{"content-type":"application/json;charset=utf-8","x-mbs-platform-state":"100","cache-control":"no-cache, no-store, must-revalidate, max-age=0, no-cache, no-store, must-revalidate","date":"Fri, 20 Nov 2020 22:44:19 GMT","pragma":"no-cache","connection":"close"}]
2020-11-20 23:44:19.290 - silly: bshb.0 (29903) content: - ["{\"result\":[],\"jsonrpc\":\"2.0\"}\n"]
2020-11-20 23:44:19.291 - silly: bshb.0 (29903)
2020-11-20 23:44:19.295 - silly: bshb.0 (29903)
2020-11-20 23:44:19.296 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:44:19.296 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:44:19.297 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:44:19.297 - silly: bshb.0 (29903)

BSHC power shut down. Adapter begins reconnection mechanism. It does that in 10s interval + time which is needed for connection attempts:

2020-11-20 23:44:50.334 - debug: bshb.0 (29903) error during call to BSHC: - ["timeout during call to BSHC"]
2020-11-20 23:44:50.336 - warn: bshb.0 (29903) Something went wrong during long polling. Try again later.
2020-11-20 23:45:00.338 - silly: bshb.0 (29903)
2020-11-20 23:45:00.338 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:45:00.339 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:45:00.339 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:45:00.340 - silly: bshb.0 (29903)
2020-11-20 23:45:19.271 - debug: bshb.0 (29903) error during call to BSHC: - [{"errno":"EHOSTUNREACH","code":"EHOSTUNREACH","syscall":"connect","address":"192.168.178.46","port":8444}]
2020-11-20 23:45:19.272 - warn: bshb.0 (29903) Something went wrong during long polling. Try again later.
2020-11-20 23:45:29.274 - silly: bshb.0 (29903)
2020-11-20 23:45:29.274 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:45:29.275 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:45:29.275 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:45:29.275 - silly: bshb.0 (29903)
2020-11-20 23:45:32.390 - debug: bshb.0 (29903) error during call to BSHC: - [{"errno":"EHOSTUNREACH","code":"EHOSTUNREACH","syscall":"connect","address":"192.168.178.46","port":8444}]
2020-11-20 23:45:32.391 - warn: bshb.0 (29903) Something went wrong during long polling. Try again later.
2020-11-20 23:45:42.392 - silly: bshb.0 (29903)
2020-11-20 23:45:42.392 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:45:42.393 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:45:42.393 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:45:42.393 - silly: bshb.0 (29903)
2020-11-20 23:45:45.520 - debug: bshb.0 (29903) error during call to BSHC: - [{"errno":"EHOSTUNREACH","code":"EHOSTUNREACH","syscall":"connect","address":"192.168.178.46","port":8444}]
2020-11-20 23:45:45.521 - warn: bshb.0 (29903) Something went wrong during long polling. Try again later.
2020-11-20 23:45:55.522 - silly: bshb.0 (29903)
2020-11-20 23:45:55.522 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:45:55.523 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:45:55.523 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:45:55.523 - silly: bshb.0 (29903)
2020-11-20 23:45:58.463 - debug: bshb.0 (29903) error during call to BSHC: - [{"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"192.168.178.46","port":8444}]
2020-11-20 23:45:58.463 - warn: bshb.0 (29903) Something went wrong during long polling. Try again later.
2020-11-20 23:46:08.465 - silly: bshb.0 (29903)

After a very long time BSHC allows connections again. Although it does no recognize the adapter yet. Not sure why this happens. But I use this information to show a message indicating that BSHC is starting. See below. This is still in 10s interval:

2020-11-20 23:47:58.583 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:47:58.583 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:47:58.584 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:47:58.584 - silly: bshb.0 (29903)
2020-11-20 23:48:04.207 - silly: bshb.0 (29903)
2020-11-20 23:48:04.208 - silly: bshb.0 (29903) response information:
2020-11-20 23:48:04.208 - silly: bshb.0 (29903) status: - [503]
2020-11-20 23:48:04.208 - silly: bshb.0 (29903) headers: - [{"x-mbs-platform-state":"0","date":"Fri, 20 Nov 2020 22:48:04 GMT","content-length":"0","connection":"close"}]
2020-11-20 23:48:04.209 - silly: bshb.0 (29903) content: - [null]
2020-11-20 23:48:04.210 - silly: bshb.0 (29903)
2020-11-20 23:48:04.210 - warn: bshb.0 (29903) BSHC is starting. Try to reconnect asap. HTTP=503, data=undefined
2020-11-20 23:48:14.212 - silly: bshb.0 (29903)
2020-11-20 23:48:14.213 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:48:14.213 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:48:14.214 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:48:14.214 - silly: bshb.0 (29903)
2020-11-20 23:48:14.458 - silly: bshb.0 (29903)
2020-11-20 23:48:14.459 - silly: bshb.0 (29903) response information:
2020-11-20 23:48:14.459 - silly: bshb.0 (29903) status: - [503]
2020-11-20 23:48:14.460 - silly: bshb.0 (29903) headers: - [{"x-mbs-platform-state":"0","date":"Fri, 20 Nov 2020 22:48:14 GMT","content-length":"0","connection":"close"}]
2020-11-20 23:48:14.460 - silly: bshb.0 (29903) content: - [null]
2020-11-20 23:48:14.461 - silly: bshb.0 (29903)
2020-11-20 23:48:14.461 - warn: bshb.0 (29903) BSHC is starting. Try to reconnect asap. HTTP=503, data=undefined
2020-11-20 23:48:24.461 - silly: bshb.0 (29903)
2020-11-20 23:48:24.462 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:48:24.462 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:48:24.462 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:48:24.463 - silly: bshb.0 (29903)
2020-11-20 23:48:24.686 - silly: bshb.0 (29903)
2020-11-20 23:48:24.686 - silly: bshb.0 (29903) response information:
2020-11-20 23:48:24.686 - silly: bshb.0 (29903) status: - [503]
2020-11-20 23:48:24.687 - silly: bshb.0 (29903) headers: - [{"x-mbs-platform-state":"0","date":"Fri, 20 Nov 2020 22:48:24 GMT","content-length":"0","connection":"close"}]
2020-11-20 23:48:24.687 - silly: bshb.0 (29903) content: - [null]
2020-11-20 23:48:24.688 - silly: bshb.0 (29903)
2020-11-20 23:48:24.688 - warn: bshb.0 (29903) BSHC is starting. Try to reconnect asap. HTTP=503, data=undefined
2020-11-20 23:48:34.689 - silly: bshb.0 (29903)
2020-11-20 23:48:34.689 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:48:34.689 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:48:34.690 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:48:34.690 - silly: bshb.0 (29903)
2020-11-20 23:48:34.946 - silly: bshb.0 (29903)
2020-11-20 23:48:34.947 - silly: bshb.0 (29903) response information:
2020-11-20 23:48:34.947 - silly: bshb.0 (29903) status: - [503]
2020-11-20 23:48:34.947 - silly: bshb.0 (29903) headers: - [{"x-mbs-platform-state":"0","date":"Fri, 20 Nov 2020 22:48:34 GMT","content-length":"0","connection":"close"}]
2020-11-20 23:48:34.948 - silly: bshb.0 (29903) content: - [null]
2020-11-20 23:48:34.948 - silly: bshb.0 (29903)
2020-11-20 23:48:34.948 - warn: bshb.0 (29903) BSHC is starting. Try to reconnect asap. HTTP=503, data=undefined
2020-11-20 23:48:44.950 - silly: bshb.0 (29903)
2020-11-20 23:48:44.951 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:48:44.951 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:48:44.951 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:48:44.952 - silly: bshb.0 (29903)
2020-11-20 23:48:45.277 - silly: bshb.0 (29903)
2020-11-20 23:48:45.277 - silly: bshb.0 (29903) response information:
2020-11-20 23:48:45.278 - silly: bshb.0 (29903) status: - [503]
2020-11-20 23:48:45.278 - silly: bshb.0 (29903) headers: - [{"x-mbs-platform-state":"0","date":"Fri, 20 Nov 2020 22:48:45 GMT","content-length":"0","connection":"close"}]
2020-11-20 23:48:45.279 - silly: bshb.0 (29903) content: - [null]
2020-11-20 23:48:45.279 - silly: bshb.0 (29903)
2020-11-20 23:48:45.279 - warn: bshb.0 (29903) BSHC is starting. Try to reconnect asap. HTTP=503, data=undefined
2020-11-20 23:48:55.281 - silly: bshb.0 (29903)
2020-11-20 23:48:55.281 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:48:55.282 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:48:55.282 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:48:55.283 - silly: bshb.0 (29903)
2020-11-20 23:48:55.615 - silly: bshb.0 (29903)

One more time the same message and then it is reconnected:

2020-11-20 23:50:47.673 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:50:47.673 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:50:47.673 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:50:47.674 - silly: bshb.0 (29903)
2020-11-20 23:50:47.770 - silly: bshb.0 (29903)
2020-11-20 23:50:47.770 - silly: bshb.0 (29903) response information:
2020-11-20 23:50:47.770 - silly: bshb.0 (29903) status: - [503]
2020-11-20 23:50:47.771 - silly: bshb.0 (29903) headers: - [{"x-mbs-platform-state":"35","date":"Fri, 20 Nov 2020 22:50:47 GMT","content-length":"0","connection":"close"}]
2020-11-20 23:50:47.771 - silly: bshb.0 (29903) content: - [null]
2020-11-20 23:50:47.771 - silly: bshb.0 (29903)
2020-11-20 23:50:47.772 - warn: bshb.0 (29903) BSHC is starting. Try to reconnect asap. HTTP=503, data=undefined
2020-11-20 23:50:57.773 - silly: bshb.0 (29903)
2020-11-20 23:50:57.774 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:50:57.774 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:50:57.774 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:50:57.774 - silly: bshb.0 (29903)
2020-11-20 23:50:57.850 - silly: bshb.0 (29903)
2020-11-20 23:50:57.851 - silly: bshb.0 (29903) response information:
2020-11-20 23:50:57.851 - silly: bshb.0 (29903) status: - [503]
2020-11-20 23:50:57.851 - silly: bshb.0 (29903) headers: - [{"x-mbs-platform-state":"40","date":"Fri, 20 Nov 2020 22:50:57 GMT","content-length":"0","connection":"close"}]
2020-11-20 23:50:57.852 - silly: bshb.0 (29903) content: - [null]
2020-11-20 23:50:57.852 - silly: bshb.0 (29903)
2020-11-20 23:50:57.852 - warn: bshb.0 (29903) BSHC is starting. Try to reconnect asap. HTTP=503, data=undefined
2020-11-20 23:51:07.854 - silly: bshb.0 (29903)
2020-11-20 23:51:07.855 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:51:07.855 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:51:07.855 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]
2020-11-20 23:51:07.855 - silly: bshb.0 (29903)
2020-11-20 23:51:08.518 - silly: bshb.0 (29903)
2020-11-20 23:51:08.519 - silly: bshb.0 (29903) response information:
2020-11-20 23:51:08.520 - silly: bshb.0 (29903) status: - [200]
2020-11-20 23:51:08.520 - silly: bshb.0 (29903) headers: - [{"content-type":"application/json;charset=utf-8","x-mbs-platform-state":"100","cache-control":"no-cache, no-store, must-revalidate, max-age=0, no-cache, no-store, must-revalidate","date":"Fri, 20 Nov 2020 22:51:08 GMT","pragma":"no-cache","connection":"close"}]
2020-11-20 23:51:08.540 - silly: bshb.0 (29903) content: - ["{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32001,\"message\":\"No subscription with id: ee04bd7b3-16\"}}\n"]
2020-11-20 23:51:08.540 - silly: bshb.0 (29903)
2020-11-20 23:51:08.541 - warn: bshb.0 (29903) Something went wrong during long polling. Try to reconnect.
2020-11-20 23:51:08.541 - info: bshb.0 (29903) Listen to changes
2020-11-20 23:51:13.542 - silly: bshb.0 (29903)
2020-11-20 23:51:13.543 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:51:13.543 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":69}]
2020-11-20 23:51:13.543 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/unsubscribe\",\"params\":[\"ee04bd7b3-16\"]}"]
2020-11-20 23:51:13.544 - silly: bshb.0 (29903)
2020-11-20 23:51:13.548 - silly: bshb.0 (29903)
2020-11-20 23:51:13.548 - silly: bshb.0 (29903) call:
POST | 192.168.178.46:8444/remote/json-rpc
2020-11-20 23:51:13.548 - silly: bshb.0 (29903) headers:
- [{"Content-Type":"application/json","Accept":"application/json","Content-Length":81}]
2020-11-20 23:51:13.548 - silly: bshb.0 (29903) body:
- ["{\"jsonrpc\":\"2.0\",\"method\":\"RE/subscribe\",\"params\":[\"com/bosch/sh/remote/*\",null]}"]
2020-11-20 23:51:13.549 - silly: bshb.0 (29903)
2020-11-20 23:51:13.762 - silly: bshb.0 (29903)
2020-11-20 23:51:13.762 - silly: bshb.0 (29903) response information:
2020-11-20 23:51:13.763 - silly: bshb.0 (29903) status: - [200]
2020-11-20 23:51:13.763 - silly: bshb.0 (29903) headers: - [{"content-type":"application/json;charset=utf-8","x-mbs-platform-state":"100","cache-control":"no-cache, no-store, must-revalidate, max-age=0, no-cache, no-store, must-revalidate","date":"Fri, 20 Nov 2020 22:51:13 GMT","pragma":"no-cache","connection":"close"}]
2020-11-20 23:51:13.810 - silly: bshb.0 (29903) content: - ["{\"result\":null,\"jsonrpc\":\"2.0\"}\n"]

When you check the times... 2020-11-20 23:44:50.336 2020-11-20 23:51:08.520 ... then you can see that it took 7min for BSHC to reboot completely, so that the adapter is able to reconnect.

I know that the error messages are more generic. Especially for the first part when the connection to BSHC cannot be established at all.

Regarding the connected state. I can take a look if I can adjust it so that the adapter shows that it is disconnected.

What you can see as well is: 2020-11-20 23:51:08.541 - warn: bshb.0 (29903) Something went wrong during long polling. Try to reconnect.

In the request to BSHC we send a time we want to stay connected:

["{\"jsonrpc\":\"2.0\",\"method\":\"RE/longPoll\",\"params\":[\"ee04bd7b3-16\",30]}"]

The adapter picks 30s. For this time the connection stays open and we can get "push" messages without asking for it all the time. This is quite efficient. But! When I implemented it I noticed that the adapter did not receive updates when the controller reboots. On a closer look I noticed that the http library does not realize that the connection is broken. This is why I added a timeout to the requests as well, because for some reason the default setting of the http library is infinite. The timeout is 30s + 1s. It looks like that 1s is not enough sometimes and the controller did not close the connection on its side. So then the timeout mechanism of the adapter kills the connection and reconnects directly.

So this should not hurt. I am not sure if I can find a better solution but maybe I can change it to 30s + 2s. I do not want to pick a longer time otherwise the adapter thinks it is connected although it is not. The worst case szenario is: Adapter connects successfully. 1s later the controller reboots. Now the adapter thinks for 30s that it is still connected (You can see that in the logs as well btw.) I decided that this is fine because the controller take much more time to reboot anyway.

I also could have reduced the 30s to a lower value but I think this is not efficient. This will create much more reconnections and I think this is not worth it. The purpose of LongPolling is to keep the connection open as long as possible.

It is hard to test as well. I tried simulating disconnects by unplug the ethernet connection cable but for some reason this is noticed by the http library I use. So I need to wait the 7 min all the time to test it.

I hope this was understandable and explains how the adapter works. This is a lot of text. uff...

Br, Christopher

holomekc commented 3 years ago

Added connection indiation, increase timeout to 2 and improve logging for longpolling in https://github.com/holomekc/ioBroker.bshb/pull/32

Scotty-89 commented 3 years ago

Hey,

thx for your time and analyse ! today i had the issue again ;( my iOBroker and the Bosch hub was interrupted by power off for a short time. after reboot of the ioBroker it was not possible to get any change state like Shutters etc until i restart the adapter again after the reboot.

Scotty-89 commented 3 years ago

thx for updating the apdater, i will try this an see whats happen ;)

holomekc commented 3 years ago

Ah ok you mean both ioBroker and Controller reboots. Sorry I did not get that. This is actually possible that this does not work. Give me some time. I will check again.

holomekc commented 3 years ago

Ok I pushed changes again: https://github.com/holomekc/ioBroker.bshb/commit/a7d002c3700189b7695e8b00937acd0fae701b60 I did this on the same version and retagged the commit.

Just reinstall to try again. It was a bit more complicated than I thought due to my lib I wrote and which is used by the adapter. I did not want to change the behavior of the lib because this could affect other projects.

It will look like this (from bottom to top):

bshb.0  2020-11-21 19:14:50.875 info    (21604) Detecting devices finished
bshb.0  2020-11-21 19:14:49.890 info    (21604) Detecting scenarios finished
bshb.0  2020-11-21 19:14:49.867 info    (21604) Detecting messages finished
bshb.0  2020-11-21 19:14:49.807 info    (21604) Listen to changes
bshb.0  2020-11-21 19:14:49.806 info    (21604) Detecting open doors/windows finished
bshb.0  2020-11-21 19:14:49.482 info    (21604) Start detecting open doors/windows...
bshb.0  2020-11-21 19:14:49.482 info    (21604) Start detecting devices...
bshb.0  2020-11-21 19:14:49.481 info    (21604) Start detecting messages...
bshb.0  2020-11-21 19:14:49.481 info    (21604) Start detecting scenarios...
bshb.0  2020-11-21 19:14:49.479 info    (21604) Client with identifier: ioBroker.bshb_77c55b3a-518a-4bfe-a4c9-861835c5fe0a already paired. Using existing certificate
bshb.0  2020-11-21 19:14:48.899 info    (21604) Check if client with identifier: ioBroker.bshb_77c55b3a-518a-4bfe-a4c9-861835c5fe0a is already paired.
bshb.0  2020-11-21 19:14:38.898 warn    (21604) Could not pair client. Did you press the paring button on Bosch Smart Home Controller? Error details: undefined
bshb.0  2020-11-21 19:14:35.893 info    (21604) Start pairing. Activate pairing on Bosch Smart Home Controller by pressing button until flashing.
bshb.0  2020-11-21 19:14:35.893 info    (21604) Client with identifier: ioBroker.bshb_77c55b3a-518a-4bfe-a4c9-861835c5fe0a was not paired yet.
bshb.0  2020-11-21 19:14:33.301 info    (21604) Check if client with identifier: ioBroker.bshb_77c55b3a-518a-4bfe-a4c9-861835c5fe0a is already paired.
bshb.0  2020-11-21 19:14:23.299 warn    (21604) Could not pair client. Did you press the paring button on Bosch Smart Home Controller? Error details: undefined
bshb.0  2020-11-21 19:14:20.294 info    (21604) Start pairing. Activate pairing on Bosch Smart Home Controller by pressing button until flashing.
bshb.0  2020-11-21 19:14:20.293 info    (21604) Client with identifier: ioBroker.bshb_77c55b3a-518a-4bfe-a4c9-861835c5fe0a was not paired yet.
bshb.0  2020-11-21 19:14:17.701 info    (21604) Check if client with identifier: ioBroker.bshb_77c55b3a-518a-4bfe-a4c9-861835c5fe0a is already paired.

The adapter cannot know if you are already paired or not but for every connection attempt it will first check if you are paired and if you are it is fine or it will fail and repeat.

Scotty-89 commented 3 years ago

Hey,

i will try it out and give you some feedback ;)

thx for the support !

Scotty-89 commented 3 years ago

Hey,

seems to work now ,) thx