Skip to content

Commit

Permalink
add ws protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
roberodin authored Oct 17, 2019
1 parent 38c701c commit 6ef624b
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,38 @@ This is a custom component to allow control of SamsungTV devices in [HomeAssista

* Ability to send keys using a native Home Assistant service
* Ability to customize source list at media player dropdown list
* Ability to change communication protocol from SamsungCtl (HA default) to WS (for 2016+ TVs model)

![N|Solid](https://i.imgur.com/8mCGZoO.png)
![N|Solid](https://i.imgur.com/t3e4bJB.png)


# Installation (There are two methods, with HACS or manual)

### 1. Easy Mode

We support [HACS](https://hacs.netlify.com/). Go to "STORE", search "SamsungTV Custom" and install.

### 2. Manual

Install it as you would do with any homeassistant custom component:

1. Download `custom_components` folder.
2. Copy the `samsungtv_custom` direcotry within the `custom_components` directory of your homeassistant installation. The `custom_components` directory resides within your homeassistant configuration directory.
**Note**: if the custom_components directory does not exist, you need to create it.
After a correct installation, your configuration directory should look like the following.
```
└── ...
└── configuration.yaml
└── custom_components
└── samsungtv_custom
└── samsungtvws
└── __init__.py
└── media_player.py
└── manifest.json
```


# Configuration

1. Enable the component by editing the configuration.yaml file (within the config directory as well).
Expand All @@ -26,17 +53,25 @@ Edit it by adding the following lines:
media_player:
- platform: samsungtv_custom
host: IP_ADDRESS
port: PORT (8001 or 8002)
mac: MAC_ADDRESS
sourcelist: '{"PlayStation": "KEY_HDMI1", "RaspberryPi": "KEY_HDMI2", "Chromecast": "KEY_HDMI3"}'
protocol: PROTOCOL (ctl or ws)
```
**Note**: This is the same as the configuration for the built-in [Samsung Smart TV](https://www.home-assistant.io/integrations/samsungtv/) component.
**Note**: This is the same as the configuration for the built-in [Samsung Smart TV](https://www.home-assistant.io/integrations/samsungtv/) component, except for the custom variables.

### Custom configuration variables
### Custom variables

**sourcelist:**<br/>
(json)(Optional)<br/>
This contains the visible sources in the dropdown list in media player UI.<br/>
Default value: '{"TV": "KEY_TV", "HDMI": "KEY_HDMI"}'<br/>

**protocol:**<br/>
(string)(Optional)<br/>
This determine which communication protocol will be used [ctl or ws]. If it does not work with the default protocol try changing it to the ws.<br/>
Default value: ctl<br/>

2. Reboot Home Assistant
3. Congrats! You're all set!

Expand Down Expand Up @@ -427,3 +462,4 @@ Please note that some codes are different on the 2016+ TVs. For example, `KEY_PO
----------------

The code list has been extracted from: https://github.com/kdschlosser/samsungctl
Protocol samsungtvws from: https://github.com/xchwarze/samsung-tv-ws-api

0 comments on commit 6ef624b

Please sign in to comment.