Automations!

Automations!

I finally did it. After having a home automation system running in my house for awhile, giving another way to open the garage and adjust my thermostat, I finally automated something. Since I have an LED strip Home Assistant can turn on and HA knows when the garage door its open, I created my first automation. I still don’t get YAML completely but thanks to various examples online I now have part of my LED strip turning red when the garage door is not closed and it reverts back to what ever it was doing before when the garage door is closed. Since I was on a roll I also created automations to notify my phone when the door opens and closes. This part freaks my wife out a bit since I know when she opens the door while I am at work but she appreciates the indicator light in the house so she is willing to put up with it.

- id: GarageOpenIndicator
  alias: Garage door open indicator on
  hide_entity: true
  trigger:
    platform: state
    entity_id: cover.garage_door
    to: open
  action:
    service: light.turn_on
    entity_id: light.bsl1notify2

- id: GarageOpenIndicatorOff
  alias: Garage door closed indicator off
  hide_entity: true
  trigger:
    platform: state
    entity_id: cover.garage_door
    from: open
    to: closed
  action:
    service: light.turn_off
    entity_id: light.bsl1notify2

To make the LED strip work I created two new MQTT lights in Home Assistant and I modded the code running on the ESP8266 controlling the LED strip. I added two more MQTT listeners/responders in the code to be the notification lights, assigning one to the first 20 LEDs and the second to the last 20. I took the solid effect light, modified it to not change the notify section of the strip if the notify light was on and told the notify lights to call the solid effect after turning off. This makes for a very clean transition for turning on and off the notify signals regardless of he original state of the LEDs.

In messing with the code I broke a couple of the effects that were part of the original code. I need to sit down and strip out everything I’m not using because the code crashes with the LEDs in some odd states every time my son gets my phone and has fun with the lights. BRUHAutomation has some really cool effects in his code that I would love to play with but I am never going to use those in my living room. Maybe I should set up a string in my son’s treehouse so we can both have fun.

Since I still don’t have an easy way for a normal person to turn on the LED strip it hasn’t really gotten used, but it is now a much appreciated garage door status indicator. Home automation is fun and I have so many more ideas that keep popping up. What to do next?

Jacob

Leave a Reply

Your email address will not be published. Required fields are marked *