Text entry box on home screen for use in an automation

As a compromise with my better half, I need to try and get a text box on my home screen to disable some automations. Here is the scenario …

I have an automation that turns the target lights on with motion. I have a second automation that also monitors the motion, but starts a 5 minute timer. If it goes for 5 minutes without seeing motion, it turns the target lights back off again.

My wife does not like the lights coming on and off even though there is a 5 minute delay to any action, she does not like this and keeps disabling my automations and forgetting to turn them back on when she is done in the area. Sometimes she wants the lights permanently off and sometimes she wants them permanently on.

As a compromise, I’d like to set up a text box with an on off switch that will turn the lights either on and off and leave it that way for X number of minutes, then re-enable the automations as normal.

Any idea how to implement this?

Let your wife disable the lights automation and set an input_number (slider) called “disable time”, for how long.

Write another automation like this:

trigger:
  platform: state
  entity_id: automation.your_motion_light_automation_here
  state: 'off'
  for: 
    minutes: "{{ states('input_number.disable_time') }}"
action:
  service: homeassistant.turn_on
  entity_id: automation.your_motion_light_automation_here

Perhaps this might be of interest to you. It allows anyone to manually override a light’s motion-control feature (i.e. automatic on/off) by simply toggling the light switch. The toggling action serves as a signal to suppress the auto-off function. You can optionally restore the automatic behavior after a given period of time has elapsed.