Push Button 433Mhz Wall Mount Switch

Hi,

I bought a 3 push button 433 MHz switch. Is it possible to configure an automation that when the button is pressed it does the opposite of what the current state is. So for example if i have a light on if i press the button the automation should switch it off. On the other hand if the light is off it should switch it on.

Any ideas on where to start please ?

Regards,
Etienne

Any ideas ??

HomeAssistant.toggle

Hi,

i made the following but it doesn’t seem to work :frowning:

  • alias: Toggle On Kitchen SW 1
    trigger:
    platform: state
    entity_id: binary_sensor.kitchen_sw1
    condition:
    condition: state
    entity_id: light.living_room_curtain
    state: ‘off’
    action:

    • service: homeassistant.turn_off
      entity_id: binary_sensor.kitchen_sw1
    • service: light.turn_on
      entity_id: light.living_room_curtain
  • alias: Toggle Off Kitchen SW 1
    trigger:
    platform: state
    entity_id: binary_sensor.kitchen_sw1
    condition:
    condition: state
    entity_id: light.living_room_curtain
    state: ‘on’
    action:

    • service: homeassistant.turn_off
      entity_id: binary_sensor.kitchen_sw1
    • service: light.turn_off
      entity_id: light.living_room_curtain

Any ideas ?

Hi All,

Basically i managed to gain some ground but i’m still stuck. Basically the 433Mhz remote is using MQTT and it only sends 1 value. So there is no Payload on and Payload off. The issue that i have is that I manage to toggle the switch once but then obviously there is not state change as its checking the state. how can i trigger not based on the state but based on data that i receive.

This is the config.yaml

- platform: mqtt
  state_topic: "RF_Bridge/tele/RESULT"
  name: 'Kitchen SW1'
  value_template: '{{value_json.RfReceived.Data}}'
  payload_on: '80C551'
  qos: 1

This is the automation.yaml

  • alias: Toggle On Kitchen SW 1
    trigger:
    platform: state
    entity_id: binary_sensor.kitchen_sw1
    action:
    • service: homeassistant.toggle
      entity_id: light.living_room_curtain

any ideas please ?

Regards,
Etienne

I actually just did this with a cheap 433mhz button yesterday. That was the ah-ha moment for me - this is a button, not a switch. The logic may be a bit clunky, but it works.

  1. I created a template binary sensor that uses the single MQTT payload as the payload_on. Define the payload_off as something else - I just used the 6 digit key and added “off” to the end of it.

  2. Created an automation that waits a half second and turns the binary sensor back to off by sending an MQTT payload with the payload_off that was defined in step 1.

  3. Created another automation that calls the homeassistant.toggle service for the lights I want to flip when the binary sensor goes from off to on.

So every time you push the button and an MQTT payload is created (in my case by a tasmota based sonoff RF bridge), HA sees that and flips the binary sensor to on, which then HA interprets as the time to toggle the light. HA also publishes an MQTT payload to turn the binary sensor to off. I’m sure there is a more elegant way to do it, but this seems to work.

Hope that helps. Good luck.

1 Like