All Projects → sermayoral → ha-samsungtv-encrypted

sermayoral / ha-samsungtv-encrypted

Licence: Apache-2.0 license
Samsung TV Encrypted Models (H & J Series) custom component for Home Assistant

Projects that are alternatives of or similar to ha-samsungtv-encrypted

balboa homeassistan
Balboa spa integration for home-assistant
Stars: ✭ 21 (-36.36%)
Mutual labels:  home-assistant-custom
lovelace-rpi-monitor-card
A Raspberry Pi status display Card for Home Assistant Lovelace
Stars: ✭ 102 (+209.09%)
Mutual labels:  home-assistant-custom
midea-ac-py
This is a library to allow communicating to a Midea appliance via the Midea cloud.
Stars: ✭ 72 (+118.18%)
Mutual labels:  home-assistant-custom
tv-card
📺 TV Remote Card
Stars: ✭ 139 (+321.21%)
Mutual labels:  home-assistant-custom
light-card
Lovelace light-card for home assistant
Stars: ✭ 18 (-45.45%)
Mutual labels:  home-assistant-custom
homeassistant ecowitt
Ecowitt Weather Station integration for homeassistant
Stars: ✭ 90 (+172.73%)
Mutual labels:  home-assistant-custom
home assistant tractive
Custom component for Tractive
Stars: ✭ 34 (+3.03%)
Mutual labels:  home-assistant-custom
ha-multiscrape
Home Assistant custom component for scraping (html, xml or json) multiple values (from a single HTTP request) with a separate sensor/attribute for each value. Support for (login) form-submit functionality.
Stars: ✭ 103 (+212.12%)
Mutual labels:  home-assistant-custom
home-assistant-custom-components
🏡 Custom components for Home-Assistant
Stars: ✭ 27 (-18.18%)
Mutual labels:  home-assistant-custom
ZWaveGraphHA
Z-Wave Graph for Home Assistant
Stars: ✭ 73 (+121.21%)
Mutual labels:  home-assistant-custom

hacs_badge

HomeAssistant - SamsungTV Encrypted Component

This is a custom component to allow control of Encrypted SamsungTV devices in HomeAssistant. This should work on H and J 2014/2015 models (according to PySmartCrypto specs). Is a modified version of the built-in samsungtv, with some extra features.

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

1. Easy Mode

We support HACS. Go to "STORE", search "SamsungTV Encrypted" and install.

2. Manual

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

  1. Download custom_components folder.

  2. Copy the samsungtv_encrypted 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_encrypted
            └── __init__.py
            └── media_player.py
            └── manifest.json
            └── get_token.py
            └── PySmartCrypto
                └── pysmartcrypto.py
    

Configuration

  1. Use get_token.py to get your Samsung TV token (use --port 8080). Store TOKEN (CTX) and SESSION_ID output. Your TV must be turned on and connected to Internet with the specific IP. Terminal where you have executed get_token.py will ask for a PIN, that will be showed in your TV screen.
    Note: In some models the TOKEN can expire after a time (maybe a week, month), or even the TOKEN can be invalidated due to a loss of TV power. In that case you have to repeat this process again.

  2. Enable the component by editing the configuration.yaml file (within the config directory as well). Edit it by adding the following lines:

    Example configuration.yaml

    media_player:
      - platform: samsungtv_encrypted
        host: IP_ADDRESS
        token: TOKEN
        sessionid: SESSION_ID
        port: 8080
    

    Note: This is the same as the configuration for the built-in Samsung Smart TV component, except for the custom variables.

    Custom variables

    • token: (string) (Required) This contains the token of your encrypted TV (got in step 1)

    • sessionid: (string) (Required) This contains the sessionid of your encrypted TV (got in step 1)

    • key_power_off: (string) (Optional) Some TV models use an encrypted command to turn off the TV different from the command that we use by default. If this is your case, try using other encrypted commands, like 'KEY_POWER' here.
      Default value: 'KEY_POWEROFF'

    • turn_on_action: (script) (Optional) Script formatted command to turn on the TV. Example:

      - platform: samsungtv_encrypted
        ...
        turn_on_action:
          - service: kodi.call_method
            data:
              entity_id: media_player.kodi
              method: Addons.ExecuteAddon
              addonid: script.json-cec
              params:
                command: turn_on 0
      
    • turn_off_action: (script) (Optional) Script formatted command to turn off the TV. Example:

      - platform: samsungtv_encrypted
        ...
        turn_off_action:
          - service: switch.turn_on
            target:
              entity_id: switch.samsung_tv_power
      

  3. Reboot Home Assistant

  4. Congrats! You're all set!

Additional Features

1. Send Keys

Send keys using a native Home Assistant service:

service: media_player.play_media
{
  "entity_id": "media_player.samsungtv",
  "media_content_type": "send_key",
  "media_content_id": "KEY_CODE"
}

Note: Change "KEY_CODE" by desired key_code.

You can get lots of key codes here

Here you can see an example of a Home Assistant script using the media_player.play_media service:

tv_channel_down:
  alias: Channel down
  sequence:
  - service: media_player.play_media
    data:
      entity_id: media_player.samsung_tv55
      media_content_type: "send_key"
      media_content_id: KEY_CHDOWN

Working Models

  • H4500
  • H5500
  • H6200
  • H6400
  • HU7100
  • HU7500
  • HU8500
  • HU8550
  • J6350

Not Working Models

  • J8000

Contribution

Feel free to contribute with other working models and to submit fixes and improvements to the code.

If you like this custom component and it is useful for you, please consider supporting me:

Buy Me A Coffee

Donate with PayPal

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].