Hello,
I want to send multiple commands with the Broadlink IR
I am trying to use something like this:
galaxy_channel:
sequence:
- service: remote.send_command
target:
entity_id: remote.kitchen_remote_remote
data:
device: kitchen_tv_box
command: |
- b{{- states('input_number.galaxy')[0] | int -}}
{% if states('input_number.galaxy') | int >=10 -%}
- b{{ states('input_number.galaxy')[1] | int }}
{%- endif -%}
{% if states('input_number.galaxy') | int >=100 -%}
- b{{ states('input_number.galaxy')[2] | int }}
{%- endif -%}
{% if states('input_number.galaxy') | int >=1000 -%}
- b{{ states('input_number.galaxy')[3] | int }}
{%- endif -%}
But I got stuck with the right formatting. Can somebody help me? Thanks in advance.
Are you trying to use this template or “something like this”? What you have pasted does not seem to conform with anything from the Broadlink integration page
Please paste the actual code you are trying to use.
This is the actual code:
galaxy_channel:
sequence:
- service: remote.send_command
target:
entity_id: remote.kitchen_remote_remote
data:
device: kitchen_tv_box
command: |
- b{{ states('input_number.galaxy')[0] | int -}}
{% if states('input_number.galaxy') | int >=10 %}
- b{{ states('input_number.galaxy')[1] | int }}
{%- endif -%}
{% if states('input_number.galaxy') | int >=100 %}
- b{{ states('input_number.galaxy')[2] | int }}
{%- endif -%}
{% if states('input_number.galaxy') | int >=1000 -%}
- b{{ states('input_number.galaxy')[3] | int }}
{%- endif -%}
I’ve used different combinations of | > and -, but every time the error occurs.
I want to achieve this command:
galaxy_channel:
sequence:
- service: remote.send_command
target:
entity_id: remote.kitchen_remote_remote
data:
device: kitchen_tv_box
command:
- b6
- b2
- b0
But receiving the error “galaxy_channel: Error executing script. Unexpected error for call_service at pos 1: Command not found: ‘- b6\n- b2\n- b0’”
koying
(Chris B)
September 29, 2021, 7:13am
4
I don’t think it will work that way.
The template “resolution” is done by the service call, which then sends a string rather than a list to the actual service.
You can try to modify the “commands” template to return a “template” list, rather than a “yaml” list.