Hello,
I’ve capturedtwo events form an physical remote with the RFXCOM integration
The two events are both displayed in the always ON state.
![image](https://community-assets.home-assistant.io/original/4X/a/4/6/a464b1c2a296114d27dcb5073c63cc33b21dd453.png)
For the On button it looks like its always ON modus
for the off button that i captured also, the ON state is active
![image](https://community-assets.home-assistant.io/original/4X/6/1/1/6114207dfc1fb23f838e560792fa2a06d6eed96b.png)
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?
switch:
- platform: template
switches:
my_remote_switch:
value_template: "{{ is_state('switch.remote1','on') }}"
turn_on:
service: switch.turn_on
target:
entity_id: switch.remote1
turn_off:
service: switch.turn_on
target:
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.