ha-samsungtv-tizen icon indicating copy to clipboard operation
ha-samsungtv-tizen copied to clipboard

Consider Art Mode as "Off" or "Standby"

Open christo-ph opened this issue 4 years ago • 15 comments

Hi,

thank you very much for this plugin.

While having the option is_frame_tv is possible to power off the tv completely, I rather do not use this option. The art mode turns off automatically when I leave the room or with the light sensor on the TV. I use the normale "power off" switch in everyday usage.

But: The art mode is a third state. Along with on and off, we do have the mode art. This must be considered either as off or if that is possible with its own state art, which is considered as off. The screenshot below shows the state of three Samsung TVs.

image
  1. Is a normal Samsung smart TV, everything works fine, even app list gets updated without any parameter
  2. This is a Frame TV. It is currently in art mode. It is here considered powered ON (it uses the "arte" logo, which is a channel, but that's wrong).
  3. Is a Frame TV completely OFF (the motion sensor turns it off after 15 minutes).

If is_frame_tv is set, then I cannot turn the TV "really" on. Pressing on the power button in HA does not do anything then. Is the TV is ON, then pressing turns it OFF completely, like documented.

If is_frame_tv is not set, then I can turn on the TV from art mode. (it switches in HA shortly to off, because it thinks it was already ON, but eventually recognises the correct state after some seconds). If it was completely OFF, it switches first to art mode with a power button pressed in HA and then after a second press to ON.

In my opinion, it could be possibly to support Frame TVs without this parameter, if it is possible to recognise all three modes correctly. The TV emits "art" in this case.

christo-ph avatar Dec 20 '20 12:12 christo-ph

Thanks for the detailed feedback, that really helps!

We should improve the behavior around this - I do not own a frame TV and nor does @jaruba so we cannot witness ourselves which makes this tricky... the simplest we should do is ignore 'art' while looking for a logo (or develop a special logo).

I would consider the following:

  • 'art' should be spelled 'Art' and could be a mode the TV is in. We could develop a special logo for this mode or just have no logo at all. I believe we could make it show this, while HA thinks it is in either 'off' state or 'on' state. It would be quite an ordeal to have a third state 'art', but we could think about it... need more info first.
  • Since we have no special code that defines 'art' I suspect the 'art' is a feedback from smartthings as a 'channelName' or even an 'inputSource' in which the TV is... it would help to have this confirmed.
  • When is_frame_tv is enabled all the component does extra right now is on turn_off hold the power button for 3 seconds instead of a single push. Nothing more at the moment - we could look to expand this, but again - really hard to do without owning such a tv.

The following questions:

  • Do you have smartthings enabled? I.e. api_key and device_id are filled in?
  • Can you show the output of your living room tv in https://graph-eu01-euwest1.api.smartthings.com/device/show/<device_id> while your TV is in this art mode? Should show something like this - I like to particularly see 'switch', 'inputSource' and 'channelName':

image

  • If above does not show any states for you try and edit your device in smartthings into a 'Samsung OCF TV' and see if then it starts showing some states.

  • Is there any control you can do while the TV is in art mode? I assume you can change painting/scene it shows somehow? Can you explain if/how this can be done? If done via certain keys on your remote while in art mode, can you try doing the same with a service call via the component to see if it also responds to this while in art mode? E.g.: image

  • If you press a key to go to a channel or source while in art mode, does the TV immediately respond to this? Or do you have to specifically hit the 'power on' key to make it fully turn on?

Your answers could really help us improve, without further info it's hard for us to do anything but ignore keyword 'art' while looking for a matching logo.

Screwdgeh avatar Dec 20 '20 14:12 Screwdgeh

Hi, thanks for the fast response.

First, here is the TV in the Bedroom (The Frame 2017/2018 model; Living room is newer and has along with the art mode also an ambient mode). but first things first:

inputSource: digitalTv
supportedInputSources:
[
    "digitalTv"
]
data:
icv: core.1.1.0
mndt: 2018-01-01
n: [TV] Samsung Frame Series (43)
mnsl: http://www.samsung.com/sec/tv/overview/
dmv: res.1.1.0,sh.1.1.0
di: bcdd11f9-8694-4c7c-b502-9a402cd4792a
mnmo: UE43LS03N
mnmn: Samsung Electronics
mnos: 4.1.10
mnpv: Tizen 4.0
st: 2020-12-20T10:17:48Z
mnfv: T-KTM2DEUC-1310.4
mnml: http://www.samsung.com
pi: bcdd11f9-8694-4c7c-b502-9a402cd4792a
vid: VD-STV_2018_K
mnhw: 0-0
firmwareVersion: 2.4.0
error:
volume: 7
supportedPictureModes:
[
    "Dynamisch",
    "Standard",
    "Nat\u00fcrlich",
    "Film"
]
supportedPictureModesMap:
[
    {
        "id": "modeDynamic",
        "name": "Dynamisch"
    },
    {
        "id": "modeStandard",
        "name": "Standard"
    },
    {
        "id": "modeNatural",
        "name": "Nat\u00fcrlich"
    },
    {
        "id": "modeMovie",
        "name": "Film"
    }
]
pictureMode:
switch: on
supportedTrackControlCommands:
playbackStatus:
supportedPlaybackCommands:
[
    "play",
    "pause",
    "stop",
    "fastForward",
    "rewind",
    "next",
    "previous"
]
mute: unmute
tvChannel:
tvChannelName: art
soundMode: Verstärken
supportedSoundModesMap:
[
    {
        "id": "modeStandard",
        "name": "Standard"
    },
    {
        "id": "modeSmart",
        "name": "Optimiert"
    },
    {
        "id": "modeAmplify",
        "name": "Verst\u00e4rken"
    }
]
supportedSoundModes:
[
    "Standard",
    "Optimiert",
    "Verst\u00e4rken"
]
supportsPowerOnByOcf: false
onsupport: false
_supportedPictureModes: [{"x.com.samsung.tv.name":"Dynamisch","x.com.samsung.tv.id":"modeDynamic"},{"x.com.samsung.tv.name":"Standard","x.com.samsung.tv.id":"modeStandard"},{"x.com.samsung.tv.name":"Natürlich","x.com.samsung.tv.id":"modeNatural"},{"x.com.samsung.tv.name":"Film","x.com.samsung.tv.id":"modeMovie"}]
_supportedSoundModes: [{"x.com.samsung.tv.name":"Standard","x.com.samsung.tv.id":"modeStandard"},{"x.com.samsung.tv.name":"Optimiert","x.com.samsung.tv.id":"modeSmart"},{"x.com.samsung.tv.name":"Verstärken","x.com.samsung.tv.id":"modeAmplify"}]
cloudSupported: true

The icon for power on/off on the remote looks like the following IMG_2338

It seems to send the same signal to an ordinary Samsung TV, as I can switch the remotes between all models. Here the normal power switch:

IMG_2339

christo-ph avatar Dec 20 '20 15:12 christo-ph

While in the art mode, if I press the "back" key, the circle itself or left/right/up/down, I get in an options menu, where I can make several settings in the art mode.

If I press the power or home or app button (Netflix, prime, Rakuten), the tv is immediately "on", or in the app.

Where can I find the Service section to do the calls?

christo-ph avatar Dec 20 '20 15:12 christo-ph

Very helpful these answers, thanks!

The services section is in 'Developer tools' in the sidebar: image

Screwdgeh avatar Dec 20 '20 15:12 Screwdgeh

From the smartthings output it is considered 'on' with channelName: 'art' which could be a nice way of distinguishing art mode vs. it being on in an app or showing a tv channel. Sadly I believe that people that do not use smartthings do not have this luxury and we will not be able to distinguish...

From watching some youtube video's on the TV it seems to auto turn on into art mode and auto turns off if you leave the room? When it really turns off fully, does it show correctly as off in HA after a while?

What update_method do you have defined in your configuration?

Screwdgeh avatar Dec 20 '20 15:12 Screwdgeh

Correct, if those options are set, it goes to an OFF state. Also HA shows then OFF.

Where can I found the update_method? I am new to HA. Nothing found in configuration.yaml.

christo-ph avatar Dec 20 '20 16:12 christo-ph

Where can I found the update_method? I am new to HA. Nothing found in configuration.yaml.

That is ok, that means you did not make changes and use the default method (ping). Thanks for providing all this info, I will need to have a think through what we could do about this.

If you can tell me more about the TV with ambient mode that could be great as well, like:

  • A smartthings state dump for when the TV is in ambient mode
  • Behavior description of ambient mode (is it same as art?)
  • Same button possibilities?

Screwdgeh avatar Dec 20 '20 18:12 Screwdgeh

Ambient mode:

switch: on
tvChannel:
tvChannelName: ambient

If the TV is completely off, the channel name keeps art or ambient, but switch is off.

Complete output:

inputSource: digitalTv
supportedInputSources:
[
    "digitalTv"
]
data:
icv: core.1.1.0
mndt: 2020-01-01
n: [TV] Samsung The Frame (55)
mnsl:
dmv: res.1.1.0,sh.1.1.0
di: 51b8d61d-4328-e6d6-5523-30c1caad1a6c
mnmo: GQ55LS03TAUXZG
mnmn: Samsung Electronics
mnos: Tizen
mnpv: 5.5
st: 2020-12-20T09:24:27Z
mnfv: T-NKMDEUC-1403.1
mnml:
pi: 51b8d61d-4328-e6d6-5523-30c1caad1a6c
vid: VD-STV_2018_K
mnhw:
firmwareVersion: 3.4.0
error:
volume: 8 %
supportedPictureModes:
[
    "Dynamisch",
    "FILMMAKER MODE",
    "Standard",
    "Film",
    "Nat\u00fcrlich"
]
supportedPictureModesMap:
[
    {
        "id": "modeDynamic",
        "name": "Dynamisch"
    },
    {
        "id": "modeFilmmakerMode",
        "name": "FILMMAKER MODE"
    },
    {
        "id": "modeStandard",
        "name": "Standard"
    },
    {
        "id": "modeMovie",
        "name": "Film"
    },
    {
        "id": "modeNatural",
        "name": "Nat\u00fcrlich"
    }
]
pictureMode: Standard
switch: on
supportedTrackControlCommands:
playbackStatus:
supportedPlaybackCommands:
[
    "play",
    "pause",
    "stop",
    "fastForward",
    "rewind",
    "next",
    "previous"
]
mute: unmuted
tvChannel:
tvChannelName: ambient
soundMode: Verstärken
supportedSoundModesMap:
[
    {
        "id": "modeStandard",
        "name": "Standard"
    },
    {
        "id": "modeAmplify",
        "name": "Verst\u00e4rken"
    }
]
supportedSoundModes:
[
    "Standard",
    "Verst\u00e4rken"
]
supportsPowerOnByOcf: true
onsupport: true
_supportedPictureModes: [{"x.com.samsung.tv.name":"Dynamisch","x.com.samsung.tv.id":"modeDynamic"},{"x.com.samsung.tv.name":"FILMMAKER MODE","x.com.samsung.tv.id":"modeFilmmakerMode"},{"x.com.samsung.tv.name":"Standard","x.com.samsung.tv.id":"modeStandard"},{"x.com.samsung.tv.name":"Film","x.com.samsung.tv.id":"modeMovie"},{"x.com.samsung.tv.name":"Natürlich","x.com.samsung.tv.id":"modeNatural"}]
_supportedSoundModes: [{"x.com.samsung.tv.name":"Standard","x.com.samsung.tv.id":"modeStandard"},{"x.com.samsung.tv.name":"Verstärken","x.com.samsung.tv.id":"modeAmplify"}]
cloudSupported: true

christo-ph avatar Dec 20 '20 18:12 christo-ph

All buttons, including volume seems to work (ambient also plays some background noise). If I press on "on" or "home" TV turn on. Here a small gif

IMG_2340

christo-ph avatar Dec 20 '20 18:12 christo-ph

This is awesome feedback, thanks so much. It looks from Samsung documentation that ambient mode does not automatically turn on when you enter the space (at least on non-frame TVs). While for frame TVs that does seem to be a feature, at least for art mode. Can you confirm if you can set it to auto turn on into ambient mode instead of art too?

It does also seem like the button behaviour is different thanks to the special ambient button. I'd expect for non-frame TVs that the power button always puts the tv into tv mode. Only if you press ambient mode button or navigate to app it turns into ambient mode.

Is there a way for you to configure your frame tv to completely disable art or ambient mode in your poweron and poweroff sequence?

Screwdgeh avatar Dec 21 '20 11:12 Screwdgeh

@Screwdgeh

Ollo69 did some work on detecting Art Mode from Frame TVs (in his fork of this component) through the WebSockets API, see here:

  • https://github.com/ollo69/ha-samsungtv-smart/blob/master/custom_components/samsungtv_smart/api/samsungws.py#L71-L75
  • https://github.com/ollo69/ha-samsungtv-smart/blob/master/custom_components/samsungtv_smart/media_player.py#L900-L908

We should be able to use his samsungws.py in our component too, the same file is called websockets.py in our repo.

jaruba avatar Dec 21 '20 19:12 jaruba

any news to manage art mode of Frame TV? I have 2020 model...I can help in any way?

pilot1981 avatar Dec 23 '20 07:12 pilot1981

Trying to wrap my head around the code in Ollo69's component... it seems very elaborate! He sets up a separate websocket connection for checking the status of the art app.

I really wonder if we include the art app into our normal applist it would probably fetch the status of it correctly and sets it as the current running app. Then based on the fact that the art app is the running app we can do our decision making on what to do with turn on/turn off actions in this case.

I see that Ollo69 has another way of checking which app is running. He does that also always using websocket instead of our rest call. @ollo69: do you think that calling http://{host}:8001/api/v2/applications/com.samsung.art-app will also give a response that includes 'visible' like in below function? Our component uses this currently to understand what is the currently running app.

def _get_running_app(self):
    if self._app_list is not None:
        if hasattr(self, '_cloud_state') and self._cloud_channel_name != "":
            for attr, value in self._app_list_ST.items():
                if value == self._cloud_channel_name:
                    self._running_app = attr
                    return
        if self._scan_app_http:
            for app in self._app_list:
                r = None
                try:
                    r = requests.get('http://{host}:8001/api/v2/applications/{value}'.format(host=self._host, value=self._app_list[app]), timeout=0.5)
                except requests.exceptions.RequestException as e:
                    pass
                try:
                  if r is not None:
                      data = r.text
                      if data is not None:
                          root = json.loads(data.encode('UTF-8'))
                          if 'visible' in root:
                              if root['visible']:
                                  self._running_app = app
                                  return
                except Exception as ex:
                       _LOGGER.debug("Samsung TV %s, _get_running_app Failed - %s......",self._name,ex)
    self._running_app = 'TV/HDMI'

Screwdgeh avatar Dec 23 '20 16:12 Screwdgeh

I did some test on my Frame TV (2020 model).

Art Mode indeed seems to be nothing more then a App. If I define it in my app_list its correctly detected:

    app_list: >-
      {
        "Netflix": "org.tizen.netflix-app",
        "Prime Video": "org.tizen.primevideo",
        "Disney+": "MCmYXNxgcu.DisneyPlus",
        "Art Mode": "art"
      } 

image

With is_frame_tv set to false the behavior of pressing the media player power button is as follows:

  1. When Art Mode (app) is active the TV returns to its state from before Art Mode was enabled and the menu is shown. In HA the TV is shown as off but will recovers automatically to correct state.
  2. When watching TV or another app then Art Mode is active the TV switches to Art Mode. In HA the TV is shown as off but it recovers automatically to Art Mode.
  3. When the TV is Off it turns on to its previous state which could be Art Mode and in this case you need to press power again to start watching TV. This is the same behavior as the remote.

With is_frame_tv set to true the behavior of pressing the media player power button is as follows:

  1. When Art Mode (app) is active the TV turns off and the state in HA matches.
  2. When watching TV or another app then Art Mode is active the TV turns off and the state in HA matches.
  3. When the TV is Off it turns on to its previous state which could be Art Mode and in this case you need to switch source in order to exit Art Mode and start watching TV.

Both cases don't really work as expected is_frame_tv set to false is closes to the users expected behavior and the remote with the exception that you can't turn off the TV manually (Art Mode the motion and light sensor could handle this automatically). The main issue in HA is that it thinks the TV is turned off when switching from Art Mode to TV or vice versa which prevents you to control the TV until it recovers.

With is_frame_tv set to false you can't switch to art mode trough the power buttons as intended for a Frame TV, it always turns off completely. You need to launch Art Mode as an app and similar exit Art Mode by switching to another source. This does prevent HA from thinking the TV is off but the behavior of the media player does not matches the users expectations and the remote. From HA Art Mode can only controlled as an app which is not ideal for interactive use from HA.

ktvanzwol avatar Jan 25 '21 21:01 ktvanzwol

Honestly I don't have a Frame TV, I implemented the dedicated WS channel but the test are only based on users feed-back. Make sense that Art Mode is managed as an app, but the advantage of using the dedicated channel is because is possible to have a more immediate feed-back of the TV state (is the TV the provide the new state and not the result of a polling). I suppose that Samsung implement the channel for this reason. Generally speaking I implemented the communication using the WS channels always active because this is the way that a WS protocol should work. Continuously open the WS require to perform every time authentication, this obviously cause delay and potential failure of the command sent. And if you call rest API when the WS channel is closed (for timeout), you could receive a popup requesting authentication on the TV, because you are open a new connection with a different name,

ollo69 avatar Jan 25 '21 22:01 ollo69