Open marian-t-web-de opened 6 months ago
As futher developpment I propose to provide an additional StatePoint, which is from adapter to be set (to true) after the adapter instance is connected to the TV - just when the log entry "Successfully connected to your Samsung ** TV " will be send. In this way inside iobroker could be recognizable, if the connection is established. If not and TV is per ping connected, the adapter can (automatically/per script) per restart be connected to TV once more. Further could be an StatePoint "reconnect" to be provided to do it.
Describe the bug
The samsung-community adapter is running, TV is off. After switching TV on, the adapter is still disconnected, using of commands/changung SP's state results for the first in no any action. After some commands the adapter trays to connect and fails, by second try is usually succesfull (see iob log below)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots & Logfiles
TV ist turned on 19:00, first command (KEY_SLEEP) 22:36, adapter up to this time not connected:
2024-02-28 22:36:00.492 - [32minfo[39m: javascript.0 (5101) script.js.common.TV_control_JS: Step=0 Set state samsung-community.0.command val KEY_SLEEP and wait 200ms 2024-02-28 22:36:00.692 - [32minfo[39m: javascript.0 (5101) script.js.common.TV_control_JS: Step=1 Set state samsung-community.0.command val KEY_DOWN and wait 200ms 2024-02-28 22:36:00.750 - [31merror[39m: samsung-community.0 (2155) uncaught exception: Connection not yet ready 2024-02-28 22:36:00.760 - [31merror[39m: samsung-community.0 (2155) Error: Connection not yet ready at SamsungTv._assertConnected (/opt/iobroker/node_modules/iobroker.samsung-community/lib/H-and-J-Series-lib/SamsungTv.js:117:13) at SamsungTv.sendKey (/opt/iobroker/node_modules/iobroker.samsung-community/lib/H-and-J-Series-lib/SamsungTv.js:93:10) at Object.send (/opt/iobroker/node_modules/iobroker.samsung-community/main.js:323:87) at send (/opt/iobroker/node_modules/iobroker.samsung-community/main.js:184:12) at Object.stateChange (/opt/iobroker/node_modules/iobroker.samsung-community/main.js:138:21) at Immediate.<anonymous> (/opt/iobroker/node_modules/@iobroker/js-controller-adapter/build/lib/adapter/adapter.js:8502:62) at process.processImmediate (node:internal/timers:476:21) 2024-02-28 22:36:00.761 - [31merror[39m: samsung-community.0 (2155) Connection not yet ready 2024-02-28 22:36:00.769 - [32minfo[39m: samsung-community.0 (2155) terminating 2024-02-28 22:36:00.770 - [33mwarn[39m: samsung-community.0 (2155) Terminated (UNCAUGHT_EXCEPTION): Without reason 2024-02-28 22:36:00.893 - [32minfo[39m: javascript.0 (5101) script.js.common.TV_control_JS: Step=2 Set state samsung-community.0.command val KEY_ENTER and wait 0ms 2024-02-28 22:36:01.274 - [32minfo[39m: samsung-community.0 (2155) terminating 2024-02-28 22:36:01.519 - [31merror[39m: host.iobroker Caught by controller[0]: Connection is established but not yet ready 2024-02-28 22:36:01.520 - [31merror[39m: host.iobroker instance system.adapter.samsung-community.0 terminated with code 6 (UNCAUGHT_EXCEPTION) 2024-02-28 22:36:01.520 - [32minfo[39m: host.iobroker Restart adapter system.adapter.samsung-community.0 because enabled 2024-02-28 22:36:01.579 - [32minfo[39m: javascript.0 (5101) script.js.common.TV_control_JS: checkTVstate, TV/ping: on/true 2024-02-28 22:36:31.543 - [32minfo[39m: host.iobroker instance system.adapter.samsung-community.0 started with pid 31565 2024-02-28 22:36:34.536 - [32minfo[39m: samsung-community.0 (31565) starting. Version 0.5.0 (non-npm: iobroker-community-adapters/ioBroker.samsung-community#f979771177c9aef7da7d0689d40d92d05d35d291) in /opt/iobroker/node_modules/iobroker.samsung-community, node: v18.19.0, js-controller: 5.0.16 2024-02-28 22:36:34.583 - [32minfo[39m: javascript.0 (5101) script.js.common.TV_control_JS: checkTVstate, TV: on (unchanged) 2024-02-28 22:36:34.646 - [32minfo[39m: samsung-community.0 (31565) Connection to TV initialised 2024-02-28 22:37:01.471 - [32minfo[39m: samsung-community.0 (31565) Successfully connected to your Samsung HJ TV 2024-02-28 22:37:01.597 - [32minfo[39m: javascript.0 (5101) script.js.common.TV_control_JS: checkTVstate, TV: on (unchanged)
Versions:
TV is SAMSUNG UE55JS8590TXZG modell 2015 (Tizen) Adapter samsung-community version: 0.5.0
Plattform: docker (official image - v9.0.1) (on second iob installation on RPi3 without docker the same issue) Betriebssystem: linux Architektur: arm CPUs: 4 Geschwindigkeit: 1800 MHz Modell: ARMv7 Processor rev 3 (v7l) RAM: 3.7 GB System-Betriebszeit: 48 T. 16:39:56 Node.js: v18.19.0 time: 1709193161649 timeOffset: -60 NPM: 10.2.3 Adapter-Anzahl: 534 Datenträgergröße: 27.9 GB Freier Festplattenspeicher: 8.4 GB Aktive Instanzen: 24 Pfad: /opt/iobroker/ Betriebszeit: 6 T. 15:09:40 aktiv:
Additional context
Add any other context about the problem here. Moreover the states of Power.checkOnOff and Power.off show different states of TV. TV is Off, checkOn pressed, checkOnOff is off (correct) off is false (not correct):