On top of the automations and voice control in the last post, I also want some pre-defined light settings. Home Assistant has scenes for this. Right now I have 3 in mind:
- Reading light in the bedroom
- overhead light off
- the two lamps on at 25% brightness and turned to a warm light
- Night Time
- turn off all lights in the house
- Nap Time
- turn off all lights in the bedroom
Automation – Light Warmth
Before I make the first scene, I’d like to set up control of the Ikea lights warmth similar to how the brightness is set up. This will almost be a copy and paste from the configuration and automation yaml files, but with a couple tweaks.
Configuration is straight forward:
name: Bedroom Lamps Brightness
name: Bedroom Lamps Warmth
The min and max values can be found on States tab of the Developer Tools. Scroll down to the entity (light.kyles_lamp) and if it is on will show the following:
I also added icons to the brightness slider and the new warmth slider. There are tons to choose from here.
Now we have two sliders that we can set values for in the GUI.
Home Assistant makes senses very simple. Define a name and the entities that you want to control along with what you want them set to, and that’s it:
- name: Reading
- name: Goodnight
- name: Nap Time
After a reset of HA, we have a new card and can test the scenes out:
Clicking on “Reading” turns both lamps on with dim warm lights. If the main light was at, it would also click off. Now again, reaching for your phone to set the lights when you’re ready for a nap isn’t ideal, so we might as well add Google Assistant back into things. This is as simple as making a new IFTTT Applet. Everything is the exact same as the previous post outlined, except for the URL and the Body:
Repeat for each scene with whatever activation phrase you want.
Note: I’m not a huge fan of how I made the scene for reading. Mainly because the brightness and warmth sliders that we made first do not update with the lights the same way the lights update with the slider. That means if the warmth slider is all the way to the left when the scene is triggered, the lights go from cool to warm, but the slider stays where it is. That is an awful GUI. I was hoping I could adjust the value of the sliders in the scene rather than the lights themselves, but I couldn’t seem to get it working. It is certainly possible with scripts, but not with scenes alone. I’ll save this fix for another post.