Newby q: switch that triggers others switches as well as automations

Hey there,

hope someone can help a newby with this:

I try to create a "switch" that allows to override certain automations by turning them off prior to their scheduled start or when they already run as well as switching a physical entity.

In my case it's the beginning of my irrigation automation idea:

I need one "virtual switch" (no physical switch) to override my automations and switch off a plug.
I imagine something like a switch card "irrigation" on a dashboard.

  • frist press -> turn off (disable) related automations (e.g. because it rains or someone wants to mow the lawn) -> switch pumps off (entities for smart plugs), close all valves (entities for Sonoff SWV)
  • next press -> start pumps, restart irrigation automations -> automations will open valves according to their schedules and soil moisture sensors

I tried to build a scene but failed as well as trying to build a group helper. I missed the point where I can do all the needed actions in one thing...

Many thanks and best regards in advance!

Create an input boolean helper, which is basically a virtual switch. Name it something self explanatory like "Disable irrigation".

Add the above helper as a condition in all your irrigation automations. Condition should be that the switch is off.

Add the same helper to your dashboard so that you have a handy way to control it.

Job done. Now your automations will only run if your new switch is off.

Just to jump one step ahead, it can also be an option to do: House Modes.

The only difference is that instead of a simple On/Off switch you can have a set of options, I keep things pretty simple and I only have 4:

  • Off/Manual
  • Day
  • Night/Sleep
  • Away

Then in the conditions section of your automations you just check what "mode" the house is in, i.e.:

triggers:
   ...

conditions:
  - condition: state
    entity_id: input_select.house_mode
    state:
      - Day

actions:
   ...

I find that having an overall "mode" just keeps things a bit more organized, since I can have some automation run most of the time (Day mode) a few for night lights (Sleep) and a few that run when I am away - turn on the lights when I come home etc.


TL;DR - Use an input_select (with 3 or 4 options) instead of an input.boolean with only 2 choices.

The most basic "vitual switch" in HA is the Input Boolean Helper that ShadowFist mentioned.

As previously mentioned, using the helper as a general condition in all the automations will prevent them from running.

But, depending on the design of the automation, it may not be enough to stop one that is already running. This would mostly be a concern if the automations include repeat loops or waits. If you post your automations we can help you figure out how to incorporate the Helper into any conditional logic.

There are actions to enable and disable automations. But, in my opinion, disabling an automation should be reserved for when there is a serious issue with the automation or one of it’s related devices.
If you get in the habit of having automations enabling and disabling other automations what do you do when you really, absolutely need to disable one of them?

Triggers are based on events, if the event happened prior to the automation being "re-enabled" (whether through a change of the Helper or the actual automation being enabled) you will need to add a trigger to have it check if the conditions are correct for it to perform its normal duty. Again, you would need to share the automation for us to give more specific advise on any necessary changes.

1 Like

WOW thank you all very much for that tremendous input!

Especially because I use "pretty static" automations (start pump (device) at 8, wait for 5m, open valves (entities) xyz, wait 15m and stop/close valves) as well as more dynamic ones that do things like if soil moisture is below 30% and it doesn't rain dispense 1000 liters to that zone.
One idea is to restart the latter automation that was stopped let's say at 465 ltr and continue until 1000 ltr is reached (there is a matching ent. for daily irrigation vol.).

I WILL NEED SOME TIME AND FOR SURE GET BACK HERE.

VBR Holger