Motion activated light with override

Hi

I have been on a long journey trying to in essence create a wife approved motion sensor light switch with override.

One of the most basic automations everyone does is motion sensor lights. All very simple. But sometimes you want to override the pir and have it stay on when a switch has been physically flicked. I have tried 3 seperate methods and ended up using a state machine in node red.

But…

I just started using esphome. What an amazing piece of software. I realised you can have both a physical and virtual switch in the same code.

So my question (or see if you could help) how to make an esphome switch that combines with HA or Nodered that can disable the pir sensor when the physical switch has been switched?

And reactivated after a period of time after its switched off…

Not sure if someone has created this yet, I would be very interested.

Yes. A optimistic home assistant switch.
Check this for some ideas NodeMcu ws2812b effect on "on state"