Hi I created my first print for RFXTRX
+ Nexa remote
Picture below contains the remote
blueprint:
name: Nexa Remote
description: Blueprint for Nexa PET-910
domain: automation
author: Peter Andersson
input:
remote_id:
name: Remote id
description: To get the remote id, go to "Developer tools" -> "Events" event to subscribe to "rfxtrx_event" then press listen and push a button on your remote, you find the remote id under id_string (remove : and the number after it). Example "1599e6a"
selector:
text:
all_off_action:
name: All off action
description: Action when all off is pressed
default: []
selector:
action:
1_on_action:
name: 1 on action
description: Action when 1 on is pressed
default: []
selector:
action:
1_off_action:
name: 1 off action
description: Action when 1 off is pressed
default: []
selector:
action:
2_on_action:
name: 2 on action
description: Action when 2 on is pressed
default: []
selector:
action:
2_off_action:
name: 2 off action
description: Action when 2 off is pressed
default: []
selector:
action:
3_on_action:
name: 3 on action
description: Action when 3 on is pressed
default: []
selector:
action:
3_off_action:
name: 3 off action
description: Action when 3 off is pressed
default: []
selector:
action:
variables:
remote_id: !input remote_id
all_off_action: !input all_off_action
1_on_action: !input 1_on_action
1_off_action: !input 1_off_action
2_on_action: !input 2_on_action
2_off_action: !input 2_off_action
3_on_action: !input 3_on_action
3_off_action: !input 3_off_action
trigger:
- platform: event
event_type: rfxtrx_event
condition:
- condition: template
value_template: "{{ trigger.event.data.id_string.startswith( remote_id + ':') }}"
mode: restart
max_exceeded: silent
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.event.data['values'].Command == 'Group off' }}"
sequence: !input all_off_action
- conditions:
- condition: template
value_template: "{{ trigger.event.data.id_string.endswith(':1') and trigger.event.data['values'].Command == 'On' }}"
sequence: !input 1_on_action
- conditions:
- condition: template
value_template: "{{ trigger.event.data.id_string.endswith(':1') and trigger.event.data['values'].Command == 'Off' }}"
sequence: !input 1_off_action
- conditions:
- condition: template
value_template: "{{ trigger.event.data.id_string.endswith(':2') and trigger.event.data['values'].Command == 'On' }}"
sequence: !input 2_on_action
- conditions:
- condition: template
value_template: "{{ trigger.event.data.id_string.endswith(':2') and trigger.event.data['values'].Command == 'Off' }}"
sequence: !input 2_off_action
- conditions:
- condition: template
value_template: "{{ trigger.event.data.id_string.endswith(':3') and trigger.event.data['values'].Command == 'On' }}"
sequence: !input 3_on_action
- conditions:
- condition: template
value_template: "{{ trigger.event.data.id_string.endswith(':3') and trigger.event.data['values'].Command == 'Off' }}"
sequence: !input 3_off_action
Example usage:
alias: Vardagsrum fjärrkontroll
description: ""
use_blueprint:
path: AnderssonPeter/nexa_remote.yaml
input:
remote_id: 15b0266
all_off_action:
- service: light.turn_off
data: {}
target:
entity_id:
- light.living_room_display_cabinet
- light.living_room_ceiling_1
- light.living_room_ceiling_2
- light.living_room_towards_neighbor_1
- light.living_room_towards_neighbor_2
- light.living_room_towards_garden
- light.living_room_towards_cottage
1_on_action:
- service: light.turn_on
data: {}
target:
entity_id:
- light.living_room_display_cabinet
- light.living_room_towards_neighbor_1
- light.living_room_towards_neighbor_2
- light.living_room_towards_garden
- light.living_room_towards_cottage
1_off_action:
- service: light.turn_off
data: {}
target:
entity_id:
- light.living_room_display_cabinet
- light.living_room_towards_neighbor_1
- light.living_room_towards_neighbor_2
- light.living_room_towards_garden
- light.living_room_towards_cottage
2_on_action:
- service: light.turn_on
data: {}
target:
entity_id:
- light.living_room_towards_neighbor_1
- light.living_room_towards_neighbor_2
2_off_action:
- service: light.turn_off
data: {}
target:
entity_id:
- light.living_room_towards_neighbor_1
- light.living_room_towards_neighbor_2
3_on_action:
- service: light.turn_on
data: {}
target:
entity_id:
- light.living_room_ceiling_1
- light.living_room_ceiling_2
3_off_action:
- service: light.turn_off
data: {}
target:
entity_id:
- light.living_room_ceiling_1
- light.living_room_ceiling_2
Hope this helps someone