Homey Community Forum

Switching your house on and off

Dear readers,

I have been using Homey since February 2020 and have been building more and more flows and buying more and more smart stuff ever since. Recently I came to a point that I am searching for ‘nice Homey flows’ on Google to get more inspiration on ‘what’s next?’. This inspired me to write down some flows for fellow Homey users, maybe you find them usefull! I hope soo :slight_smile:.

First; sorry for my English. I think you’ll understand what i’m saying, but you might find a lot of typo’s along the story. If you need any more explanation feel free to ask!

House switch explanation
In this topic I am going to explain how I switch my entire home on and off. The idea is that my devices are all turned off and using as less power as possible when we’re not home or sleeping. When the house is switched on, all the lights will respond to my flows and the curtain blinds will go up and down. I use a virtual modus to take care of the flows.

What do you need for this functionality?
The following devices are necessary to complete this tutorial. Maybe there are parts you wish to use for your own, but I write my posts as if you’re going to copy it exactly! :smiley:

  1. A Homey (ofcourse :slight_smile:)
  2. A motion detector
  3. The ‘Virtuele Apparaten’ app on Homey by Arjan Kranenburg
  4. Switch on the ‘Location’ functionality in the Homey settings
  5. A virtual button

For the motion detector I use the ’ Xiaomi Mijia Human Body Sensor’. I bought this sensor when I started using Homey in March 2020 and have been using them ever since. I have three, one in every room I needed a sensor in. The only downside of these sensors is that they do not reactive their timers when you keep walking through their sight. This might give a short flash of the lights when the timer is over and you’re still waking there, soo it reactivates. But they’re cheap and have a great battery life and are reliable. There might be better options, but I can assure you that they won’t disappoint you for this price range.

I am not sure if the app I provided is available in multiple languages, but it’s pretty straight forward soo there is no need to understand Dutch for it. Once installed, add a new device, choose ‘Modus’ as option, give the modus a name (for example, mine is simply ‘Huis’ or ‘House’ in English) and add an icon. Since i’ve been using a lot of different modus buttons I have been downloading icons from the FontAwesome library in order to give everything a nice looking button. For example, I used the icon in the link below. Once you’re on this page find the download button that’s located right underneath the title of the icon. This will download a .SVG icon that the app in Homey can use. You get the icon upload functionality when you’re installing a modus. You could ofcourse also just use the built in icons but I found myself using the same icons over and over again since there are not many to choose from.

For the virtual button I bought the ‘Xiaomi smart wireless switch’. This switch is cheap and works great! Nothing more to say here…

Optional; this is what we’re going to embed
The following items are not needed to create this house switch, but this is what I embedded in my flows. Be creative and add anything you like, or just copy my way of handling devices.

  1. My Ikea lights and Ikea smart switches all around the house
  2. My Yeelight color bulbs in the front and back hallway
  3. My Roborock S7 and Neato D6 vacuum cleaners
  4. My curtain motor working with Tuya
  5. The IFTT app and a account
  6. The Soundboard app by Athom
  7. A Google Home device of any kind

I will explain more about these products i’ve been using in other flow explanations. Remember, these products are optional… They are written down here to give you a idea what I am embedding in my house switch.

The flows of this switch
Oké soo the main idea about this is that the house will automatically turn on and off using flows, but it’s also possible to turn the switch with let’s say Google home and the Homey app.

First, make sure you’ve created the virtual device as explained above.

The first flow: Activating when theres movement
In the flow below we’re going to activate the house when there is movement and somebody is home.

We’re living next to a main road in our city and we often use these roads around our house without really going home. Soo I was struggling with activating the house only when we were really heading home after work. I did this building the following flow.

If Once the entire ground floor got active
And Nobody is sleeping, somebody is at home and the house is currently turned off
Then Turn on the house and turn off the alarm system (alarm explained in another tutorial)

The fact that I am using the ground floor as zone only takes care of unwanted visitors using the windows on the first floor, even when i’m close to my home. The sensors on the ground floor are placed in both hallways, the expected place to enter our home when you’re entering.

The ‘and nobody is sleeping’ takes care of the fact that the entire house will switch on when my wife is going to the bathroom in the middle of the night.

The ‘and somebody is home’ makes sure that the house may be turned on, this prevents switching when we’re not even close to our home and we’ve got an unwanted visitor. Ofcourse there is a small chance that we’re within 100 meters of our home and we’ve got company we do not want (let’s say; we’re at the neighbours) but that’s a thing we simply accept.

I have specifically added the ‘and house is turned off’ card to this flow. In some cases I trigger this flow in other flows and adding this flow card makes sure that everything is left alone when the home is already turned on. This prevents loops in the flows.

The second flow: switching off the house when leaving
Soo the best situation will be that we do not need to think about turning off the lights, television, close the main roller blind in the living room etcetera. This is were the homey location service comes in handy. We are living in a family of tree; my wife, my four years old daughter and myself. I installed to Homey app on both my wifes and my phone to make sure we are both interacting in the location management.

If The last person left the house
And The guest modus is turned off (explained in another tutorial)
Then Turn off the house and turn on the alarm system

Homeys own location management is using a radius of about 100 meters near your home, once you’re out of this radius the flow card will trigger. This works great and i’ve been using it ever since I started building flows, without any problems.

I installed a guest modus that makes sure that the house will not switch off when we’re heading out for a movie and we’ve got somebody to babysit our daughter. We do not wish to give just simply everybody access to our Homey system, soo we decided to create a modus that will keep the house alive when we’re not around. More about that in a next flow explanation.

The third flow: switching off the house, the important flow
This flow will take care of all the actions when the house is switched off. Thanks to the virtual switch we are able to program on top of the modus being turned on or off.

If The house switch is turned off
Then Turn off the house switch, turn off some other virtual switches, let Homey speak, turn off all the lights, trigger closing the roller blinds stop casting anything to the television and start the vacuum cleaners

That’s a lot right? But this is soo d*mn useful! Without thinking Homey takes care of turning off al the lights, turning off anything that’s playing on the television etcetera!

I added ‘turn off the house’ because I wish to call for this flow within other flows as well. Calling this flow will then not turn off the virtual house switch, soo I embedded this. This way the house will also be switched off when I turn the switch off but also when I call for this flow somewere else.

The other switches I am turning off are not very interesting to explain in this tutorial. They will follow later on in other tuts.

I am letting Homey speak. Everytime I do this, I play a sound through the Homey soundboard app. This is optional, but I like the fact Homey is giving a heads up sound when it’s starting to speak soo the voice is not coming out of the blue and you will miss the first part. Homey will announce that the house will be turned off. In case something went wrong and somebody is still sitting on the couch, they will be notified what’s happening.

Turning off the lamps speaks for itself. Every lamp in the entire house will be switched off to safe power. Nobody is home after all, why keep them on? Funny, the Yeelights are not responding to ‘Turn off all the lights’. I guess it’s a little buggy in the flow cards. But no problem, I added them manually.

The main television will stop casting anything that’s playing. We use this television with soundbar attached for music, films and series. Once the house is switched off, everything will automatically stop playing… Even when we forgot that it’s on!

Last but not least the vacuum cleaner will start working. In this flow we still have on, but we currently have two of them. A Roborock downstairs and a Neato upstairs. Because we’re not in an active house we found it useful that vacuums would start running at this point, cleaning the floors.

The fourth flow: switching the house on, the important flow
Soo now we’ve seen how we can turn off the house, but what when it’s turned on? This flow will handle that action, cq; when the virtual switch is turned on, what to do?

If The switch is turned on
Then Turn on the switch, send the vacuum to it’s docking station, run flows to switch lights and the curtains, mark everybody as awake.

Same as in the ‘turn off’ flow, I am turning the switch on. This way the switch will be turned on even when I call the flow straight away without hitting the virtual switch.

I will send the vacuum cleaners to their docking. Even when they are not done, we do not want all the noises of the cleaning devices when we’re back home or awake. They will start later on again.

The lights and roller blinds are triggered by special flows that take care of those devices. I will write (or already have written) more tutorials about those flows, search for them! :slight_smile:

I will mark everybody as awake. This will be explained in the fifth flow, it has something to do with my wife going to the bedroom in the middle of the night.

The fifth flow: activating with a virtual button
Soo this is an interesting one. In the beginning I added a time limit the the first flow i’ve described above, the one with the motion sensor. My thought was; activate the house when the motion sensor is activated and it’s passed 07:00 in the morning. This failed because some mornings my wife is using the bathroom right after 0700 in the morning and after that she’s heading back to bed.

At this moment I decided to active the house in the morning when we ask it to activate; by voice or by pressing the virtual button. By voice is explained below, this flow is explaining the button.

If the desired button is pressed
And The house is switched off
Then Switch the house on
Optional Else Turn the kitchen table lights on or off

I think this flow is pretty straight forward. I just wanted to give an extra touch and use the button for two flows; switching on and off for both the house and the kitchen table lights. When the house is turned off, turn it on. When it’s turned on, do something else when touching the button.

(de)Activating the switch by voice command
We do not use this very often, but it’s still useful sometimes. If we wish to turn off the house with our voice using a command, we are able to use Google Home. Once we’ve linked those two devices togheter, Google will add the virtual devices to it’s database. From now on we can say; ‘Oké Google, huis aan’ (house on), were you pronounce the name of the switch and add on or off to your command. This will turn the virtual switch on or off, Homey will do the rest.

Since Google released ‘Routines’ in the Europe apps, it’s also possible to give this command a little bit more logical sentence. To create this, follow these steps:

  1. Add a new Google Routine
  2. As trigger, use ‘I say something’ and add all the sentences you can think of as a command. For example; ‘turn on my house’, ‘could you turn on my house’, ‘i am leaving, turn off the house’ etcetera. You muse very specific because google will only trigger when you say the exact sentence, but you can add as many different options you can think off
  3. Trigger a smart device and choose 'House: Turn on (or off)
  4. Done! From now on you can say more logical sentences to your google devices instead of ‘house on’.

You could als add the house switch to a default routine that’s built in within Google, for example to good morning protocol. Edit this protocol and add 'Trigger a smart device and choose ‘House: Turn on’ to this routine. This way when you wake up in the morning and you say ‘Hey Google, good morning’, Google could tell you the weather forecast, your agenda, the latest news and also activate your entire house at the same time. Awesome right?

Add your nest thermostat to this flows!!
Yes, it IS possible! Since Google added the routines to the European systems, it is possible to switch your Nest thermostat on and off. I am embedding this into switching my home on and off, or better just off. I wish to turn on the thermostat by hand or when we’re on our way home, but we forgot to switch it off pretty often. Our solution? Use Google Routines!

Following the above tutorial you are also able to add a routine card that turns your nest thermostat off before (or after) you hit the virtual switch. Soo when you ask Google to turn off your home it will turn off your nest thermostat and turn off your house in a sequence.

Activating your house based on your agenda
There are soo many reasons why you want your house to be activated based on your agenda. For example, you’ve got a job that allows you to start early or late based on your first appointment. My wife has such a job soo I embedded her business calendar in the Homey house switch.

First you need an account for IFTT. Link your Google Calendar account (gmail) to IFTT and also link your Homey account. Once that’s done, create a flow on IFTT and let it trigger when there’s an appointment within 15 minutes, 30 minutes or whatever trigger you wish. As action, let it run your Homey flow ‘House activated by agenda’ as explained below.

If this flow is started
And Somebody is at home
Then activate your home and let Homey speak

There is no trigger for this flow since it’s started by IFTT, soo I choose for ‘When this flow started’ as a trigger. This allows it to be called from anywhere in the system.

The built in ‘and somebody is home’ is very important. We do not want the house to activate when theres nobody at home. For example there is a wrong appointment in your agenda or you simply already left home and kept the house turned off.

I am letting Homey announce that it’s going to turn on the house. This way you’re not thinking ‘wtf is going on’ when you’re still walking around half a sleep, lol.

That’s all folks!
Soo that’s all. In my flows you’ll find some other interesting triggers which I will explain in other tutorials. Feel free to search for them. I will write them in the upcoming days.

If you have any questions, feel free to ask them below!

2 Likes