I’m super new to Home Assistant, so I don’t really know my way around everything just yet, especially the YAML editor.
I’m trying to set up an Automation to dim two LiFx lamps to 30% at midnight every night.
The two LiFx lamps will already be powered on before midnight because I have an Automation switching them both on when the sun sets each day.
The two LiFx lamps are labelled Sitting Room Lamp and Living Room Lamp.
The closest Action I can find is a preset called ‘Decrease Living Room Lamp brightness’ but from what I’ve read in the forums this will only decrease the brightness by 10% from their initial brightness of 100%.
Is there a way I can set them both to 30% brightness each midnight?
Even though a little counter-intuitive - and even though the light’s already ‘on’ - you should light.turn_on and set the brightness_pct: '30' - this has the added benefit of turning it on even if it was off prior.
Also, this is ‘only’ the action portion of my automation - but you can recreate this same thing in the editor I believe.
/developer-tools/service is a great spot to go to ‘test’ these actions out in real-time.
For the Trigger Type, select: Time
For at enter: 00:00
For Actions, set Action Type to: Call Service
Set Service to: light.turn_on
Set entity to the names of the two lamps. For example: light.this_lamp, light.that_lamp
Set Service Data to: brightness_pct: 30
Click the file icon to save the automation.
NOTE
If I enable “Edit as YAML” for both the Trigger and Action, the resulting screen looks like this:
Yes, you can create a scene to set the lights. Then the automation can trigger at midnight and its Action can call the scene.turn_on service and supply the entity_id of the scene you created.