GithubHelp home page GithubHelp logo

frdnspnzr / yggdrasil Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 477 KB

Config for Homeassistant controlling all smart devices in my house.

License: MIT License

home-automation home-assistant home-assistant-config home-assistant-configuration automation homeautomation raspberry-pi iot smarthome lovelace

yggdrasil's Introduction

Yggdrasil Home Automation

Last commit Commit activity Homeassistant version Travis status GitHub issues MIT License

Concept

The basic concept is to strongly discouple assessment of states from consequences. To achieve that most rooms have a state that determine what's going on in there. States can be things like "On" when somebody flipped the light on, "Occupied" when somebody is there or "Off" when nothing of those two did happen.

Sensors and events now feed into these states. When the motion sensors detect motion we turn a room to "Occupied". When somebody presses down on a switch we turn a room to "Dimmed". Devices are only controlled through these states, not directly through sensors or real world events. That way I can have as much inputs and outputs as I want without big lists that get exponentially harder to maintain as I add more devices and automations.

There are however some exceptions to this rule. The light under the bed for example is directly controlled by the motion sensors.

Devices

Infrastructure

Device Quantity Connectivity Integration Notes
Raspberry Pi 4 32 GB 1 - - Cheap and easy to set up so this was the most straight-forward way to get into home automation. Installed the default image formerly known as Hass.io, now Home Assistant. It works for now so I don't see a reason to change things around.
Dresden Electronic Conbee II 1 USB deCONZ My main way to connect ZigBee devices. Connected directly to the Raspberry and working with the deCONZ integration. This thing works great. It was very easy to install, getting new devices set up is a breeze and it has a very generous range. Just look at how often I wrote "deCONZ" as the integration for devices.
FRITZ!Box 6490 Cable 1 LAN AVM FRITZ!Box I had this anyway because I like to have advanced routers instead of the things your cable provider sends you. AVM offering smart home solutions with easy integration into Home Assistant is something I discovered later. I kind of don't like that I have to use an actual user for the FRITZ!Box to connect to it instead of, say, just an API token. I set it up to use a dedicated technical user with minimal rights to make the integration work.

Lighting

Device Quantity Connectivity Integration Notes
Müller Licht Tint Bulbs 3 ZigBee deCONZ Great, cheap, easy to use ZigBee light bulbs. I hear they are hard to get outside of Germany but here they are literally placed at the Aldi checkout between candy bars and cheap liquor. I must admit I have not tried that many light bulbs but these are so great I can't think of anything more expensive ones could do better.
IKEA Trådfri Bulbs 4 ZigBee deCONZ I get those because they are even cheaper than the Tint bulbs for non-colored bulbs. They are a bit finnicky to use with the Conbee but do a great job overall.
IKEA Floalt 1 ZigBee deCONZ Used as the main ceiling lamp in the kitchen (we have the biggest model). It was easy to install and is easy to extend with additional Floalts. Great range of color temperatures and brighter than I could ever ask for.
OSRAM Smart+ ZigBee LED Strips 1 ZigBee deCONZ I got these on sale and they are pretty nice actually. I'm currently using two sets stitched together to make a longer strip.
Gledopto RGB+CCT LED Controller 1 ZigBee deCONZ Compared to the OSRAM strips this is bad. I'm using the controller with a cheap bulk LED strip so I don't now why this is bad but I have not heard good things about Gledopto so maybe it really is the controller. The LEDs take a hell of a long time to turn on and switch colors, the warmer whites are not nice to look at (I'm using a orangey red instead) and the light just goes out completely when going below 30% brightness.

Presence Detection

Device Quantity Connectivity Integration Notes
Aqara Human Motion Sensor 8 ZigBee deCONZ These are pretty great. I order them exclusively from Hong Kong so they are also cheap. The motion and brightness detection work like a charm but the temperature sensors on all my devices register values slightly off. Best thing is how small and unobstrusive they are.
IKEA Trådfri Motion Sensor 3 ZigBee deCONZ With things like the Aqara motion sensor I get to choose between them beeing cheap or easily available. With the Trådfri motion sensors I can get a dozen in the next twenty minutes if I really want to. I can drop five of those in a single room and still not break the bank. For being cheap and easy to aquire they get a free pass of not being that great after all. They take a few seconds to trigger after walking past them and have a very long reset time to trigger again after they stopped detecting motion.

Security

Device Quantity Connectivity Integration Notes
Aqara Door and Window Sensor 2 ZigBee deCONZ I was surprised by how fast and reliable these were. I sometimes literally open and close the balcony door just to see the lights change in real time like a small child.

Switches

Device Quantity Connectivity Integration Notes
IKEA Trådfri Remote Control 5 ZigBee deCONZ They are nice. I like them. I'll plaster all the walls with them.

Outlets

Device Quantity Connectivity Integration Notes
FRITZ!DECT 200 3 DECT AVM FRITZ!Box Smart Plugs by AVM made to be used with a FRITZ!Box. They are very clunky and take up much more space than other plugs I've seen but they double down as easy to use temperature sensors for the AVM thermostats. As with the thermostats I don't like that these are pretty much useless without a FRITZ!Box because I have never seen DECT used anywhere else. But at the same time I hope my FRITZ!Box is around for at least a few years so that shouldn't be an issue.
OSRAM Smart+ Plug 4 ZigBee deCONZ Got them pretty cheap in a sale. I'd like them a bit less bulky but overall they're pretty nice even though they don't support output readings. One is solely used as a ZigBee range extension right now.

Climate

Device Quantity Connectivity Integration Notes
FRITZ!DECT 301 3 DECT AVM FRITZ!Box Very easy to install and use and I'm a big fan of the screen. I can see the target temperature with a quick glance at all times. As with the Smart Plugs I kind of dislike the fact that those are DECT because it's not exactly a widespread standard for home automation.

Media

Device Quantity Connectivity Integration Notes
LG 55UJ6309 1 LAN LG webOS Smart TV The TV was older than my home automation ambitions so I was pleasently surprised to see how much I can actually do with it. Sadly the status does not properly update when using apps such as Netflix which seems to be a known and not easily fixable issue with the integration.
Sonos One SL 2 LAN Sonos I've gone with Sonos because they are easy to use with Home Assistant. For me that was worth the slightly higher price compared to similiar products. I probably could have built Smart Speakers myself but pulling off small, nice looking and good sounding all at once seems pretty hard. I decided on the SL models for now because I do not feel emotionally ready to talk with Amazon just yet.

FAQ

Why is this thing called Yggdrasil?

I just like having names for things and having a clear concept for names. Everything in my local network is named after something from nordic mythology. I find Yggdrasil fitting, being that thing that keeps all of existence kind of together.

There's one thing I want to make clear right here and now: I'm not a right-wing asshole claiming nordic mythology AS mY HerITagE or whatever they call it. I just think it's pretty cool. Punch nazis.

Don't you think you're going a bit overboard to solve simple problems?

Absolutely! This thing is a hobby and I just like to build a lighting switch so complicated I need a diagram to understand it. I can't recommend using this as a template for a "It just works" style of solution.

Why didn't you go with packages

I just don't see how they can be useful for me. I tried converting my setup to packages but it kind of just turned the config files inside out: What's been a folder before has been a file and vice versa. Nothing got easier to find or maintain, just different. I still think it's a nice concept and I will totally use packages as soon as they make my life easier.

Why don't you go with smart switches instead of light bulbs?

Great question I don't have great answers to! I started with this thing when I lived in a flat where I couldn't change the switches around as I liked. Now I could, but it still would be a hassle to make the switch (pun absolutely intended) without great pay-off.

I also like having an easy to use fallback when the complete home automation system burns down. Smart bulbs are stupid bulbs when not connected after all.

Did somebody really ask you any of these questions?

The going overboard question, yes. Everything else, no. But that's basically how all FAQs work.

I was asked if my living room is haunted when the lights turned on for no reason, though.

yggdrasil's People

Contributors

frdnspnzr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ha-token

yggdrasil's Issues

Background for favicon

The current favicon has a completely transparent background. That doesn't look great in certain situations, especially Chrome Dark Mode. The favicon should have a background, eg. a grey border and white background.

Auto turn off kitchen lights

When the motion sensor in the kitchen hasn't registered anything for a few minutes the light should turn off regardless of the current state.

Set elevation

Very easy enhancement: Setting the elevation of our house should make the sun level slightly more accurate.

Update configuration from GitHub

The current automatic configuration update reads from the GitLab repository (and doesn't always work). It must be moved to this repository.

Hyperion lighting sometimes turning off for a few seconds

When watching something the TV backlighting sometimes switches to the mood lights for a few seconds and then back to Hyperion lighting. That's because the TV sometimes detects as off for a few seconds. For the room state I use a timeout of 12 seconds (see here for example). But I cant really use that timeout here. When turning off the TV for real Hyperion supposedly stops sending signals because whatever device was connected was turned off before the TV. With the room state still set to dimmed, no Hyperion lighting and no TV the room would just turn dark for these 12 seconds.

Document current setup

The whole current setup should be documented in md files right in the folders where they belong. This way the documentation is actually in the repository and does not need to be updated externally like in the current wiki.

Dining room light turns on at night

And I have no idea why!

Tonight it turned on at 5:16. The dining room state was empty and has been for a while. The sun was still below_horizon. Looks like the cat triggered one of the motion sensors in the dining room at 4:41 but occupancy probability never rose above 10%. Nothing here should have triggered the lights turning on.

image

Front door light not connecting

The front door light is not connecting to the ZigBee network. Weird thing is the battery driven motion sensor right next to it happily detects motion and triggers the corresponding automations. The light actually does work when put right next to the Conbee.

Owntracks

Owntracks provides the easiest way to enable positional tracking without using a cloud service. Some infrastructure is need though to make it work without exposing all of HA to the internet.

Clean backup

I need a good backup strategy to account for hardware failures and wrong software configurations.

Fritzbox sometimes not connecting

About 1 in 10 times when starting HA the fritzbox integration does not connect to the device with the error message "The following components and platforms could not be set up: fritzbox. Please check your config." That means that many devices and a significant part of the presence detection are missing. A simple restart fixes the problem.

Startup notification not working

I should get a Telegram message when Home Assistant sucessfully started but I don't. It'd be great to know that the automatic update was successful.

Switch Lovelace to YAML mode

I want to be able to check the UI config into the repository. To do so I need to change Lovelace to YAML mode. First I need a sensible concept of how to structure the config so I don't end up with one big file.

Update notification

I'd like to get a notification in Telegram when there is an update to Home Assistant.

Fridge open door alert

Since we got the new fridge it happened multiple times that we left it open by accident. The way the door is built promotes this and we have to carefully check if it is really closed. An alert when we left the door open for some time would make this much easier.

My current idea is to just plug a door sensor on there to see if it is open and send a Telegram notification after a few minutes. A cool addition would be to change the lightning in the kitchen based on how long the fridge was open.

Soft transfer to automatic lights

In rooms where we can turn on the lights by hand and also automatically (eg motion sensors) it should transition from On to Automatic instead of from On to Off when the conditions for the automatic lights are fulfilled.

Kitchen main light

I installed a big Floalt light in the middle of the kitchen. It and the included Tradfri remote are already paired with the Conbee. Before installing the remote as a wall mounted switch the renovation of the room must be completed but I can start with the automations right now.

  • Kitchen states "On", "Occupied" and "Empty" set the correct light scene with respect to the house state. I don't think the kitchen needs modes (yet).
  • The switch sets the kitchen state to On or Off. I currently don't see anything I could do with the other buttons as the kitchen does not have modes.
  • A motion sensor sets the kitchen to Occupied or Empty.
  • Automatic light temperature according to time of day. Flux integration is already active but pretty hard to test when the light is not kept on all the time.

Music following us around

We now have our first speakers that integrate into Home Assistant so it would be nice if the music would follow us around the house automatically. This is probably several new features in one.

Move Recorder to Maria DB

Now that the nginx proxy manager which I rely upon for location tracking requires Maria DB I should move the Recorder over, too.

Floor night light under the bed

For easier nightly navigation without disturbing the other person the room could be illuminated from under the bed whenever somebody touches the ground.

Needed hardware

  • 3x LED strips
  • 2x Motion sensor #3

Turn off radiators when we open the balcony doors

Nice and simple: On warm spring days we often open the doors during the day but want to keep the heating on in the evenings and there's no need to heat the garden. Still waiting on my door sensors, though.

Bathroom thermostat not switching presets in the morning

Over night every thermostat is switch to the eco preset and every morning they are turned back to comfort. The thermostat in the bathroom however is not switched back to comfort in the morning. It's still working the other way around in the evening and for the living room thermostats.

Battery level warning

When anything with a battery falls below a threshhold I want to receive a notification via Telegram.

Default states

When devices switch from unavailable they should be assigned a default state. The same goes for nearly everything when Home Assistant starts.

Disable WiFi connection

In our old flat HassOS was configured to connect via WiFi so the Pi could be placed closer to the ZigBee devices. This is not needed anymore and the old unused WiFi connection details should be deleted.

TV reports as off

Often when watching TV its status changes from on to off. This seems to be an issue with webOS when connected via WiFi. Possibly fixed with home-assistant/core#29296 but not too sure about it. Looks like I will need a longer cable.

Move modes to states

The concept of modes I initially planned is not used for much and I don't really know what to do with it. The only thing currently relying on it is the living room lights and I could easily build this with another state. To make thinks easier I should eliminate modes for now and maybe rethink the concept when I actually know what to do with it.

Turn off all lights

There's some times when all lights can be turned off safely:

  • When everybody is gone (house changes to states Empty or Vacant)
  • Every night at 2am just to be sure

Also every light (except for the bedroom) can be turned of as soon as the house changes to Night after I implement a better night mode detection

Kitchen under cabinet lighting

For lighting half the kitchen counter we will need some under cabinet lights. Existing solutions (like IKEA Strömlinje) won't fit the corner and the gap so I guess I'm going with something custom built.

I will need these devices:

  • At least 2m of LED strips (I'm already building it myself so I guess I'll go with RGB WW)
  • LED strip controller
  • LED strip connectors (one for the corner, one for the gap)
  • LED strip diffusers fit for the cabinets

Preset for bathroom thermostat not switching properly

Most times the bathroom thermostat does not switch to eco when we go to bed or leave the house and back to comfort when we get back or wake up (but sometimes it does?).

This seems to be an issue with the automation. The thermostat works properly when switching presets on the web interface.

Use device triggers for Tradfri switches

The device triggers are a bit more complicated to setup but it looks like they can do much more than the event based triggers.

A device trigger can be created by going through the automation creation web interface and showing the trigger as YAML.

image

Dining room light turns off at sunset

When the ein state is on and the sun sets while motion is detected the room state changes to occupied and the light dims and turns off soon thereafter.

Bed presence detection

To reliably switch the house state to night and back it would be nice to detect when we are actually in bed instead of relying on some mostly-true-but-sometimes-very-much-not-so time triggers. I will use this issue to aggregate what I researched and found out to maybe someday implement a proper detection.

Update Hyperion management

Now that the Hyperion integration is fixed in 0.116 I can simplify the automations controlling what the TV backlighting does by turning Hyperion on and off.

Zone leave notification send wrong times

The travel time is updated every minute, but the phones do not send updates that often. The zone leave notifications however are sent the moment a phone leaves a zone. That way the travel time is near guaranteed to use the previous position.

The travel time should be updated before sending the notification. If possible it should also update whenever the phone position changes significantly instead of on a timer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.