#Should I use a Template and How

1 messages · Page 1 of 1 (latest)

clear kernel
#

So I have a contact sensor automation on my front door (after sunset turn on dome light and front door light when open, off when closed, with delay), however as I'm sure you all know when I close the door and go out on the porch the light turns off. I'd like to use the switch to override this automation. I'm thinking I can use a switch template to turn off the automation when I press the physical switch, when the door closes again, the automation will turn back on. Am I on the right path, is there a better or easier way? Also struggling with switch templates, how do I set them up (I'm using the new GUI on 13.2), what is the value for (I don't understand the description underneath)?

Hope this the right place not trying to be a nuisance. I have searched for hours but I'm lacking in the terminology department, I believe.

Thank you in advance!

agile marlin
#

Hi @clear kernel,
May I suggest a better title is in order. like a 6 word problem summary kinda thing so people can easily see if they want to help you.

clear kernel
#

Should I use a Template and How

willow coral
#

I don't think a Template switch is what you are looking for in this situation.

Share your current automation so we can see what you have so far.

neat nicheBOT
#

@clear kernel Please use a code share site to share code or logs, for example:

Please don't use Pastebin, since it can randomly add spaces to the main view. Please also don't share text as images since it makes it harder for people to help you. Remember that others may have colour blindness, impaired vision, etc.

clear kernel
#

I started to work on the template, maybe this will help see where my brain was going and if its even possible?

#

I don't think power on behavior is correct in the if*

sleek sparrow
#

I would just create an input_helper toggle. Call it something like “porch light automation override”. Have an automation that toggles that input helper when the physical switch is pressed.

In your existing porch light automation, add a condition (in the “and if” section) that the state of the input helper must be “off”.

#

I find that turning automations on & off within other automations is typically a kludge. And what if you actually want to disable that automation? You have to remember which other automations might re-enable it

#

Also, this is unrelated to your question, but you may find this advice helpful. It will make it easier to troubleshoot and get help with your automations:
https://community.home-assistant.io/t/why-and-how-to-avoid-device-ids-in-automations-and-scripts/605517?u=mekaneck

clear kernel