Skip to content

Latest commit

 

History

History
322 lines (274 loc) · 18.7 KB

MEDIA_PLAYER.md

File metadata and controls

322 lines (274 loc) · 18.7 KB

SmartIR Media Player

For this platform to work, we need a .json file containing all the necessary IR commands. Find your device's brand code here and add the number in the device_code field. If your device is not working, you will need to learn your own codes and place the .json file in smartir/custom_codes/media_player/ subfolders. Please note that the device_code field only accepts positive numbers. The .json extension is not required.

Configuration variables:

Name Type Default Description
name string optional The name of the device
unique_id string optional An ID that uniquely identifies this device. If two devices have the same unique ID, Home Assistant will raise an exception.
device_code number required (Accepts only positive numbers)
controller_data string required The data required for the controller to function. Enter the entity_id of the Broadlink remote (must be an already configured device), or the entity id of the Xiaomi IR controller, or the MQTT topic on which to send commands, or the ZHA zigbee cluster to send commands to.
delay number optional Adjusts the delay in seconds between multiple commands. The default is 0.5
power_sensor string optional entity_id for a sensor that monitors whether your device is actually on or off. This may be a power monitor sensor. (Accepts only on/off states)
power_sensor_delay int optional Maximum delay in second in which power sensor is able to report back to HA changed state of the device, default is 10 seconds. If sensor reaction time is longer extend this time, otherwise you might get unwanted changes in the device state.
power_sensor_restore_state boolean optional If true than in case power sensor will report to HA that device is on without HA actually switching it on (device was switched on by remote, of device cycled, etc.), than HA will report last assumed state and attributes at the time when the device was on managed by HA. If set to false when device will be reported as on by the power sensors all device attributes will be reported as UNKNOWN. Default is true.
source_names dict optional Override the names of sources as displayed in HomeAssistant (see below)

Example (using broadlink controller):

Add a Broadlink RM device named "Bedroom" via config flow (read the docs).

media_player:
  - platform: smartir
    name: Living room TV
    unique_id: living_room_tv
    device_code: 1000
    controller_data: remote.bedroom_remote
    power_sensor: binary_sensor.tv_power

Example (using xiaomi controller):

remote:
  - platform: xiaomi_miio
    host: 192.168.10.10
    token: YOUR_TOKEN
    
media_player:
  - platform: smartir
    name: Living room TV
    unique_id: living_room_tv
    device_code: 2000
    controller_data: remote.xiaomi_miio_192_168_10_10
    power_sensor: binary_sensor.tv_power

Example (using mqtt/Z06/UFO-R11 controller):

media_player:
  - platform: smartir
    name: Living room TV
    unique_id: living_room_tv
    device_code: 3000
    controller_data: home-assistant/living-room-tv/command
    power_sensor: binary_sensor.tv_power

Example (using LOOKin controller):

media_player:
  - platform: smartir
    name: Living room TV
    unique_id: living_room_tv
    device_code: 4000
    controller_data: 192.168.10.10
    power_sensor: binary_sensor.tv_power

Example (using ESPHome):

ESPHome configuration example:

esphome:
  name: my_espir
  platform: ESP8266
  board: esp01_1m

api:
  services:
    - service: send_raw_command
      variables:
        command: int[]
      then:
        - remote_transmitter.transmit_raw:
            code: !lambda 'return command;'

remote_transmitter:
  pin: GPIO14
  carrier_duty_percent: 50%

HA configuration.yaml:

media_player:
  - platform: smartir
    name: Living room TV
    unique_id: living_room_tv
    device_code: 2000
    controller_data: my_espir_send_raw_command
    power_sensor: binary_sensor.tv_power

Example (using ZHA controller and a TuYa ZS06):

media_player:
  - platform: smartir
    name: Living room TV
    unique_id: living_room_tv
    device_code: 5000
    controller_data: '{
     "ieee":"XX:XX:XX:XX:XX:XX:XX:XX",
     "endpoint_id": 1,
     "cluster_id": 57348,
     "cluster_type": "in",
     "command": 2,
     "command_type": "server"
    }'
    power_sensor: binary_sensor.tv_power

Overriding Source Names

Source names in device files are usually set to the name that the media player uses. These often aren't very descriptive, so you can override these names in the configuration file. You can also remove a source by setting its name to null.

media_player:
  - platform: smartir
    name: Living room TV
    unique_id: living_room_tv
    device_code: 1000
    controller_data: 192.168.10.10
    source_names:
      HDMI1: DVD Player
      HDMI2: Xbox
      VGA: null

Changing channels

Most IR remotes can only send one key at a time (0 to 9) to change your TV channel, changing to other channels requires pressing 2 consecutive keys. SmartIR handles any channel for you with the standard Home Assistant service interface. Here is an example that changes your Kitchen TV to channel 51:

service: media_player.play_media
target:
  entity_id: media_player.kitchen_tv
data:
  media_content_id: 51
  media_content_type: "channel"

Available codes for TV devices:

The following are the code files created by the amazing people in the community. Before you start creating your own code file, try if one of them works for your device. Please open an issue if your device is working and not included in the supported models. Contributing to your own code files is welcome. However, we do not accept incomplete files as well as files related to MQTT controllers.

Philips

Code Supported Models Controller
1000 26PFL560H Broadlink
1001 42PFL3007H/60
37PF9641D/10
Broadlink

Sony

Code Supported Models Controller
1020 KDL-46HX800 Broadlink

LG

Code Supported Models Controller
1040 22MT47DC Broadlink
1041 LH6235D Broadlink
1042 43UM7510PSB
OLED55B8SSC
OLED55B9PLA
Broadlink
1043 32LC2R Broadlink

Samsung

Code Supported Models Controller
1060 UE40F6500
LE40D550
UE40H6400
UE40H7000SL
Broadlink
1061 UE40C6000
UE40D6500
UE32H5500
UE22D5000
Broadlink
1062 UE40C6000
UE40D6500
UE32H5500
UE22D5000
UN46D6000SF
Broadlink
1063 UN55JU7500 Broadlink
1064 QE49Q7FAM Broadlink
1065 QE65Q67RAUXRU Broadlink
7060 UA32EH5000M ESPHome

Insignia

Code Supported Models Controller
1080 NS-42D510NA15 Broadlink

Toshiba

Code Supported Models Controller
1100 42C3530D Broadlink

Yamaha

Code Supported Models Controller
1120 Unknown Broadlink
1121 Yamaha RX-V375 and others (RAV463/ZA113500 remote) Broadlink
1122 VR50590 remote Broadlink
1123 AS201 Broadlink

RME

Code Supported Models Controller
1140 ADI-2 DAC FS Broadlink

Logitech

Code Supported Models Controller
1160 Z906 Broadlink
1161 Z-5500 Broadlink
1162 Z-5450 Broadlink

TCL

Code Supported Models Controller
1180 55EP640 Broadlink
1181 43S6500FS
32A325
Broadlink

Pace

Code Supported Models Controller
1200 TDS850NNZ
TDC850NF
Broadlink

Silver

Code Supported Models Controller
1220 MEO Broadlink

TurboX

Code Supported Models Controller
1240 TXV-2420 Broadlink

Thomson

Code Supported Models Controller
1260 40FA3203 Broadlink

Grunding

Code Supported Models Controller
1280 GSB-810 Broadlink

OKI

Code Supported Models Controller
1300 V19B-LED4 Broadlink

Sky

Code Supported Models Controller
1320 SkyQ Black
SkyQ Mini
Broadlink

Bauhn

Code Supported Models Controller
1340 Aldi Broadlink

Optoma

Code Supported Models Controller
1360 HD27 Broadlink

Xiaomi

Code Supported Models Controller
1380 MiBox
MItv
Broadlink

Pioneer

Code Supported Models Controller
1400 X-CM56 Broadlink

JBL

Code Supported Models Controller
1420 Cinema SB160 Broadlink

Andersson

Code Supported Models Controller
1440 L4223FDC PVR Broadlink

Edifier

Code Supported Models Controller
1460 R1280DB Broadlink
1461 R2000DB Broadlink

ZTE

Code Supported Models Controller
7460 B860H ESPHome

Kanto

Code Supported Models Controller
1480 YU6 Broadlink

Onkyo

Code Supported Models Controller
1500 TX-SR508, TX-SR700 Broadlink

JVC

Code Supported Models Controller
1520 RX-5022R Broadlink

Epson

Code Supported Models Controller
1540 MG-850HD Broadlink

Cambridge Audio

Code Supported Models Controller
1560 AXR100 Broadlink

Dialog

Code Supported Models Controller
1580 J-103BF Broadlink