Hi,
I configured an OpenMQTTGateway to handle RF2 codes of my remote
My remote ( flamingo sf-501) has 4 rows of 2 buttons (and one “master” row with 2 buttons):
When I press a button, following information in coming in
{"unit":2,"groupBit":0,"period":267,"address":52166656,"switchType":1}
- address: the ID of my remote (I have multiple remotes, they all have different ID’s)
- unit: number from 1-4, depending on the button I pressed
- switchType: 1 = on, 0 = off
I managed to create a simple automation:
- id: omg_rf2tomqtt_52166656_1_1
alias: omg_rf2tomqtt_52166656_1_1
trigger:
- platform: mqtt
topic: "home/OpenMQTTGateway_ESP8266_RF2/RF2toMQTT"
payload: "52166656"
value_template: "{{ value_json.address }}"
condition:
condition: template
value_template: "{{ trigger.payload_json['unit'] == 2 }}"
action:
- data:
entity_id: light.my_n00_p01_light_l23_marokko
transition: 0
service_template:
homeassistant.turn_on
Now my question is: what’s the best way to handle multiple conditions and actions:
I need an automation that does something like
case address == 52166656 AND unit == 1 AND switchType == 1
turn on light A
case address == 52166656 AND unit == 1 AND switchType == 0
turn off light A
case address == 52166656 AND unit == 2 AND switchType == 1
turn on light B
case address == 52166656 AND unit == 2 AND switchType == 0
turn off light B
etc…
What’s the best way to implement this?
Do I need multiple automations? Multiple conditions?
Can anybody point me to a simple example for this case?
kind regards,
Bart