Code Monkey home page Code Monkey logo

ha_samsung_multi_room's Introduction

Samsung Multiroom support for HomeAssistant

Control volume, and source of your multiroom device like Samsung Soundbar K650 using HomeAssistant

Installation

Copy media_player/samsung_multi_room.py to <config>/custom_components/media_player directory. Then add this to your configuration.yaml

media_player:
  - platform: samsung_multi_room
    name: "Soundbar" # name, otherwise it will use name of your soundbar
    host: 192.168.1.227 # ip of your soundbar
    max_volume: 20 # on this level glass breaks, and there are 80 levels more on K650...

Sources

  • soundshare - this is tv
  • bt - bluetooth
  • aux
  • optical
  • hdmi

Api support

Based on information gathered from: https://github.com/bacl/WAM_API_DOC/blob/master/API_Methods.md

ha_samsung_multi_room's People

Contributors

macbury avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha_samsung_multi_room's Issues

No version key in the manifest file

Hi, Home Assistant 2021.3.0 log:

No 'version' key in the manifest file for custom integration 'samsung_multi_room'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'samsung_multi_room'.

Soundbar Error

Hi,

Thanks for the files and configuration, I have a Samsung Soundbar, saved the python file as instructed under "\Rp2\home assistant\custom_components\media_player" I added the Soundbar to the configuration.yaml file as follows:

media_player:
  - platform: cast
  - platform: samsung_multiroom
    name:
    host: 192.168.1.101
    max_volume: 40

I get an error that indicates samsung_multi_room is not found.

Log Details (ERROR)
Sat May 19 2018 22:07:30 GMT+0200 (South Africa Standard Time)
Platform not found: media_player.samsung_multiroom

Error if the speaker is not found

If the speaker is not reachable, Home-Assistant throws the following error in the log.
Is it possible to handle this situation? My speaker is connected to a smart plug and has only power when it is in use.

Log:

2019-02-05 21:53:22 WARNING (MainThread) [homeassistant.loader] You are using a custom component for customizer which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-05 21:53:33 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform samsung_multi_room is taking over 10 seconds.
2019-02-05 21:53:33 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform samsung_multi_room
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 181, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 164, in _new_conn
    (self.host, self.timeout))
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x705e63b0>, 'Connection to 192.168.1.107 timed out. (connect timeout=10)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.1.107', port=55001): Max retries exceeded with url: /UIC?cmd=%3Cname%3EGetFunc%3C%2Fname%3E (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x705e63b0>, 'Connection to 192.168.1.107 timed out. (connect timeout=10)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/media_player/samsung_multi_room.py", line 175, in setup_platform
    add_devices([MultiRoomDevice(name, max_volume, api)], True)
  File "/config/custom_components/media_player/samsung_multi_room.py", line 115, in __init__
    self.update()
  File "/config/custom_components/media_player/samsung_multi_room.py", line 160, in update
    self._current_source = self.api.get_source()
  File "/config/custom_components/media_player/samsung_multi_room.py", line 101, in get_source
    return self._exec_get('GetFunc', 'function')
  File "/config/custom_components/media_player/samsung_multi_room.py", line 69, in _exec_get
    return self._exec_cmd('<name>{0}</name>'.format(action), key_to_extract)
  File "/config/custom_components/media_player/samsung_multi_room.py", line 64, in _exec_cmd
    req = requests.get(url, timeout=10)
  File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 504, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='192.168.1.107', port=55001): Max retries exceeded with url: /UIC?cmd=%3Cname%3EGetFunc%3C%2Fname%3E (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x705e63b0>, 'Connection to 192.168.1.107 timed out. (connect timeout=10)'))

"Setup of the soundbar" Error

I get the folowing error on HA loading.
Any ideas?

Log Details (ERROR)
Logger: custom_components.samsung_multi_room.media_player
Source: custom_components/samsung_multi_room/media_player.py:193
First occurred: April 24, 2020, 9:18:00 PM (1 occurrences)
Last logged: April 24, 2020, 9:18:00 PM

Setup of the soundbar

Syntax error?

Hi,

I'm trying to use this with Samsung M3's & M7. Any idea whether they should work? I created the folder structure, gave it chmod 777, copied the .py file and added this to configuration.yaml:

media_player:
  - platform: samsung_multi_room
    name: "Test"
    host: 192.168.1.101
    max_volume: 20 # on this level glass breaks

With this config Hass.io wont even start due to this error:

WARNING:homeassistant.helpers.config_validation:Your configuration contains extra keys that the platform does not support.
Please remove [name].
ERROR:homeassistant.scripts.check_config:BURB
Traceback (most recent call last):
 File "/usr/local/lib/python3.7/site-packages/homeassistant/scripts/check_config.py", line 207, in check
   res['components'] = check_ha_config_file(hass)
 File "/usr/local/lib/python3.7/site-packages/homeassistant/scripts/check_config.py", line 374, in check_ha_config_file
   platform = loader.get_platform(hass, domain, p_name)
 File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 89, in get_platform
   domain=platform_name, platform=domain))
 File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 147, in _load_file
   module = importlib.import_module(path)
 File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
   return _bootstrap._gcd_import(name[level:], package, level)
 File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
 File "<frozen importlib._bootstrap>", line 983, in _find_and_load
 File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
 File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
 File "<frozen importlib._bootstrap_external>", line 724, in exec_module
 File "<frozen importlib._bootstrap_external>", line 860, in get_code
 File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
 File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
 File "/config/custom_components/media_player/samsung_multi_room.py", line 7
   <!DOCTYPE html>
   ^
SyntaxError: invalid syntax
Fatal error while loading config: invalid syntax (samsung_multi_room.py, line 7)
Failed config
 General Errors:
   - invalid syntax (samsung_multi_room.py, line 7)

If I comment out 'name', HA starts but I get syntax error.

If I leave the name blank (just name:), it gives the longer error described above.

Bluetooth Soundbar

is it possible to connect a Samsung Soundbar which has no Wi-Fi support? only via Bluetooth?

Platform error media_player.samsung_multi_room - Integration 'samsung_multi_room' not found.

I'm new to Home Assistant and I'm petty sure the issue is coming from me.

I copy the file to config/custom_components/media_player/

but I keep having this error :
Platform error media_player.samsung_multi_room - Integration 'samsung_multi_room' not found.

PS the first media_player platform is for a another components

media_player:
  - platform: samsungtv_tizen
    host: 192.168.X.XX
    mac: XX:XX:XX:XX:XX:XX
  - platform: samsung_multi_room
    name: "Soundbar"  
    host: 192.168.X.XX 
    max_volume: 20 

Broken after HA custom component name

I've used this component for some time now, but after upgrade to home assistant 0.89 (I think) it doesn't work anymore, I think its because of this breaking change:
https://developers.home-assistant.io/blog/2019/02/19/the-great-migration.html

I've tried to rename folder, file and add init.py, but it doesn't work.

Can you update this component with HA's new folder system, please.
I think it should be like this: <custom_component folder>/samsung_multi_room/media_player.py

MediaPlayerDevice is deprecated (0.11x)

I get this issue in the logs. It seems that since HA core version 0.11x introduced some breaking changes and this component is affected:
MediaPlayerDevice is deprecated, modify MultiRoomDevice to extend MediaPlayerEntity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.