Good day
(Newbie here.)
I am trying to create a garage open button. What it currently does/ what I have:
a Button to open and close a garage door. It is a momentary switch (sonoff) and when I configure it, it flashes on, but always returns to the off-state.
I also have a second device (ESPHOME) that monitors the open/closed position of the door.
What I would like to have:
a Button that displays the state of the 2nd device.
When pressed, it calls the button in the 1st device, but still displays the state of the 2nd device.
After much writing and looking I wrote the following code. It is a button opening and closing my garage (inching) and then it changes the ICON, BACKGROUND and ICON COLOR depending on the state of two sensors (those window read switches you use on alarm systems).