Right I guess we have the same issue then. I even tried using the volume but it doesn’t work for me. However your component does detect when I turn my on or off from the remote.
@bachoo786 - I guess it’s not guaranteed to work on all models but when I provide my TV’s mac address in its configuration, the samsungtv component will fire a wake-on-lan packet when I call the media_player.turn_on service.
It is possible to set the HDMI input over UPnP. I don’t know if newer Samsung TVs has still the API, but on older TVs (2012, 2013) it was possible. The “MainTVAgent2” UPnP-service has the method “SetMainTVSource”. Also there are several other methods like “SetMainTVChannel”, “SetVolume”, “Play”, “Pause”, “Stop”, etc. I used gupnp-tools on Ubuntu to discover the services and play around with them.
Here are the logs when pressing the on/off button in the UI:
2019-03-07 16:38:59 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.4552020656] {'event': 'ms.channel.unauthorized'}
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 148, in handle_call_service
connection.context(msg))
File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1133, in async_call
self._execute_service(handler, service_call))
File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1155, in _execute_service
await handler.func(service_call)
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py", line 188, in handle_service
self._platforms.values(), func, call, service_name
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 278, in entity_service_call
future.result() # pop exception if have
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 292, in _handle_service_platform_call
await getattr(entity, func)(**data)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/media_player/samsungtv.py", line 214, in turn_off
self.get_remote().close()
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/media_player/samsungtv.py", line 138, in get_remote
self._remote = self._remote_class(self._config)
File "/Users/henrik/.homeassistant/deps/lib/python/site-packages/samsungctl/remote.py", line 11, in __init__
self.remote = RemoteWebsocket(config)
File "/Users/henrik/.homeassistant/deps/lib/python/site-packages/samsungctl/remote_websocket.py", line 30, in __init__
self._read_response()
File "/Users/he
Hi,
I wonder what to do about the warnings I am getting that for all custom components all dependencies need to be included in the custom component. Which files should we move to the samsungtv_custom directory? How should the includes change in the media_player.py file which contains the samsungtv_custom code?
I tried this but not much luck. I do see the TV comes, but it takes like 3-5 minutes before that happens and when turning my tv off manually, HA doesn’t reflect that. I do also get errors when trying to set the Voume:
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py”, line 122, in handle_call_service
connection.context(msg))
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1138, in async_call
self._execute_service(handler, service_call))
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1160, in _execute_service
await handler.func(service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py”, line 188, in handle_service
self._platforms.values(), func, call, service_name
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 314, in entity_service_call
future.result() # pop exception if have
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 330, in _handle_service_platform_call
await func(entity, data)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/media_player/init.py”, line 504, in set_volume_level
raise NotImplementedError()
NotImplementedErrorTraceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py”, line 122, in handle_call_service
connection.context(msg))
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1138, in async_call
self._execute_service(handler, service_call))
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1160, in _execute_service
await handler.func(service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py”, line 188, in handle_service
self._platforms.values(), func, call, service_name
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 314, in entity_service_call
future.result() # pop exception if have
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 330, in _handle_service_platform_call
await func(entity, data)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/media_player/init.py”, line 504, in set_volume_level
raise NotImplementedError()
NotImplementedError