eclair4151 / alexacontrolledsamsungtv Goto Github PK
View Code? Open in Web Editor NEWControl your Samsung smart TV via amazon alexa
License: MIT License
Control your Samsung smart TV via amazon alexa
License: MIT License
Received a new message: b'{"volumeSteps": 10, "operation": "AdjustVolume", "endpointid": "43:e7:70:11:8d :a2"}' from topic: speaker/a355a5c5-15c7-4d95-954e-eed21f77ff15 -------------- Failed to send message to TV: [Errno 111] Connection refused
Keep getting this error when trying to put the volume up on my tv, via alexa.
Mac Address and IP seem to be inputed correctly.
My tv model is a LT32E390S.
After installation I tried to change volume_step_size from 10 to 2 as:
volume_step_size = 2
After I changed it to 2 and register againand start it, it still changing the vulome by 10.
The website to register doesn't load. I tried Safari, Firefox and Chrome on my Mac and Chromium on the pi.
Would it be possible make a custom command witch do a series of keypress
like "NetFlix" as hotword and being translated in my case into "SMART MENU",
"RIGHT BUTTON", "RIGHT BUTTON", "ENTER".
Michael
Hey i get the below when scanning for my tv its a 2019 qled
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "alexasmartcli.py", line 57, in <module>
tvs = scan_network_ssdp(True, wait=2)
File "/home/pi/AlexaControlledSamsungTV/helpers/ssdp.py", line 79, in scan_network_ssdp
info = getTVinfo(tv.location)
File "/home/pi/AlexaControlledSamsungTV/helpers/ssdp.py", line 117, in getTVinfo
resp = requests.get('http://' + ip.group(0) + ':8001/api/v2/').json()
File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.171.5', port=8001): Max retries exceeded with url: /api/v2/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xb64bda70>: Failed to establish a new connection: [Errno 111] Connection refused'))
pi@raspberrypi:~/AlexaControlledSamsungTV $
The website shoots back error 500 when trying to sign up for a new account. every time I try to go to the website all I can get is error 500. Any way to contact the host?
Hey there - got this running on a computer on my local network, works well with my MU6300 - it's great and I plan to add to its list of commands when I have time. Does this have to be running on the same local network as the TV, or is it possible to run it on a webserver? If running it on a webserver is not currently possible, do you think that enhancements to the code could enable or, or is there some blockage that will ever prevent that?
The (python3 alexasmartcli.py scan) command says there are no TVs found. However the TV is connected to the same network as my laptop and echo. I would like to know if the TV model is unsupported or else.
I am using a Chromebook with a Linux terminal if that matters.
seems to have installed Ok but when I issue an instruction to Alexa I get this in terminal, for example:
Failed to send message to TV: No module named 'websocket'
Where should websocket be?
python3 alexasmartcli.py scan returns: "No TVs found"
My TV is connected via Ethernet cable
Any ideas?
It seems like some TVs needs a ID number to be send or it will ask for authorization every time.
Sorry very new to this, don't really know what this means.
Thanks
pi@pi:~/AlexaControlledSamsungTV $ python3 alexasmartcli.py start
Traceback (most recent call last):
File "alexasmartcli.py", line 181, in
mqtt_server.startServer(options.mute)
File "/home/pi/AlexaControlledSamsungTV/helpers/mqtt_server.py", line 204, in startServer
tv_json = json.load(json_data)
File "/usr/lib/python3.5/json/init.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.5/json/init.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 55 column 1 (char 1927)
When I try and change the channel to 103. I can see the request correctly but on the TV it changes to channel 13:
Received a new message: b'{"channel_data": {"channel": {"number": "103"}, "channelMetadata": {}}, "operation": "ChangeChannel", "endpointid": "40:16:3b:42:e1:7f"}' from topic: channel/28ee4056-8450-43a0-94da-d26404322688
I have to say change channel to 1003 to get it to then change correctly to 103 on the TV:
Received a new message: b'{"channel_data": {"channel": {"number": "1003"}, "channelMetadata": {}}, "operation": "ChangeChannel", "endpointid": "40:16:3b:42:e1:7f"}' from topic: channel/28ee4056-8450-43a0-94da-d26404322688
I'm not sure whether you are still maintaining https://alexasmarttv.dev/login but there is an error on the login;
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
Sorry new to this. When i run the alexasmartcli.py it won't run. When i run it in python i get the following.
%Run alexasmartcli.py
please specify an action
Traceback (most recent call last):
File "/home/pi/alexacontrolledsamsungtv/alexasmartcli.py", line 36, in
exit()
File "/usr/lib/python3.5/_sitebuiltins.py", line 26, in call
raise SystemExit(code)
SystemExit: None
Did i install something wrong?
Thanks
Is it possible for you to release the server side code for the alexa skill? I'm interested in setting it up on my own local server
Is there/or could there be a UK skill for this?
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.
I appear to be having some issues attempting to start the server....
Any thoughts?
starting server...
Traceback (most recent call last):
File "alexasmartcli.py", line 181, in
mqtt_server.startServer(options.mute)
File "/opt/AlexaControlledSamsungTV/helpers/mqtt_server.py", line 235, in startServer
myMQTTClient.connect()
File "/home/USERNAME/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/MQTTLib.py", line 408, in connect
return self._mqtt_core.connect(keepAliveIntervalSecond)
File "/home/USERNAME/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 168, in connect
self.connect_async(keep_alive_sec, self._create_blocking_ack_callback(event))
File "/home/USERNAME/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 179, in connect_async
rc = self._internal_async_client.connect(keep_alive_sec, ack_callback)
File "/home/USERNAME/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/internal/clients.py", line 113, in connect
rc = self._paho_client.connect(host, port, keep_alive_sec)
File "/home/USERNAME/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 654, in connect
return self.reconnect()
File "/home/USERNAME/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 776, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/usr/lib/python3.5/socket.py", line 693, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
Failed to send message to TV:
TV MODEL UE55JU6500
Also Scan doesnt show Mac Address
Hello,
I’m having problem. When i make all setting up on my raspberry everything works well, but in a minute on alexasmarttv.tk both TVs gets ofline and alexa doesn’t responding. Any ideas?
As a fellow developer I'm asking what the issue is with J series?
As a user, great work, not so difficult to setup. I wish it worked with J series.
Any progress on this subject?
Hi
Just setting this up...
All good until I register my device (alexasmartcli.py register) - it comes back with 'item not found'.
TVConfig.py is updated with the details from the scan, and I'm logged in to alexasmarttv.tk successfully?
Paul
Hi, completely new to pi and coding but bought one specifically to run this app. I hade issues on the first install, ended up loading again, same issue. I am sure from reading the other issues first it was a DNS issue, but not knowing what DNS really was and trying to change it unsuccessfully led to me having to install raspbian again. Another reload and another fault. The only difference I did during install was being unable to work out how to change values with vim as they came up in red and all I seemed to be able to do was delete them, so I ended up changing the tvconfig.py file in a text editor if this makes any difference? Here is my error message linked below, if it is a DNS issue a heads up on what to change where would be appreciated as I followed a few different guides before and ended up not getting any connection to wifi/Ethernet in the end, thanks, allan
pi@raspberrypi:~/AlexaControlledSamsungTV $ python3 alexasmartcli.py start
starting server...
Traceback (most recent call last):
File "alexasmartcli.py", line 181, in
mqtt_server.startServer(options.mute)
File "/home/pi/AlexaControlledSamsungTV/helpers/mqtt_server.py", line 247, in startServer
myMQTTClient.connect()
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/MQTTLib.py", line 408, in connect
return self._mqtt_core.connect(keepAliveIntervalSecond)
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 168, in connect
self.connect_async(keep_alive_sec, self._create_blocking_ack_callback(event))
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 179, in connect_async
rc = self._internal_async_client.connect(keep_alive_sec, ack_callback)
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/internal/clients.py", line 113, in connect
rc = self._paho_client.connect(host, port, keep_alive_sec)
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 654, in connect
return self.reconnect()
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 776, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/usr/lib/python3.5/socket.py", line 694, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
Hello,
First of all great job with this development. Unfortunately, I receive the error: Failed to send message to TV.
Below is the log:
Received a new message:
b'{"operation": "TurnOn", "endpointid": "50:56:BF:7E:EA:16"}'
from topic:
power/83b13407-d7bc-4a77-8c9f-50020026644c
--------------
Failed to send message to TV:_
Below is the command python3 alexasmartcli.py scan
Scanning for TVs. make sure they are turned on and on the same network
This TV is not currently supported
Name: [TV]Samsung LED65
Model: UA65HU8500
Series: H
Ip: 192.168.1.153
MacAddress:
I look forward to receiving your feedback.
Regards,
Francesco
I have your latest version using SSL websocket but getting the following error.
Any ideas?
Received a new message:
b'{"volumeSteps": -10, "operation": "AdjustVolume", "endpointid": "40:16:3b:42:e1:7f"}'
from topic:
speaker/4e5a0f98-b8fc-4494-95c4-fa96a51e0e91
--------------
Failed to send message to TV: timed out
Every time i run "python3 alexasmartcli.py login" i get this error message
Password:
Traceback (most recent call last):
File "alexasmartcli.py", line 49, in
file = open('.auth/token','w')
PermissionError: [Errno 13] Permission denied: '.auth/token'
I'm not sure what to do, if anyone can help, it would be great.
Thanks
Install went smoothly without a glitch. Commands either don't work or they work 1 out of 10 times. no error messages on the raspberry pi, commands are all being relayed properly see below. TV Model from scan is Name: [TV] Samsung 8 Series (65)
Model: UE65KS8000
Series: K
Ip: 192.168.0.37
please help. love your work
Received a new message:
b'{"operation": "TurnOff", "endpointid": "e4:7d:bd:96:b8:9b"}'
from topic:
power/6871689b-7b99-411a-a871-f97c9c434d25
Every time Alexa sends a request to the TV through samsungctl, the command line shows "WARNING:root:Waiting for authorization..." and the TV shows a message asking to approve of the connection with samsungctl. This lasts for about one second and then the command line displays "Failed to send message to TV: timed out". If I quickly press enter on the TV remote to allow the connection, then the command works, but this ruins the point of the skill, which is of course to not have to use the remote. The Allshare settings say that connections with samsungctl are allowed but it still asks for every request. What can I do to make it permanently allow the connection so that the skill will work properly?
I was able to create an account a few days back but now the website is not working. I get either a blank page or it forwards to what looks like a malware site.
Hi,
The server looks like is working on my RBPI but nothing is happening to my TV when i send commands to Alexa.
TV Details:
Model: UE49NU7170UXZT
a new message:
b'{"operation": "TurnOff", "endpointid": "(privacy)"}'
from topic:
power/713394fb-adfd-4a97-a1b8-db65ca846cfc
--------------
Failed to send message to TV: timed out
Received a new message:
b'{"volumeSteps": 10, "operation": "AdjustVolume", "endpointid": "(privacy)"}'
from topic:
speaker/713394fb-adfd-4a97-a1b8-db65ca846cfc
--------------
Failed to send message to TV: timed out
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.