ollo69 / ha-samsungtv-smart

📺 Home Assistant SamsungTV Smart Component with simplified SmartThings API Support configurable from User Interface.
Apache License 2.0
431 stars 57 forks source link

Device reporting incorrect state (on when off) #141

Closed nashant closed 1 year ago

nashant commented 2 years ago

Describe the bug My TV sometimes reports an incorrect state. I believe this happens when either the tv (in standby) or SmartThings issues an ms.channel.connect event immediately prior to requesting the app list. I discovered this through an automation based on the state of the media_player

Expected behavior media_player reports correct state

Environment details:

Output of HA logs

...
2022-03-10 12:23:28 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': '65419c9c-2662-d8a0-26ca-beac69f65d23', 'state': 'OFFLINE', 'lastUpdatedDate': '2022-03-02T06:44:52.810Z'}
2022-03-10 12:23:43 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': '65419c9c-2662-d8a0-26ca-beac69f65d23', 'state': 'OFFLINE', 'lastUpdatedDate': '2022-03-02T06:44:52.810Z'}
2022-03-10 12:23:58 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': '65419c9c-2662-d8a0-26ca-beac69f65d23', 'state': 'OFFLINE', 'lastUpdatedDate': '2022-03-02T06:44:52.810Z'}
2022-03-10 12:24:13 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': '65419c9c-2662-d8a0-26ca-beac69f65d23', 'state': 'OFFLINE', 'lastUpdatedDate': '2022-03-02T06:44:52.810Z'}
2022-03-10 12:24:13 DEBUG (SamsungRemote) [custom_components.samsungtv_smart.api.samsungws] Thread SamsungRemote started
2022-03-10 12:24:14 DEBUG (SamsungRemote) [custom_components.samsungtv_smart.api.samsungws] {'data': {'clients': [{'attributes': {'name': 'W0hvbWUgQXNzaXN0YW50XSBIb21l', 'token': '11398641'}, 'connectTime': 1646915052398, 'deviceName': 'W0hvbWUgQXNzaXN0YW50XSBIb21l', 'id': 'fcecb736-cc59-4014-8442-7476eea539a', 'isHost': False}], 'id': 'fcecb736-cc59-4014-8442-7476eea539a'}, 'event': 'ms.channel.connect'}
2022-03-10 12:24:14 DEBUG (SamsungRemote) [custom_components.samsungtv_smart.api.samsungws] Message remote: received connect
2022-03-10 12:24:14 DEBUG (SamsungRemote) [custom_components.samsungtv_smart.api.samsungws] Request app list
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Thread SamsungControl started
2022-03-10 12:24:14 DEBUG (SamsungArt) [custom_components.samsungtv_smart.api.samsungws] Thread SamsungArt started
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'data': {'clients': [{'attributes': {'name': 'W0hvbWUgQXNzaXN0YW50XSBIb21l'}, 'connectTime': 1646915053688, 'deviceName': 'W0hvbWUgQXNzaXN0YW50XSBIb21l', 'id': '417ac765-436-40b7-a8f0-959aa2cc2f79', 'isHost': False}], 'id': '417ac765-436-40b7-a8f0-959aa2cc2f79'}, 'event': 'ms.channel.connect'}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Message control: received connect
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: kIciSQlYEM.plex, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: DqEoaplKlw.bbchybrid, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: OEvCiupaFR.ITVHub, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: OCaxbgg9v6.chfourctv, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: MCmYXNxgcu.DisneyPlus, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: org.tizen.primevideo, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: 9Ur5IzDKqV.TizenYouTube, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: EkzyZtmneG.My5, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: VQr0RGkyS9.UKTVPlay, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: p5rhQWxx7m.BTSPORT, AppType: 2
2022-03-10 12:24:14 DEBUG (SamsungArt) [custom_components.samsungtv_smart.api.samsungws] {'data': {'clients': [{'attributes': {'name': 'W0hvbWUgQXNzaXN0YW50XSBIb21l'}, 'connectTime': 1646915053757, 'deviceName': 'W0hvbWUgQXNzaXN0YW50XSBIb21l', 'id': '7c7fda7-fe36-4674-a9dc-6b9511b17334', 'isHost': False}], 'id': '7c7fda7-fe36-4674-a9dc-6b9511b17334'}, 'event': 'ms.channel.connect'}
2022-03-10 12:24:14 DEBUG (SamsungArt) [custom_components.samsungtv_smart.api.samsungws] Message art: received connect
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'kIciSQlYEM.plex', 'result': {'id': 'kIciSQlYEM.plex', 'name': 'Plex', 'running': False, 'version': '5.10.0', 'visible': False}}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'DqEoaplKlw.bbchybrid', 'result': {'id': 'DqEoaplKlw.bbchybrid', 'name': 'BBC iPlayer', 'running': False, 'version': '1.1.40', 'visible': False}}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'OEvCiupaFR.ITVHub', 'result': {'id': 'OEvCiupaFR.ITVHub', 'name': 'ITV Hub', 'running': False, 'version': '21.0.2', 'visible': False}}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'OCaxbgg9v6.chfourctv', 'result': {'id': 'OCaxbgg9v6.chfourctv', 'name': 'All 4', 'running': False, 'version': '8.0.17', 'visible': False}}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'MCmYXNxgcu.DisneyPlus', 'result': {'id': 'MCmYXNxgcu.DisneyPlus', 'name': 'Disney+', 'running': False, 'version': '1.11.0', 'visible': False}}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'error': {'code': 404, 'details': '', 'message': 'Not found error.', 'status': 404}, 'id': 'org.tizen.primevideo'}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': '9Ur5IzDKqV.TizenYouTube', 'result': {'id': '9Ur5IzDKqV.TizenYouTube', 'name': 'YouTube', 'running': False, 'version': '2.1.498', 'visible': False}}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'EkzyZtmneG.My5', 'result': {'id': 'EkzyZtmneG.My5', 'name': 'My5', 'running': False, 'version': '162.81.79', 'visible': False}}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'VQr0RGkyS9.UKTVPlay', 'result': {'id': 'VQr0RGkyS9.UKTVPlay', 'name': 'UKTV Play', 'running': False, 'version': '3.6.1', 'visible': False}}
2022-03-10 12:24:14 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'p5rhQWxx7m.BTSPORT', 'result': {'id': 'p5rhQWxx7m.BTSPORT', 'name': 'BT Sport', 'running': False, 'version': '1.0.3', 'visible': False}}
2022-03-10 12:24:20 DEBUG (SamsungRemote) [custom_components.samsungtv_smart.api.samsungws] Received WS remote ping b'\x00', sending pong
2022-03-10 12:24:20 DEBUG (SamsungArt) [custom_components.samsungtv_smart.api.samsungws] Received WS art ping b'\x00', sending pong
2022-03-10 12:24:20 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Received WS control ping b'\x00', sending pong
2022-03-10 12:24:26 DEBUG (SamsungRemote) [custom_components.samsungtv_smart.api.samsungws] Received WS remote ping b'\x00', sending pong
2022-03-10 12:24:26 DEBUG (SamsungArt) [custom_components.samsungtv_smart.api.samsungws] Received WS art ping b'\x00', sending pong
2022-03-10 12:24:26 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Received WS control ping b'\x00', sending pong
2022-03-10 12:24:28 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': '65419c9c-2662-d8a0-26ca-beac69f65d23', 'state': 'OFFLINE', 'lastUpdatedDate': '2022-03-02T06:44:52.810Z'}
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: kIciSQlYEM.plex, AppType: 2
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: DqEoaplKlw.bbchybrid, AppType: 2
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: OEvCiupaFR.ITVHub, AppType: 2
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: OCaxbgg9v6.chfourctv, AppType: 2
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: MCmYXNxgcu.DisneyPlus, AppType: 2
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: org.tizen.primevideo, AppType: 2
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: 9Ur5IzDKqV.TizenYouTube, AppType: 2
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: EkzyZtmneG.My5, AppType: 2
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: VQr0RGkyS9.UKTVPlay, AppType: 2
2022-03-10 12:24:28 DEBUG (SyncWorker_0) [custom_components.samsungtv_smart.api.samsungws] Get app status: AppID: p5rhQWxx7m.BTSPORT, AppType: 2
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'kIciSQlYEM.plex', 'result': {'id': 'kIciSQlYEM.plex', 'name': 'Plex', 'running': False, 'version': '5.10.0', 'visible': False}}
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'DqEoaplKlw.bbchybrid', 'result': {'id': 'DqEoaplKlw.bbchybrid', 'name': 'BBC iPlayer', 'running': False, 'version': '1.1.40', 'visible': False}}
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'OEvCiupaFR.ITVHub', 'result': {'id': 'OEvCiupaFR.ITVHub', 'name': 'ITV Hub', 'running': False, 'version': '21.0.2', 'visible': False}}
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'OCaxbgg9v6.chfourctv', 'result': {'id': 'OCaxbgg9v6.chfourctv', 'name': 'All 4', 'running': False, 'version': '8.0.17', 'visible': False}}
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'MCmYXNxgcu.DisneyPlus', 'result': {'id': 'MCmYXNxgcu.DisneyPlus', 'name': 'Disney+', 'running': False, 'version': '1.11.0', 'visible': False}}
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'error': {'code': 404, 'details': '', 'message': 'Not found error.', 'status': 404}, 'id': 'org.tizen.primevideo'}
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': '9Ur5IzDKqV.TizenYouTube', 'result': {'id': '9Ur5IzDKqV.TizenYouTube', 'name': 'YouTube', 'running': False, 'version': '2.1.498', 'visible': False}}
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'EkzyZtmneG.My5', 'result': {'id': 'EkzyZtmneG.My5', 'name': 'My5', 'running': False, 'version': '162.81.79', 'visible': False}}
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'VQr0RGkyS9.UKTVPlay', 'result': {'id': 'VQr0RGkyS9.UKTVPlay', 'name': 'UKTV Play', 'running': False, 'version': '3.6.1', 'visible': False}}
2022-03-10 12:24:28 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] {'id': 'p5rhQWxx7m.BTSPORT', 'result': {'id': 'p5rhQWxx7m.BTSPORT', 'name': 'BT Sport', 'running': False, 'version': '1.0.3', 'visible': False}}
2022-03-10 12:24:32 DEBUG (SamsungRemote) [custom_components.samsungtv_smart.api.samsungws] Received WS remote ping b'\x00', sending pong
2022-03-10 12:24:32 DEBUG (SamsungArt) [custom_components.samsungtv_smart.api.samsungws] Received WS art ping b'\x00', sending pong
2022-03-10 12:24:34 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Received WS control ping b'\x00', sending pong
2022-03-10 12:24:38 DEBUG (SamsungRemote) [custom_components.samsungtv_smart.api.samsungws] Received WS remote ping b'\x00', sending pong
2022-03-10 12:24:38 DEBUG (SamsungArt) [custom_components.samsungtv_smart.api.samsungws] Received WS art ping b'\x00', sending pong
2022-03-10 12:24:40 DEBUG (SamsungControl) [custom_components.samsungtv_smart.api.samsungws] Received WS control ping b'\x00', sending pong
2022-03-10 12:24:43 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': '65419c9c-2662-d8a0-26ca-beac69f65d23', 'state': 'OFFLINE', 'lastUpdatedDate': '2022-03-02T06:44:52.810Z'}
...
ollo69 commented 2 years ago

Please attach diagnostic file

nashant commented 2 years ago
{
  "home_assistant": {
    "installation_type": "Unknown",
    "version": "2022.3.1",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.9.5",
    "docker": false,
    "arch": "x86_64",
    "timezone": "Europe/London",
    "os_name": "Linux",
    "os_version": "5.11.0-49-generic",
    "run_as_root": false
  },
  "custom_components": {
    "frigate": {
      "version": "2.2.2",
      "requirements": []
    },
    "midea_ac": {
      "version": "0.2.2",
      "requirements": [
        "msmart==0.2.2",
        "pycryptodome",
        "pycryptodomex",
        "click"
      ]
    },
    "hpprinter": {
      "version": "1.0.6",
      "requirements": [
        "xmltodict==0.12.0"
      ]
    },
    "hacs": {
      "version": "1.23.0",
      "requirements": [
        "aiogithubapi>=21.11.0"
      ]
    },
    "watchman": {
      "version": "0.5.0",
      "requirements": [
        "prettytable==3.0.0"
      ]
    },
    "pyscript": {
      "version": "1.3.3",
      "requirements": [
        "croniter==1.3.4",
        "watchdog==2.1.6"
      ]
    },
    "scheduler": {
      "version": "v0.0.0",
      "requirements": []
    },
    "ambient_lighting": {
      "version": "1.0.0",
      "requirements": []
    },
    "london_tfl": {
      "version": "0.1.4",
      "requirements": []
    },
    "dwains_dashboard": {
      "version": "2.0.7",
      "requirements": []
    },
    "eventsensor": {
      "version": "3.0.0",
      "requirements": []
    },
    "samsungtv_smart": {
      "version": "0.5.0",
      "requirements": [
        "websocket-client>=0.58.0",
        "wakeonlan>=2.0.0",
        "aiofiles>=0.6.0"
      ]
    },
    "tapo_control": {
      "version": "3.4.1",
      "requirements": [
        "pytapo==1.2.1",
        "onvif-zeep-async==1.2.0"
      ]
    },
    "var": {
      "version": "0.12.3",
      "requirements": []
    },
    "nest_protect": {
      "version": "0.3.0",
      "requirements": []
    },
    "ui_lovelace_minimalist": {
      "version": "v0.0.6-hotfix2",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "samsungtv_smart",
    "name": "SamsungTV Smart",
    "documentation": "https://github.com/ollo69/ha-samsungtv-smart",
    "issue_tracker": "https://github.com/ollo69/ha-samsungtv-smart/issues",
    "requirements": [
      "websocket-client>=0.58.0",
      "wakeonlan>=2.0.0",
      "aiofiles>=0.6.0"
    ],
    "dependencies": [],
    "codeowners": [
      "@jaruba",
      "@ollo69",
      "@screwdgeh"
    ],
    "config_flow": true,
    "version": "0.5.0",
    "is_built_in": false
  },
  "data": {
    "entry": {
      "entry_id": "2c391707d46361699ae7a89ab4bd526e",
      "version": 1,
      "domain": "samsungtv_smart",
      "title": "Lounge TV (SmartThings)",
      "data": {
        "host": "172.16.0.30",
        "name": "Lounge TV",
        "port": 8002,
        "ws_name": "Home",
        "mac": "**REDACTED**",
        "id": "0da3a196-7be5-4730-ae7d-77bbf5f7d3bf",
        "device_name": "[TV] Lounge TV",
        "device_model": "QE65Q95TATXXU",
        "device_os": "Tizen",
        "api_key": "**REDACTED**",
        "device_id": "65419c9c-2662-d8a0-26ca-beac69f65d23",
        "token": "**REDACTED**"
      },
      "options": {
        "use_st_status_info": true,
        "use_st_channel_info": true,
        "show_channel_number": true,
        "power_on_method": 2,
        "logo_option": 2,
        "app_load_method": 1,
        "dump_apps": false,
        "app_launch_method": 1,
        "wol_repeat": 1,
        "power_on_delay": 30,
        "ping_port": 0,
        "use_mute_check": true
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "0da3a196-7be5-4730-ae7d-77bbf5f7d3bf",
      "disabled_by": null
    },
    "device": {
      "name": "Lounge TV",
      "name_by_user": null,
      "model": "QE65Q95TATXXU ([TV] Lounge TV)",
      "manufacturer": "Samsung Electronics",
      "sw_version": "Tizen",
      "disabled": false,
      "disabled_by": null,
      "entities": {
        "media_player.lounge_tv": {
          "name": null,
          "original_name": "Lounge TV",
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "tv",
          "icon": null,
          "original_icon": "mdi:television",
          "unit_of_measurement": null,
          "state": {
            "state": "on",
            "attributes": {
              "source_list": [
                "TV",
                "Denon",
                "PS5",
                "Plex",
                "iPlayer",
                "ITV Player",
                "All4",
                "Disney Plus",
                "Prime Video",
                "YouTube",
                "My5",
                "UKTV Play",
                "BT Sport"
              ],
              "volume_level": 0.0,
              "is_volume_muted": false,
              "media_content_type": "video",
              "app_id": "TV/HDMI",
              "source": "TV/HDMI",
              "ip_address": "172.16.0.30",
              "device_class": "tv",
              "icon": "mdi:television",
              "friendly_name": "Lounge TV",
              "supported_features": 90045
            },
            "last_changed": "2022-03-12T06:39:55.012484+00:00",
            "last_updated": "2022-03-12T06:39:55.012484+00:00"
          }
        }
      }
    }
  }
}
ollo69 commented 2 years ago

Can you try to set the advanced option TCP port used to check power status from 0 to 9197 and check if fix this issue?

nashant commented 2 years ago

Done, will report back

ollo69 commented 2 years ago

Any news here?

nashant commented 2 years ago

Bingo! That did the trick, thanks

nashant commented 2 years ago

Not bingo. Turns out it's not fixed

nashant commented 2 years ago

Is there any reason it doesn't just use a standard ICMP ping rather than trying to connect on a TCP port? I've nmap scanned it while on and the following are open: 7678/tcp open unknown 8001/tcp open vcom-tunnel 8002/tcp open teradataordbms 8080/tcp open http-proxy 8187/tcp open unknown 9119/tcp open mxit 9197/tcp open unknown 12345/tcp open netbus 15500/tcp open unknown 26101/tcp open unknown 37671/tcp open unknown 42939/tcp open unknown 43799/tcp open unknown 50125/tcp open unknown 59231/tcp open unknown

I'm going to leave connection attempts running overnight to all of them and see what happens

nashant commented 2 years ago

Solved my problem with this:

- name: Lounge TV Power State
  platform: command_line
  device_class: power
  command: "( nc -z -w 2 172.16.0.30 9197 && echo 'open' ) || echo 'closed'"
  scan_interval: 3
  payload_on: open
  payload_off: closed
nashant commented 2 years ago

Not solved! Literally every port opens :(

ollo69 commented 2 years ago

Having several TCP port open for communication is normal. I don't see any issue. Unfortunately some Samsung TV activate communication during activities as software upgrade checks or channels search, so integration detect it as on. A work around should use a power consumption sensor, create a binary sensor based on real power usage and associate it to integartion in advanced integration option. If power usage is under a specific limit, means that TV screen is off and so can be considered as off,

nashant commented 2 years ago

Is it not possible through SmartThings? The Samsung app always reports the correct power state. It would be really useful if there were at least a single port that only opened when the TV is actually on

ollo69 commented 2 years ago

Smartthings power info is not reliable at all. I just have 1 TV, and in my case power state is always reported correctly. It would be good have information about a port to use to monitor for power status, but I don't have any information on this.

nashant commented 2 years ago

So the ports that absolutely seem to open every time the TV gets chatty are: 7678/tcp open unknown 8001/tcp open vcom-tunnel 8002/tcp open teradataordbms 8080/tcp open http-proxy 8187/tcp open unknown 9119/tcp open mxit 9197/tcp open unknown 12345/tcp open netbus 15500/tcp open unknown

There's one I haven't tested and that's 26101. That's the only one that doesn't seem ephemeral. I'll test that and report back

nashant commented 2 years ago

26101 opens too. But I had nmap running for the last 7 hours and the first time it opened ports was 1 hour ago. How are you monitoring for the ports? Can you point me to the code?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.