ollo69 / ha-samsungtv-smart

đź“ş Home Assistant SamsungTV Smart Component with simplified SmartThings API Support configurable from User Interface.
Apache License 2.0
433 stars 58 forks source link

2022 Frame TV art mode not supported #212

Closed Fulladorn closed 1 year ago

Fulladorn commented 1 year ago

Describe the bug When adding the TV with the optional SmartThings token (also tried w/o), the power button in HA will only cycle between on(regularly on, can see TV etc.) and off(art mode). I'm unable to completely power down the TV.

I've tried both the advanced settings for the Frame TV, but it does not change behavior at all.

Calling SamsungTV Smart: set_art_mode does nothing.

Expected behavior The Frame TV should be able to media_player.turn_off (completely powered off, display is off), SamsungTV Smart: set_art_mode (set TV to art mode) and media_player.turn_on.

Environment details:

Additional context I tried both w/ and w/o the SmartThings token. The TV is added, but it will only cycle between on and art mode. It will not power off.

webjib commented 1 year ago

Same TV, same issue for me. Unable to turn off the TV.

danielducu commented 1 year ago

I've investigated this for quite some time now ... it seams that the SmartThings rest api no longer supports the newer models of Samsung TV's. This integration works for other devices and older TV's but not the newer. The api somehow updates but with a delay of sometimes even a month. I've given up on this...

ollo69 commented 1 year ago

set_art_mode is not based on SmartThings but on WebSocket communication. Unfortunaty I don't have a new model and is not in plan to buy a new one, so I'm not able to do any tests. A programmer with a new TV could do this, I don't know if someone in this thread.

Jds5nz commented 1 year ago

I have a 2022 Frame TV and had issues with service samsungtv_smart.set_art_mode not working as I expected as well. I am still new to the guts of Home Assistant, however I created a button card, with entity as the media_player.[mytv] Tap action: Toggle And using that, seems to go to Art Mode.

peter-dorn commented 1 year ago

I have the 2022 Frame TV. I just switched from the original samsung tizen integration to this one. With the original the TV just turned off, but now I can only toggle between on and art mode. Is there anything I can do to help to fix this issue?

webjib commented 1 year ago

I can confirm that the default Samsung intégration can switch off my The Frame 2022.

edit: I’ve checked integration source code, and for The Frame, the turn_off function is sending this command: SendRemoteKey.hold("KEY_POWER", 3)

Could it be possible to have this behavior as well?

ollo69 commented 1 year ago

I can confirm that the default Samsung intégration can switch off my The Frame 2022.

edit: I’ve checked integration source code, and for The Frame, the turn_off function is sending this command: SendRemoteKey.hold("KEY_POWER", 3)

Could it be possible to have this behavior as well?

As you already checked, the native integration does nothing more than send a different command, while this integration manage the possible state changes between off -> art mode -> on. I will further investigate on this, but is not possible to simply implement same behavior of native integration.

webjib commented 1 year ago

Maybe you could offer a way to customize the turn_off sequence. For example: allowing users to use a custom « send_key » sequence instead of the default behavior.

I don’t use the Art Mode checkbox because either checked or not, the result is the same: it’s going to Art Mode :/

also, the original integration from jaruba states:

is_frame_tv: (boolean)(Optional) This option is False by default. The "Frame" model of Samsung TVs have an Art Mode feature, if this option is set to True the component will hold the power key for 3 seconds to turn off this TV model (instead of pressing normally which would go to Art Mode)

Fulladorn commented 1 year ago

Could you use both integrations at once and define TV as 2 entities?

ollo69 commented 1 year ago

Maybe you could offer a way to customize the turn_off sequence. For example: allowing users to use a custom « send_key » sequence instead of the default behavior.

This is already possible, just use the option to hold key, and you can turn off your TV

also, the original integration from jaruba states:

is_frame_tv:

This is a configuration option that this integration do not have. But because I can understand if frameTV is supported just queying the TV (as native integration do), I just have to adjust the code for this specific condition. Please be patient, it will come...

Could you use both integrations at once and define TV as 2 entities?

What do you mean???

webjib commented 1 year ago

Maybe you could offer a way to customize the turn_off sequence. For example: allowing users to use a custom « send_key » sequence instead of the default behavior.

This is already possible, just use the option to hold key, and you can turn off your TV

I can’t find such an option in the settings. I know I can send the Hold sequence to turn off the TV, but that’s not the default behavior of the integration. Thus I can’t use the power key in the media card. When we uncheck the Art Mode checkbox in the settings, what command is sent to the TV when we turn it off? Could you send a hold sequence instead?

Fulladorn commented 1 year ago

Could you use both integrations at once and define TV as 2 entities?

What do you mean???

Could you used both this integration and the native integration at the same time?

ollo69 commented 1 year ago

I can’t find such an option in the settings. I know I can send the Hold sequence to turn off the TV, but that’s not the default behavior of the integration

For this need modification, I will write here when it will be ready

When we uncheck the Art Mode checkbox in the settings, what command is sent to the TV when we turn it off? Could you send a hold sequence instead?

That option is used only when art mode is detected, but because on this new TVs this detection not working anymore, that check in option is useless.

webjib commented 1 year ago

Thank you very much!

the API v2 url gives me: "FrameTVSupport":"true"

Maybe this is useful to you.

ollo69 commented 1 year ago

With last released version it should be possible to properly turn-off 2022 Frame TV. Please test it and give me your feed-back.

webjib commented 1 year ago

Works perfectly! Good job đź‘Ť

Fulladorn commented 1 year ago

Running into an error when setting up the integration freshly. Error below & redacted diagnostics attached.

I got the "Allow" notification on the TV followed by a success on the configuration flow UI. However, no entity is listed.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/samsungtv_smart/media_player.py", line 187, in async_setup_entry
    SamsungTVDevice(
  File "/config/custom_components/samsungtv_smart/media_player.py", line 365, in __init__
    self._update_config_options(True)
  File "/config/custom_components/samsungtv_smart/media_player.py", line 467, in _update_config_options
    self._ws.update_app_list(self._app_list)
  File "/config/custom_components/samsungtv_smart/api/samsungws.py", line 338, in update_app_list
    self._app_list = dict(app_list)
TypeError: 'NoneType' object is not iterable

diagnostics.txt

mecolmg commented 1 year ago

Running into an error when setting up the integration freshly. Error below & redacted diagnostics attached.

I got the "Allow" notification on the TV followed by a success on the configuration flow UI. However, no entity is listed.

+1, I've fixed this temporarily by manually setting the app list:

  1. On the integrations page, click "configure"
  2. Check "Show options menu", then click "Submit"
  3. Click "Applications list configuration"
  4. I used the example config from the docs, then click "Submit":
    Netflix: "11101200001"
    YouTube: "111299001912"
    Spotify: "3201606009684"
  5. Click "Save options and exit"
  6. Reload the integration
ollo69 commented 1 year ago

Stupid error🤦‍♂️. Fixed in 0.10.1 ... 0.10.2

Fulladorn commented 1 year ago

Stupid error🤦‍♂️. Fixed in ~0.10.1~ ... 0.10.2

Works!

Confirmed both On -> Art -> Off and On -> Off.

Turn on has some weird behavior but works, seems like if you go from Off -> Art Mode it is instead Off -> Last state (either On or Art), if you call the service again it will go to art. The turn_on service behaves a bit odd and need to call it a few times but seems to generally not work. Not sure if this is something that is fixable or a limitation.

peter-dorn commented 1 year ago

Works, thanks! Keep up the good job!

ollo69 commented 1 year ago

@Fulladorn,

because with this TV model I'm not able to determinate the real TV state, for Art Mode service I can only send a power command when I know that TV is turned-on to switch from art-mode to on and viceversa. Related to turn-on, it just use a wake-up-on-lan command and behavior can change. You can also use the integration option to:

1) configure to send wake-up packet multiple time 2) try using SmartThings as alternative method to turn on the TV (normally is better when TV is wireless connected, but could not work at all...)

Fulladorn commented 1 year ago

@Fulladorn,

because with this TV model I'm not able to determinate the real TV state, for Art Mode service I can only send a power command when I know that TV is turned-on to switch from art-mode to on and viceversa. Related to turn-on, it just use a wake-up-on-lan command and behavior can change. You can also use the integration option to:

  1. configure to send wake-up packet multiple time
  2. try using SmartThings as alternative method to turn on the TV (normally is better when TV is wireless connected, but could not work at all...)

Totally understand, works for me, great update. Closing issue as 0.10.2 resolves it.