Modes vs scenes

Reading Time: 3 minutes

In a previous post about SmartThings I mentioned that one of the things I found useful was to have the house in a “mode”. Home Assistant doesn’t really support this idea. It has “scenes” but these aren’t the same. You can have scenes in Home Assistant, for example, “Movie night” and “Normal”. As a very simple example, you run the “Movie night” scene. It turns the TV on and dims the lights in the lounge. You run the “Normal” scene and it turns the TV off and brings the lights up again.

House modes

The limitation is that scenes aren’t “states”. It’s like a momentary switch that sends a command to tell lots of devices to do something. This might be fine. But once you run a scene, Home Assistant has no record of it. You can’t run a test to see which scene is active.

The best way to think of this is to think about some of your automations. When do you want them to run and when might you want them to not run.

In my case, I’ve kept it quite simple with Day, Evening and Night. Take the bedroom, for example. In the evening, I want the lights to come on when movement is detected in the room. I don’t want that to happen at night when I turn over in bed or if my other half gets up to the loo.

To do this, I use Home Assistant Helpers. There are lots of these but for this I just use the input_boolean toggle. This is just a virtual switch that can either be on or off.

Input boolean helper

They do nothing until you start using them in automations. in Node-RED, I have one flow that looks like this:

Mode switcher

This uses a light sensor in the lounge.

If that drops below a certain level AND it’s after a certain time AND the house is currently in day mode then it toggles the day mode input_boolean to off, evening to on and night (just for completeness) off. The time check is just so that it doesn’t flip between day and evening if it gets a bit cloudy in the mornings.

If the light goes above a certain level AND it’s night then it turns day mode on and the others off.

I’ve also got a check in there for evening at the bottom. What I was finding was that it would be really cloudy in the afternoon. The house would go into evening mode, then the sun would come out and all the lights would be on. I added this in so that the house can go back into day mode when this happens.

I could do the whole lot with the lux sensor but this gives a degree of stability. It’s not 100% perfect but it does seem to work well in good old England where it can be like mid winter at 3.00pm and then mid summer by 3.30pm, regardless of the time of year and the position of the sun.

Notice that this doesn’t control any devices. What it does is allow me to build automations and decide when I want them run. So, most of my automations look at what mode the house is in before they run.

Night mode is the trickiest. I want that to come on when we go to bed. Not at 10.00pm or 11.00pm. I want that to happen exactly when we go to bed. This happens in one of three ways:

  • Voice – “Alexa. Night night”
  • Phone – When I put my phone into “Do not disturb” mode which is generally the last thing I do before I go to sleep
  • NFC – I have an NFC tag on my bedside cabinet. Tapping that with my phone toggles the night switch on and the others off

Personally, I think this good practice. If you do this from the start then it’s rare that you’ll get surprised, either by a light coming on when you don’t want it to or by a light coming on at a brightness you weren’t expecting.