HELP Combined switch from multiple sources

Hi, i have a RPI that control the relay to open gate

  - platform: remote_rpi_gpio
    host: 192.168.6.98
    ports:
        21: garaz
    invert_logic: true

And i have a security sytem that i read from the magnetic sensor if the gate is open or not (on,off)

binary_sensor.vrata_garaz_mag

How to combine a button switch so i can for example see if the gate is open in the same button.
Screenshot_115
Now the switch just go yellow for a second and go out,because it is bound to RPI and it just turn on and off. But i want to have yellow color all the time if the gate is open.
Thank you

Think the neatest way would be to combine the two in a template switch.

1 Like

Thank you!!!

I set it up,working perfectly!