sermayoral / ha-samsungtv-encrypted

Samsung TV Encrypted Models (H & J Series) custom component for Home Assistant
Apache License 2.0
39 stars 24 forks source link

SamsungTV Encrypted Adventures #9

Open sermayoral opened 4 years ago

sermayoral commented 4 years ago

Please use this thread to share your experiences with this custom component, tests, etc. The goal of this thread is to avoid saturating threads of specific issues. This thread will remain open

rpcaeiro commented 4 years ago

Hi, First, I did my tests on a HU8500. My goal was to find a way to automatically call Netflix app on my TV. I couldn't find a way to call Netflix directly, however there is a way to enter into the app's menu with a KEY: entity_id: media_player.samsung_tv_remote media_content_id: "KEY_CONTENTS" media_content_type: "send_key" After you have accessed to the menu, you only need to send the ENTER key, because the first app that appears in the menu is the Netflix. However, the Netflix is there because was the last chosen. If, for instance the last accessed app on your TV was YouTube, then will fail to call Netflix, of course and will run YT instead.. So, in short, if you only use Netflix, then sending the KEY_CONTENTS followed by KEY_ENTER will do the trick for you.

I also found other alternative way to do it. In my case, I have a SetupBox from Vodafone (my TV provider) and from the TV I can control the setupbox. In that box, the Netflix is always in the same position, so I only need to call the app menu (sending the KEY_CYAN), then KEY_RIGHT and KEY_ENTER. Done, and Netflix is running.

So, on both ways I can build an automation to call Netflix using the Alexa voice command. Cool!

sermayoral commented 4 years ago

Oh, great!! I am in the first scenario, and i use Netflix and Youtube, so i can't suppose what app is the last chosen.

But it is a first step... :-)

rosiaantje commented 4 years ago

I can confirm the custom component working for the UE55HU7100(s). Only thing was to get the get_token.py to run.. but that was my incapability with python šŸ˜‚

sermayoral commented 4 years ago

@rosiaantje thanks for your feedback. I have updated working models including yours.

I have on the to-do list improve the get_token.py, but at the moment it is something with less priority. I'm still thinking how to do it :-)

rosiaantje commented 4 years ago

@rosiaantje thanks for your feedback. I have updated working models including yours.

I have on the to-do list improve the get_token.py, but at the moment it is something with less priority. I'm still thinking how to do it :-)

@sermayoral Wow that would be nice! If you need any help. From the field of dummy testing / dummy proofing. I would be glad to help and test! Iā€™m a field engineer by trade so used to technics and some degree of programming.. only not jet that farmiliar with python although I would love to learn more. Any way enough about that!

Keep up the good work! Love what you are doing!

Boboman1 commented 4 years ago

I can confirm the custom component working for the UE55HU7100(s). Only thing was to get the get_token.py to run.. but that was my incapability with python šŸ˜‚

Hi @rosiaantje! Can please describe the steps how you managed to get get_token.py to run? I'm trying on a Windows 10 pc with no success so far :|

rosiaantje commented 4 years ago

@Boboman1 . I run on Mac.. but should not matter. I installed python 3 (clean install) due to some residue of a previous install I had problems with updating pip. So had to manually uninstall pip and then manually run new version install.. after that I installed pycryptrodome and an other depending packet and was able to run it! Ps check closed issue #5 that is where I found the hurdles I had to overcome on dependicys

memphisdj commented 4 years ago

I own a J5500, i successfuly managed to get the token and the session id. However, i can use the vol up/down and mute buttons, they work fine, but the slider is throwing 'NoneType' object is not subscriptable, also i cannot turn the tv off with the button. The state is properly detected.

sermayoral commented 4 years ago

@aleksandrov1995 we are working on this problem in #10

andrei4002 commented 4 years ago

not sure if it's documented somewhere, but one thing I noticed on my JU7000 is that if the TV loses power, all the sessions / tokens are invalidated (and i also think they expire eventually after a while - days, weeks, don't know exactly - even if the tv stays in standby)

sermayoral commented 4 years ago

@andrei4002 I have not had this problem, but it is possible. Well, we should indicate this in README. Thanks

tonyp740613 commented 4 years ago

I have a UA40H5500 TV and your component is working great! I am wondering if there is a way to force refresh of the TV information or set a refresh interval?
For example when I switch on my TV only AV and TV are in the sources list. When I switch on my Android TV box on HDMI1 and my XBOX on HDMI3 then it doesn't appear in the available sources until some time later. On the TV those sources are only available if it detects that the device is active on that source input.

tonyp740613 commented 4 years ago

Is there any way to add an apps list similar to the sources list? Allow the selection of Netflix, Youtube and other apps loaded on the TV.

sermayoral commented 4 years ago

Is there any way to add an apps list similar to the sources list? Allow the selection of Netflix, Youtube and other apps loaded on the TV.

No, these models don't let to select app :-(

tonyp740613 commented 4 years ago

I know you can use a URL to launch the app, is it possible to add this in some way? http://YOUR_IP:8001/api/v2/applications/11101200001 http: // IP ADDRESS: 8080 / ws / app / Netflix

I have test the api URL and it works on the H5500

sermayoral commented 4 years ago

@tonyp740613 I'm a little busy these days, but when i have free time i will search for this :-)

BTW, PRs are welcome :-)

omribenami commented 4 years ago

Hu8500 works great. Extracted the token. As for now cant call services dont know why... trying to figure it out... thank you šŸ™šŸ™šŸ™

andrei4002 commented 4 years ago

any hints on how a token/session id can be validated if they work? (trying to do some automation to at least notify me when my token expired)

also, an interesting issue i'm seeing is some request automatically being done to the TV every few seconds, and they act as if the tv is being sent the "back" command - meaning if you're in a tv menu using your remote, you get pushed back one level every few seconds

sermayoral commented 4 years ago

any hints on how a token/session id can be validated if they work? (trying to do some automation to at least notify me when my token expired)

@andrei4002 maybe you can capture a log message in order to know the token is invalid. Fortunately for me my token does not expire, so I cannot test this :-(

also, an interesting issue i'm seeing is some request automatically being done to the TV every few seconds, and they act as if the tv is being sent the "back" command - meaning if you're in a tv menu using your remote, you get pushed back one level every few seconds

Same as #4

rschoell commented 4 years ago

@sermayoral Got your plugin installed and grabbed the token from my PC. I can confirm, that I'm now able to control a UE55JU6850 partially. I'll need to modify my settings a little still. this was the first test after installation. Whats working is currently the volume up/down, mute, timeshift/pause. Not working as of first test is: there's no Source selection and the power off is not working. Shall I open another troubleshooting thread on this model? Great work!

sermayoral commented 4 years ago

@rschoell for powering off try adding the key_power_off variable with value "KEY_POWER". More info in https://github.com/sermayoral/ha-samsungtv-encrypted#custom-variables

For source selection you have to put the component logs in debug and we have to see what is your problem. Please for this use #10, all the info about it is there

polleke69 commented 2 years ago

Ola Memphis, I own a J6300 but cant get the stuff to work.

Would u mind sharing your configs?

dark81 commented 2 years ago

Works well on H4500. But does not play play TTS audio. Prints error:

2021-12-07 02:29:16 ERROR (MainThread) [custom_components.samsungtv_encrypted.media_player] Unsupported media type
epenet commented 2 years ago

Since Samsung is being discovered inside HomeAssistant core, we are getting a lot of issues with TVs not working until a custom component is installed. I have just done a huge cleanup for the "websocket" TVs, and now I think it would be good to add support for the "encrypted" TVs (at least basic support - I am leaving upnp out for now)

Are there users out there that would be willing to work with me to test it? For now I have created a fake PR on my home-assistant-core fork : https://github.com/epenet/home-assistant-core/pull/71

sermayoral commented 2 years ago

@epenet these are great news.

Of course, i can help you