eclair4151 / AlexaControlledSamsungTV

Control your Samsung smart TV via amazon alexa
MIT License
82 stars 24 forks source link

Permission Required for every Request #20

Closed kbpl24 closed 5 years ago

kbpl24 commented 5 years ago

Every time a request is sent via Alexa to the Samsung TV (UN65MU800D the TV displays a notification stating the following "samsungctl -- Your permission is required to connect your device to this TV" and I can click "allow" or "deny." I click "allow" and it adds it to the allow list, and still the command/request is not executed. In the external device manager on the Samsung TV I have tried to set the notification setting to "first time only" and "always on" but neither options works. The notification occurs after every command/request from Alexa to the TV, and on top of that even after clicking allow the command doesn't execute.

Does anyone have a solution to this?

This is information received in command prompt after the command is requested.

Received a new message:
b'{"operation": "SetMute", "endpointid": "28:39:5E:5F:5B:90"}'
from topic:
speaker/3e20946f-7a9c-479e-b7a2-c6c1c21a34f9
--------------
Failed to send message to TV: The read operation timed out

See below for the tvconfig.py file.

tvconfig.py file

device_name = "Samsung Smart TV 8 Series" #What shows up under devices in alexasmarttv.tk. not that important unless you have multiple devices (not tvs) on your account
volume_step_size = 10  #how much your tv volume should go up by when you say 'Alexa, turn up the volume on my tv'

tvs = [
    {
        'host': "192.168.126.245", #ip address of tv
        'tv_model' : 'UN65MU800D',
        'tv_mac_address': "28:39:5E:5F:5B:90",
        'tv_name' : 'TV', #Leave as TV to refrence this by just 'TV'. ex: 'Alexa, turn on the TV'.  Change to eg:'Kitchen TV' if you want to say 'Alexa turn on the kitchen TV', You cannot have multiple tvs have the same name
        'prefer_HD': True, #if you say 'change the channel to ESPN',  always attempt to use the HD channel number'
    }
]

Information from http://HOSTADDRESS:8001/api/v2/

{"device":{"FrameTVSupport":"false","GamePadSupport":"true","ImeSyncedSupport":"true","OS":"Tizen","TokenAuthSupport":"true","VoiceSupport":"true","countryCode":"US","description":"Samsung DTV RCR","developerIP":"0.0.0.0","developerMode":"0","duid":"uuid:438cf40b-3366-4799-b290-2549fee03c77","firmwareVersion":"Unknown","id":"uuid:438cf40b-3366-4799-b290-2549fee03c77","ip":"192.168.126.245","model":"17_KANTM_UHD","modelName":"UN65MU800D","name":"[TV] Samsung 8 Series (65)","networkType":"wireless","resolution":"3840x2160","smartHubAgreement":"true","ssid":"f0:9f:c2:ae:ba:44","type":"Samsung SmartTV","udn":"uuid:438cf40b-3366-4799-b290-2549fee03c77","wifiMac":"28:39:5E:5F:5B:90"},"id":"uuid:438cf40b-3366-4799-b290-2549fee03c77","isSupport":"{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"false\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n","name":"[TV] Samsung 8 Series (65)","remote":"1.0","type":"Samsung SmartTV","uri":"http://192.168.126.245:8001/api/v2/","version":"2.0.25"}

Please feel free to let me know if additional information is required.

eclair4151 commented 5 years ago

Hey thanks for reporting this. I think this might have been an oversight by me. i just pushed a commit that might fix it. Try to git pull and run it again

kbpl24 commented 5 years ago

Did the git pull and this is the error I receive in the command prompt:

Received a new message:
b'{"operation": "SetMute", "endpointid": "28:39:5E:5F:5B:90"}'
from topic:
speaker/316c9f54-9631-4ad7-bec0-6e502f19d918
--------------
Failed to send message to TV: Invalid close opcode.

I clicked "allow" on the TV. But no command execution.

eclair4151 commented 5 years ago

Huh thats odd. It very hard for me to debug other tvs remotely. Would you be willing to hop on a Skype call or something (after 5PM Eastern Time) and i can do some live debugging with you?

kbpl24 commented 5 years ago

Can you post me a email or something else so I can contact you there?

floydpink commented 5 years ago

I noticed that I have also been running into this for a while now - do we have a fix available, @eclair4151 ?

I am using it with a 2017 model - UN65MU6300 - if there is anything I can do to help debug the issue, please let me know.

Thanks

EDIT: Actually, never mind. After pulling the latest and restarting the server a couple of times, it started working for me now.

floydpink commented 5 years ago

@eclair4151 - unfortunately this issue has started all over again for me. is there anything I can do to troubleshoot why the TV keep prompting for allowing access to samsungctl ?

eclair4151 commented 5 years ago

First try just deleting the entire project and re downloading it. That may fix the issue

vivek4svan commented 4 years ago

I pulled this code today (10Aug2020) for the very first time.. All setup done smoothly but i am still getting this issue of popup for "Allow Permission" for every command and its getting timed out.

My TV IP output : {"device":{"FrameTVSupport":"false","GamePadSupport":"true","ImeSyncedSupport":"true","OS":"Tizen","TokenAuthSupport":"true","VoiceSupport":"true","countryCode":"IN","description":"Samsung DTV RCR","developerIP":"0.0.0.0","developerMode":"0","duid":"uuid:7811f571-28c6-40a8-b8fc-ed052041d16f","firmwareVersion":"Unknown","id":"uuid:7811f571-28c6-40a8-b8fc-ed052041d16f","ip":"192.168.31.137","model":"17_KANTS_FHD","modelName":"UA55M5570","name":"[TV]Xaus 55 TV","networkType":"wireless","resolution":"1920x1080","smartHubAgreement":"true","ssid":"78:11:dc:34:d6:60","type":"Samsung SmartTV","udn":"uuid:7811f571-28c6-40a8-b8fc-ed052041d16f","wifiMac":"84:C0:EF:3F:D6:6E"},"id":"uuid:7811f571-28c6-40a8-b8fc-ed052041d16f","isSupport":"{\"DMP_DRM_PLAYREADY\":\"false\",\"DMP_DRM_WIDEVINE\":\"false\",\"DMP_available\":\"true\",\"EDEN_available\":\"true\",\"FrameTVSupport\":\"false\",\"ImeSyncedSupport\":\"true\",\"TokenAuthSupport\":\"true\",\"remote_available\":\"true\",\"remote_fourDirections\":\"true\",\"remote_touchPad\":\"true\",\"remote_voiceControl\":\"true\"}\n","name":"[TV]Xaus 55 TV","remote":"1.0","type":"Samsung SmartTV","uri":"http://192.168.31.137:8001/api/v2/","version":"2.0.25"}

eclair4151 commented 4 years ago

Are you clicking the allow button that comes up on your tv? you should only need to do that the first time. Can you add the logs from the application?