Automatic pilot
Automations are key to creating a smarter home and ensuring it works from dusk to dawn.
QUICK TIP
Categories can be used to organise items within Home Assistant:www.home-assistant.io/docs/organizing/categories/.
The automation that we will work on first is to switch on the lights after sunset and before T sunrise when entering the room. Home Assistant provides a sensor, which tracks the location of the sun, and we can pair this with our newly integrated smart bulb. This example also uses an Ikea Tradfri motion sensor. Navigate back to Home Assistant and from the menu on the left, navigate to Settings > Automations & Scenes. Use the + Create Automation button and select the Create New Automation option to create a blank one. Now, in the Triggers section, use the Device option, and in the Device box, search for your motion sensor. In the Trigger section, select the option that resembles motion being detected. We now need to add a condition, so that the light only turns on if the sun has set on an evening and not risen again the following day. To do this, use the + Add Condition option and search for Sun and select Before Sunrise and After Sunset. Offsets can also be added if the time needs to be shifted slightly. We now need to add our actions, so under the Then Do section, use the + Add Action to add the action, which turns a light on. Select Device and search for the light you want to turn on. Under the Action section, select the Turn On option. If your bulb supports it, you can also set a brightness at this stage. At this point, click on Save and name the automation – please note, emojis can be used within automation names, which is an easy way to categorise your automations. The Category functionality could also be used (see the Quick Tip).