HA to RF 433 gateway and how to set up binary_sensors to work with RF payloads

Hi

I’ve made @scote solution and it works fine.
However, how can I link state of this sensor with switch, but without making automation?

What exactly do you want to do ?

Well, this is easy I would say.
Sensor 1 goes to ON state. To activate Sensor 2 I need to use automation, which is not my goal.
I would like to know if there is a way to “link” sensor 1 with sensor 2, so if sensor 1 goes to ON then sensor 2 also goes to ON.
I don’t know if “template” can solve it as this would be binary sensor and sensor. Besides, I don’t know how to define it.

PIR Sensor

- platform: mqtt
  state_topic: "tele/RF_Bridge/RESULT"
  name: 'RF Infrared 1'
  value_template: '{{value_json.RfReceived.Data}}'
  payload_on: 'ECFCCE'
#  payload_off: 'ECFCCEoff'
  device_class: motion
  off_delay: 60

normal sonoff tasmota

 - platform: mqtt
    name: "Sonoff 165"
    command_topic: "cmnd/sonoff165/power"
    state_topic: "stat/sonoff165/POWER"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: false

So if I understand well, you want Sensor 2 to be a copy of Sensor 1 ?

  - platform: template
    sensors:
      copy_of_sensor1:
        friendly_name: "Sensor 2"
        value_template: >-
            {% if is_state('binary_sensor.rf_infrared_1', 'on') %}
              on
            {% else %}
              off
            {% endif %}       
1 Like

Super, thank you! I will check this :slight_smile: I need to learn this as well…

or simply

  - platform: template
    sensors:
      copy_of_sensor1:
        friendly_name: "Sensor 2"
        value_template: "{{ states('binary_sensor.rf_infrared_1') }}"
1 Like