Breaking down the Flag Sensor in Home Assistant

Blog_Post_Breaking Down the Flag Sensor

With all the holidays passing us, I’ve noticed the nice colors on my house using the DIY LED lightstrips.  With Halloween, Christmas, Valentine and now President’s day, the Smart Home has been lit up beautifully and automagically.  This is in large part thanks to Home Assistant and my color scene scripts.  I’ve never really taken the time to break these scripts down so that’s what I am going to try to do here now.  Of course, you can get all of the latest scripts for this project and more on my GitHub repo.  So be sure to head there and drop a star on the repository so you can stay up to date on any changes.

For President’s day specifically, there is a FLAG SENSOR.  This flag sensor is responsible for checking the internet via a rest API to see if the current day is a flag day and if it is, Home Assistant can then light the house appropriately.  Red White and Blue.  As discussed and detailed in other videos, my house has about 8 objects that can be individually addressed.

image

These consist of light strips over some window and garages in addition to Hue lights placed outdoors in 3 sconces and in the overhead fixture above the main door.  Using all of these elements, you can get some pretty cool effects on the house for all of the holidays.  Since all of the effort is scripted, it’s always a nice surprise when you come home and the house is lit a different way for one of the minor holidays. (StarWars day anyone?) 

The parts for the front lighting include:

1 x LED RGB Wifi Controller – https://amzn.to/2jUBSBE
1 x LED Light Strip Kit – https://amzn.to/2gJYfZ5
1 x Power Supply – https://amzn.to/2j5Vu0D
1 x Outdoor Housing – https://amzn.to/2m2dG0X
2 x Aluminum LED Diffuser housing – https://amzn.to/2weYlil
3 x Hue colored lights – https://amzn.to/2eoQTJy
3 x E27 to E12 socket adapter – https://amzn.to/2vULhMo

For real-time holiday status, I use the website webcal.fi.  We pull data from this site 4 times a day to always have the most current information.   There are a lot of different countries and calendars available on the site, so be sure to explore it and find the one that best suits your home.

Once we determine if it’s a flag day, the monthly scene script is then called and we paint the house Red, White and Blue.  For 2019, there will be 20 flag days that the house will reflect in it’s front lighting.

In the video, I mention Phil and Rohan’s excellent HA Podcast.  Be sure to subscribe if you haven’t yet.

Happy Automating!

Carlo

TAGS