From 056db4e679f19c1fe05d9c495eb8d48da657af19 Mon Sep 17 00:00:00 2001 From: escoand Date: Thu, 23 Jan 2020 10:44:54 +0100 Subject: [PATCH] Update config to new Samsung TV integration (#11616) * update config * add wol example * move WOL example to separate chapter * Update samsungtv.markdown * Update ssdp.markdown * Update samsungtv.markdown --- source/_integrations/samsungtv.markdown | 61 ++++++++++++++----------- source/_integrations/ssdp.markdown | 1 + 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/source/_integrations/samsungtv.markdown b/source/_integrations/samsungtv.markdown index 4e234c6226d..beb5dab6927 100644 --- a/source/_integrations/samsungtv.markdown +++ b/source/_integrations/samsungtv.markdown @@ -6,6 +6,7 @@ ha_category: - Media Player ha_release: 0.13 ha_iot_class: Local Polling +ha_config_flow: true ha_codeowners: - '@escoand' --- @@ -14,49 +15,57 @@ The `samsungtv` platform allows you to control a [Samsung Smart TV](https://www. ### Setup +Go to the integrations page in your config and click on new integration -> Samsung TV. +If you have enabled [ssdp](/integrations/ssdp) discovery and your TV is on, it's likely that you just have to confirm the detected device. + When the TV is first connected, you will need to accept Home Assistant on the TV to allow communication. -### Configuration +### YAML Configuration -To add a TV to your installation without relying on the [discovery component](/integrations/discovery/), add the following to your `configuration.yaml` file: +YAML configuration is around for people that prefer YAML. +To use a TV add the following to your `configuration.yaml` file: ```yaml # Example configuration.yaml entry -media_player: - - platform: samsungtv - host: IP_ADDRESS +samsungtv: + - host: IP_ADDRESS ``` {% configuration %} host: - description: "The IP of the Samsung Smart TV, e.g., `192.168.0.10`." + description: "The hostname or IP of the Samsung Smart TV, e.g., `192.168.0.10`." required: true type: string port: description: The port of the Samsung Smart TV. If set to 8001, the new websocket connection will be used (required for 2016+ TVs) - for installs other than Hass.io or Docker you may need to install a Python package, see below. required: false type: integer - default: 55000 + default: automatically detected name: description: The name you would like to give to the Samsung Smart TV. required: false type: string -timeout: - description: The timeout for communication with the TV in seconds. +turn_on_action: + description: "Defines an [action](/docs/automation/action/) to turn the TV on." required: false - type: time - default: 0 (no timeout) -mac: - description: "The MAC address of the Samsung Smart TV, e.g., `00:11:22:33:44:55:66`. Required for power on support via wake on lan." - required: false - type: string -broadcast_address: - description: The broadcast address on which to send the Wake-On-Lan packet. - required: false - default: 255.255.255.255 - type: string + type: list {% endconfiguration %} +#### Wake up TV + +To wake up the TV when switched off you can use the [wake-on-lan](/integrations/wake_on_lan/) integration and call a service. This is not possible with every device. + +```yaml +wake_on_lan: + +samsungtv: + - host: IP_ADDRESS + turn_on_action: + - service: wake_on_lan.send_magic_packet + data: + mac: "11:22:33:44:55:66" +``` + ### Supported models If your model is not on the list then give it a test, if everything works correctly then add it to the list on [GitHub](https://github.com/home-assistant/home-assistant.io/tree/current/source/_integrations/samsungtv.markdown). @@ -147,16 +156,14 @@ None of the 2014 (H) and 2015 (J) model series (e.g., J5200) will work, since Sa Changing channels can be done by calling the `media_player.play_media` service with the following payload: -```javascript -{ - "entity_id": "media_player.office_tv", - "media_content_id": "590", - "media_content_type": "channel" -} +```yaml +entity_id: media_player.samsung_tv +media_content_id: 590 +media_content_type: channel ``` #### Selecting a source -Source selection is not yet implemented. +It's possible to switch between the 2 sources `TV` and `HDMI`. ### Hass.io diff --git a/source/_integrations/ssdp.markdown b/source/_integrations/ssdp.markdown index dd7762bc89f..f677803e337 100644 --- a/source/_integrations/ssdp.markdown +++ b/source/_integrations/ssdp.markdown @@ -27,3 +27,4 @@ The following integrations are automatically discovered by the SSDP integration: - [deCONZ](../deconz/) - [Huawei LTE](../huawei_lte/) - [Philips Hue](../hue/) + - [Samsung TV](../samsungtv/)