SOLVED: How do I best use simple RF433 transmitter (single state)

I have a 433MHz bridge set up, and I have just gotten some simple 433 Wall transmitters that I want to toggle the lights.
As it doesn’t really have a state, only a signal,I was wondering if there is an easy way to just use that, instead of doing it like @DrZzs and create an automation that set’s it back to off?

So far I’ve tried doing this

binary_sensor:

  - platform: mqtt
    name: "Kontakt 2"
    state_topic: 'tele/rfbridge/RESULT'
    value_template: >-
      {% if value_json.RfReceived.Data == '123456' %}
        {{'ON'}}
      {% elif value_json == '123456off' %}
        {{'OFF'}}
      {% else %}
        {{states('binary_sensor.kontakt_1') | upper}}
      {% endif %}
    device_class: light

automation:

- id: '1560605'
  alias: Reset Kontakt 2
  trigger:
  - entity_id: binary_sensor.kontakt_2
    for: 00:00:01
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      payload: '''123456off'''
      qos: 1
      topic: tele/rfbridge/RESULT
    service: mqtt.publish

It works, but it seems a bit like overkill for such a simple thing.

- alias: 'toggle my_light'
  trigger:
    platform: mqtt
    topic: tele/rfbridge/RESULT
  condition:
    condition: template
    value_template: "{{ trigger.payload_json.RfReceived.Data == '123456' }}"
  action:
    service: light.toggle
    entity_id: light.my_light
1 Like

Ahh, so simple, very elegant, and not with a lof of silly automations for it :slight_smile:
Thankyou very much @123!