I already use successfully smartir for my AC and for my ceiling fans.
Now, i’m trying to setup my old LG TV.
this is what i have in my configuration.yaml
smartir:
update_branch: rc
media_player:
- platform: smartir
name: LG TV
unique_id: lg_tv
device_code: 1040
controller_data: remote.ur2_bedroom_remote
power_sensor: binary_sensor.tv_power
source_names:
HDMI1: Kodi
HDMI2: IPTV
and this is a vertical stack configuration, with just 6 buttons (on, off, Kodi, IPTV, Volumeup, Volumedown).
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:button-card
entity: media_player.lg_tv
color_type: card
color: rgb(255, 0, 0)
icon: mdi:television-classic
name: TV Off
size: 45%
styles: null
card:
- height: 70px
tap_action:
action: call-service
service: remote.send_command
service_data:
command: 'on'
device: remote.ur2_bedroom_remote
entity_id: remote.ur2_bedroom_remote
- type: custom:button-card
entity: light.test_light
color_type: card
color: rgb(255, 255, 0)
icon: mdi:kodi
name: KODI
size: 45%
styles: null
card:
- height: 70px
tap_action:
action: call-service
service: remote.send_command
service_data:
command: primo_fan_mid
device: remote.ur2_bedroom_remote
entity_id: remote.ur2_bedroom_remote
- type: custom:button-card
entity: media_player.lg_tv
color_type: card
color: rgb(0, 102, 255)
icon: mdi:volume-plus
name: Volume Up
size: 45%
styles: null
card:
- height: 70px
tap_action:
action: call-service
service: remote.send_command
service_data:
command: volumeDown
device: remote.ur2_bedroom_remote
entity_id: remote.ur2_bedroom_remote
- type: horizontal-stack
cards:
- type: custom:button-card
entity: media_player.lg_tv
color_type: card
color: rgb(255, 0, 0)
icon: mdi:television-classic-off
name: TV Off
size: 45%
styles: null
card:
- height: 70px
tap_action:
action: call-service
service: remote.send_command
service_data:
command: 'off'
device: remote.ur2_bedroom_remote
entity_id: remote.ur2_bedroom_remote
- type: custom:button-card
entity: light.test_light
color_type: card
color: rgb(255, 3, 255)
icon: mdi:basketball
name: IPTV
size: 45%
styles: null
card:
- height: 70px
tap_action:
action: call-service
service: remote.send_command
service_data:
command: primo_timer_4h
device: remote.ur2_bedroom_remote
entity_id: remote.ur2_bedroom_remote
- type: custom:button-card
entity: media_player.lg_tv
color_type: card
color: rgb(100, 202, 255)
icon: mdi:volume-minus
name: Volume Down
size: 45%
styles: null
card:
- height: 70px
tap_action:
action: call-service
service: remote.send_command
service_data:
command: volumeUp
device: remote.ur2_bedroom_remote
entity_id: remote.ur2_bedroom_remote
when i press the button, i get this error:
2022-07-28 19:57:47 ERROR (MainThread) [homeassistant.components.broadlink.remote] Failed to call remote.send_command: Command not found: 'on'
2022-07-28 19:57:47 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139675864070752] Command not found: 'on'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 145, in _extract_codes
codes = self._codes[device][cmd]
KeyError: 'on'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 193, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 680, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 930, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 717, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 222, in async_send_command
code_list = self._extract_codes(commands, subdevice)
File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 147, in _extract_codes
raise ValueError(f"Command not found: {repr(cmd)}") from err
ValueError: Command not found: 'on'
any help ?