Hey guys!
Just a quick share of my latest simple project I’ve created.
With this package, you will have this:
Sorry, the image is in portuguese, but the code is translated to english:
You can choose the device, if you have more than one, chose mode (send or learn key), chose key from 1-16 and send the command as a script.
Here is the full package file:
input_select:
rf_bridge_device_select:
name: 'Device'
initial: Select
options:
- "Select"
- "Device 1"
- "Device 2"
rf_bridge_mode_select:
name: 'Mode'
initial: Select
options:
- "Select"
- "Learn"
- "Send"
rf_bridge_key_select:
name: 'Key'
initial: Select
options:
- "Select"
- "01"
- "02"
- "03"
- "04"
- "05"
- "06"
- "07"
- "08"
- "09"
- "10"
- "11"
- "12"
- "13"
- "14"
- "15"
- "16"
script:
rf_bridge_send_command:
alias: 'Send command'
sequence:
- service: mqtt.publish
data_template:
topic: 'cmnd/{% if states.input_select.rf_bridge_device_select.state == "Device 1" %}rfbridgetopicdevice1{% elif states.input_select.rf_bridge_device_select.state == "Device 2" %}rfbridgetopicdevice2{% endif %}/backlog'
payload: 'rfkey{{ states("input_select.rf_bridge_key_select") }} {% if states.input_select.rf_bridge_mode_select.state == "Learn" %}2{% elif states.input_select.rf_bridge_mode_select.state == "Send" %}1{% endif %}'
- service: input_select.select_option
entity_id: input_select.rf_bridge_device_select
data_template:
option: "Select"
- service: input_select.select_option
entity_id: input_select.rf_bridge_mode_select
data_template:
option: "Select"
- service: input_select.select_option
entity_id: input_select.rf_bridge_key_select
data_template:
option: "Select"
group:
rf_bridge_controls:
control: hidden
entities:
- input_select.rf_bridge_device_select
- input_select.rf_bridge_mode_select
- input_select.rf_bridge_key_select
- script.rf_bridge_send_command
name: RF Bridge
view: false
homeassistant:
customize:
input_select.rf_bridge_device_select:
icon: mdi:access-point
input_select.rf_bridge_mode_select:
icon: mdi:swap-vertical
input_select.rf_bridge_key_select:
icon: mdi:format-list-numbers
script.rf_bridge_send_command:
icon: mdi:send
Hope it helps!