Please follow the Community Questions Guideline #11 by properly formatting any shared code or configuration.
Beside the fact that they have '' in the id value, scripts don’t have triggers, so those Trigger conditions are not valid in 2 ways.
First things first, are you using the stock firmware on the IR Mate or is it flashed with custom firmware? Based on the entities used in the script, I would guess you are, but let us know otherwise. If you are unsure, take a screenshot of it’s device dashboard and we may be able to tell from the entities that are shown.
Before you get too deep into setting up scripts and automations for the device, you may want to consider flashing it with different firmware. The stock firmware is quite limited and does not include the ESPHome Infrared component which would allow the device to work as a proxy for HA.
There are a number of different ESPHome configs available for this device. The previously-linked HAIR integration has two available on its repo. If you want to get the most out of the device, I would highly recommend you use the full version of the firmware and install HAIR on you HA instance.
If you decide to stick with the stock firmware.
Please be specific. Are you asking about a dashboard button in HA or the device’s buttons (the device has a physical button as well as a capacitive sensor that acts like a button)? Based on the script, my guess would be a dashboard button, but let us know if that’s not the case. If it is a dashboard button, it would help us help you if you share the card configuration.
Dashboard cards that support multiple card actions like tap and hold can be pointed at a single script to produce different outcomes by passing values to the script. In the following version of your script I’ve used the variable type:
alias: TV Remote
description: ''
sequence:
choose:
- conditions:
- condition: template
id: "{{ type == 'tap' }}"
sequence:
- action: select.select_option
metadata: {}
target:
entity_id: select.xiao_smart_ir_mate_183f58_signal_select
data:
option: Signal3
- action: button.press
metadata: {}
target:
entity_id: button.xiao_smart_ir_mate_183f58_send
data: {}
- conditions:
- condition: template
id: "{{ type == 'hold' }}"
sequence:
- action: select.select_option
metadata: {}
target:
device_id: 2f84790a9fb2638dc34ce5bc02e409fa
data:
option: Signal4
- action: button.press
metadata: {}
target:
entity_id: button.xiao_smart_ir_mate_183f58_send
data: {}
An example Button card configuration would be as follows:
type: button
name: TV Remote
show_name: true
tap_action:
action: perform-action
perform_action: script.tv_remote
data:
type: tap
target: {}
hold_action:
action: perform-action
perform_action: script.tv_remote
data:
type: hold
target: {}