I have tried many methods and searched and cannot find a way to set the state of a template sensor that I have set up. I have a garage door switch in ESP Home(below), that I would like to trigger setting the state of my template sensor temporarily(30 seconds) to ‘on’. Any suggestions on how I should approach this?
Thank you Tom. But for some strange reason, this does not work on the switch I have in ESPHome, it does however work with 2 other light switches I have set up. The only different is, the one that is NOT working, is set up in ESPHome and it also has a delay and then shuts off. The 2 commented out lines work fine. I put this template binary sensor in my configuration, do I need to have this in my ESPHome logic for the switch?
I was able to get this working inside of ESPHome by creating a binary sensor off of the GPIO12 pin that I was using as the relay. This sensor will be ‘on’ for 20 seconds after the relay is activated.