Create virtual switch for events that are pressed on remote RFXCOM


I’ve capturedtwo events form an physical remote with the RFXCOM integration
The two events are both displayed in the always ON state.

For the On button it looks like its always ON modus

for the off button that i captured also, the ON state is active


On both when I press the ON button again, it fires the correct commands.

How can ik make a virtual switch in HA that captures if the remote is used? or when i use an automation to fire the ON command, but then displays de latest state ON or OFF on the dasboard.

Take a look at Template Switch:

can you help me a litte ahead with this template switch?

  - platform: template
        value_template: "{{ is_state('switch.remote1','on') }}"
          service: switch.turn_on
              entity_id: switch.remote1
          service: switch.turn_on
              entity_id: switch.remote2

Something like that.

You’ll probably need to create an automation though that will react to those 2 switches being turned on, because if remote1 is turned on, then you need to turn off remote2 and if remote2 is turned on you need to turn off remote1 - so that the switch will have the right state.

Also you should be aware that the switches that you posted pictures of, are not in the always on status - they are in the indeterminate status, where Home Assistant does not know if the switch is on or off - so it shows both.