The automation would look something like this:
- alias: 'door alarm'
trigger:
- platform: state
entity_id: binary_sensor.door
to: 'on'
condition:
condition: state
entity_id: switch.alarm
state: 'on'
action:
- service: switch.turn_on
entity_id: switch.siren
Your challenge is to extract the door’s status (binary_sensor.door
) from the single MQTT topic rfswitch/rf
that “currently receives all values”.
I suggest you review the following post where I described two ways to handle the case where a single MQTT topic contains information for different sensors:
Sonoff RF Bridge. Strategies for receiving data