Skip to content

The beginning

Welcome to you, reading my new blog about Homey & Home-Assistant.

This is the first post here and i would like to tell you WHY i'm writing this blog.
Currently i'm using Athom Homey to automate all kinds of things and tasks in my house, which is working ok. The last 2 months i've noticed that Homey is having more trouble to keep up with all the devices, sensors and add-ons. It's a nice product, but not for big setups.
Besides that, i'm not really happy with the way Athom is communicating or developing their software. The new iOS app hasn't been updated in months, and release for Homey are being delayed more than i can tell.

So, i got the idea to migrate all my current automation to a brand-new, Docker based Home-Assistant setup. And i'm going to share the steps, problems and cool new stuff in blogs here :-)

Questions? Ideas? Tips? Please let me know in a comment or mail me on [email protected]!

YAML vs Node Red

Welcome to my 2nd blog about my migration adventure from Athoms Homey to Home-Assistant.

I would like to talk you guys through 3 topics/questions today :

- Why is YAML not the best option?
- Think your way through your automation
- Bugs are everywhere

Why is YAML not the best option?

When you start with a new Home-Assistant installation you tend to use everything they advise you to. Home-Assistant has a lot of build in features that you can use to automate tasks or to make your life easier, which is awesome. But sometimes.... sometimes, what you get is not the best that you can get, or so i've learned on my journey.

Automating tasks in Home-Assistant is done through automations. You specify a trigger (what is trigger my automation), a condition and an action. It sounds pretty straightforward and it is also.
A simple example of an automation could look like this :


automation:
- alias: "Media player paused/stopped"
trigger:
- platform: state
entity_id: media_player.htpc
from: 'playing'
to: 'idle'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.livingroom_normal


This automation turns on a scene (for your lights) when your HTPC reports that a movie is being paused and the sun is below the horizon (sunset). Epic, right?
Yeah, it is. But it still is YAML, and that sucks, bigtime. So when you are building bigger automations, your code will become a mess. Finding bugs can become quite the challenge for example. At some point i had automations which were > 60 lines of code. Fine if it works, but annoying to debug, enhance or read.

Then a Tweaker gave me a very valuable tip. He said it probably was a good idea to check out Node Red. I heard of it (while debugging and Googling a lot of my automations because i was stuck with them) so i started doing some investigation.
I've learned that Node Red is a default add-on which you can install on your Hass.io installation. It's a product made by IBM for "wiring together hardware devices, APIs and online services in new and interesting ways.". Sounds pretty funky.
So i've installed it. What i found, was in one word amazing.

Node Red is essentially this : It's a graphical way of making your automations. You can simply drag & drop blocks on-to your "whiteboard" in Node-Red, link them together with wires and tell them what to do.
So then i went from 60 lines of code for just one automation to this :



Really happy with Node Red so far. It gives you a very good overview of what your automation is doing, helps with debugging and makes you feel like you've just won a unicorn somewhere. Pretty cool.
In the next blog i will talk you guys through making your first automations/flows in Node Red! For now, if you want to start with Home-Assistant and plan on doing a lot of automations : Please, please, pick Node Red and don't start with the YAML Automations because after 2 long nights of debugging your head will explode. Believe me.

Think your way through your automation
Automating things in your home, and around your home is really cool. You can drop all your creativity in your Home-Assistant / Node Red setup and make it do all kinds of weird/cool/handy stuff. Want to turn on the lights when it's after sunset and there is motion in your hallway? Sure, automate it. Want to receive a push message once your dishwasher is done? Sure, also possible. The options are endless, really.

But it also has a 'downside'. Everything that you automate, build, code and script can fail. It can give weird behavior, it can cause bugs, your lights might turn on green instead of yellow and things like that. The trick here is not to think "OHHHHH i want to automate ALL shit in my home right now" but to think "OHHHHHH i want to automate ALL shit in my home right now. Let's start with the lights in the hallway". You really need to take it piece by piece. And with every piece you need to think very hard.

Sure, you can turn on the lights every time there is motion in your dining room. But is that the only thing? What are the conditions or edge cases? Maybe you don't want to turn on the lights when there is motion and the sun is still up? Or maybe you don't want your robot vacuum to start unless all the doors are closed so it can not get stuck on a doorstep.

The thing i want to tell you is : Take your time. Think it through. When i have to make big, complex automations, i just open up my notes app on my phone and start describing what it needs to do and when. And when it should NOT do anything.

Making an automation from written down notes that describe behavior is a lot smarter than doing it by head while your head is going 200% because you are so excited that you are now able to automate your coffee-machine.

I really had a lot of times when i thought my automation was right, but then i forgot something. My lights didn't want to turn on at night, i did a DOS like attack on my Philips Hue bridge because of a bug and my lights kept turning on green instead of yellow. I deleted all my Node Red automations, made notes first, started again, and now it is working perfectly! Just take your time ;-)

Bugs are everywhere

Yep, if you start with home-automation you will encounter bugs. Or not really bugs, but things you didn't think about well enough.
The main reason i want to tell you guys more about this is because it can become quite annoying to trigger bugs when you immediately go from 0% to 100% automation.

As with the other subjects, it's key to take your time. Do you want to automate your lights? It might be a good idea to make a flow that does everything that you want, except for turning on or off your lights. As a last step, set a push-message to your phone that says "Ok, now the lights should have been turned on" so that you can analyse the behavior of your automation a few days before letting it mess with your smart lights.

I had this, but it wasn't with lights..... it was with my alarm sirens. I want to rebuild the alarm that i had on my Homey to be a good, working, safe solution for my Home-Assistant. I hooked up my Z-Wave sirens to Home-Assistant and was building my alarm. Guess what, that freaking sirens went off every time. And that really is not funny, because it is 2x 100dB, so it's really load. Not only annoying for me, also for my neighbours. I've replaced the sirens in the flow with a push message that says "Attention : The alarm should have sounded now! Please check the house". It attends me on a possible break-in, but does not sound the sirens.

Also, when you are not leaving on your own, but you have a girlfriend, boyfriend, roommates or something else in your house, keep in mind that they also have to adjust to your automation-urge. They can't turn off lights with the buttons anymore, but have to rely on your automation. Take them with you in the process, tell them what you do and what they can expect. Really, do that, if you don't, there might come a day when someone says "Ok, fuck your automation shit. I'm just going to do it with buttons again".

So... this was kind of a psychological blog about Home-Automations. Things i hoped you picked up from my blogs : Take your time, make mistakes but make the right ones, tell other people in your house about what you are doing and then just start doing it. Experiment, make mistakes, learn from them, try again. In the end you will be able to automate things without the frustration, irritation and anger that comes with "doing everything from head, fast fast fast".

Next time we will really dive in-to coding, Node-Red, flows, devices, and so on! See you then!

Questions, remarks or tips? Contact me : [email protected]

Current Situation vs Desired situation

There it is. The first real blog about my migration from Homey to Home Assistant.

The first things i would like to tell and discuss and the following :

- Why is Homey not enough?
- Why is Home Assistant the better solution according to me?
- How am i going to migrate without "downtime"?

Why is Homey not enough?
Don't get me wrong; i really like Athom's product. It's a pretty fancy product, priced well and it has A LOT of hardware on board which makes it an ideal hub to control everything in your home.They base everything on NodeJS, which is a good choice because of the easy way to step in to developing your own apps.
But it also has some downsides. Because the product is so broad the developers at Athom need to develop all kinds of things. The last few months i had a few times that because of an update my Homey was not working correctly anymore. Implementations of Z-Wave or Zigbee broke down, WiFi issues, apps crashing etc. That is not bad by any means.... if you use it for your hobby project. If you use Homey to control everything (or almost everything) in your home, then it needs to be stable and you need to be able to rely on it. If it breaks down, your lights won't go on in the evening, your music won't start or all or your flows won't fire.
I really have faith in the Athom developers, and they will make software better... they have a pretty decent roadmap with a lot of nice features... but then there is the second big issue :

The hardware. Years ago, when they started the project as a crowdfunding campaign they made a hardware design; Sufficient for that time, pretty insufficient now. If you run > 10 apps, it already tells you "Please not : Homey can be slower then usual do to the amount of apps".... If you then start using a lot of devices, with a lot of apps and flows, Homey is really slowing then. It even got to a point that the speech of Homey (one of the "big" things in the beginning) started stuttering in every sentence.

And that is why Homey is not enough for me. It was in the beginning, and i really enjoyed it, but i want a more stable platform that i can control myself.

Why is Home Assistant the better solution according to me?
Ok, so then i started looking for something new, a better, more reliable product or piece of software that could control my home. I was thinking about just "buying" a new controller like a Vera or Zipato. Nice products, with long living support, but pricey and getting pretty old.

I already played with Home-Assistant a few years ago, and while it was promising, i was not able to get it up and running in a timely fashion so i stopped checking it out.
But now, while i was checking it out, i ran into it again. And i saw they now had Docker support, had their own OS for Home-Assistant, had add-ons, a lot more supported devices and then it became pretty interesting to check it out again. So that is what i did.

I had an old Intel NUC with a pretty old Intel Pentium CPU thingy and 2GB RAM. Was not using it, so i wanted to do a POC (Proof of Concept) with it on the NUC. So i installed Ubuntu on the NUC and tried to install Home-Assistant. That worked, because they have a pretty nice installer, so i was happy with that. But then i started thinking that i want more flexibility, even more then just a plain OS on a machine (because i cannot easily snapshot it and things like that). So i reinstalled the NUC with Promox, a free Hypervisor.
After that i again installed a Ubuntu VM, but this time in VM on Proxmox. After that, i ran the install script again and Home-Assistant was already running. That was good news, i was happy.

I started playing around a bit with it, trying to add some simple switches, my Hue lights and tried to get a "feel" with Home-Assistant, trying to see if i liked their way of working. And i kind of did.
Don't get me wrong, HA is based on YAML, and YAML can be (read: is) a bitch. So i was fucking around (and swearing) with the config a lot the first few hours. But after that i was getting good with it :-D!

I did a lot of research on supported devices, ways of coding it, automations, scripts, scenes and after that i was convinced. There it was, my new home-automation product.

How am i going to migrate without "downtime"
Yep, and then we were at the phase of planning. I wanted to migrate things from Homey to Home-Assistant without "downtime". With downtime i mean, i don't want to come home and find out that my lights are not working anymore. Or that my alarm is going wonky in the middle of the night, waking me up with 2 sirens...

But after some thinking, it was kinda simple. I'm just picking up Homey flows, checking out what they do, and moving them to Home-Assistant (coding a new automation that does the same thing as the flow), then disable the Homey flow, start testing with the Home-Assistant automation, and if it works, enable it on HA, remove it on Homey.

And that was beginning of my migration adventure. Currently i have already migrated some really basic flows, which i will show you and tell you more about in the next blogs.

For now : This is what i need to migrate on devices :



And i need to migrate 54 flows.

Want to read more? Subscribe with an RSS feed, or keep checking my Tweakblogs. I will post bits and pieces there ;-)