I got a Lutron Caseta and works great in my home. I wish the ‘Scenes’ were more flexible where I could turn off lights that are on based on an inactivity timer. Does anyone have some type of script that I could use to accomplish this in the Home Assistant world?
You could create an automation with a trigger that fires if a device has been on for a certain length of time. The action of the automation could then turn the device off.
This could have some undesirable results though. If you set this to, say, 30 minutes then, if you come back into the room after 25 minutes you’ll be in darkness after 5 minutes.
You could use a motion sensor to ‘reset’ the timer. This could be sufficient.
Alternatively you could use a presence sensor to actually detect the presence of people.
Couple things. Not really too familiar with how to code this. Second, the investment into the Caseta ecosystem was not cheap (probably well over $1000) between electrician costs along with the equipment. Third, I am not sure how well adding a motion sensor or people to multiple rooms would go over with wife. Unless I am not understanding this correctly.
If you’re just learning how to create automations, I recommend you use the built-in Automation Editor (as opposed to the File Editor Add-on you’re using now).
Copy the automation example from the forum post above
Go to Settings > Automations
Click the Create Automation button
Click ‘Start with an empty automation’
Click the overflow menu in the upper righthand corner (three vertical dots; facetiously called the ‘kebab menu’)
Select ‘Edit in YAML’
Delete whatever is displayed and paste what you copied from the forum post
Click the Save button. If there any errors, they’ll be reported now and you’ll need to correct them (otherwise it will refuse to save the automation).
To view the automation in visual mode, simply click the overflow menu again and select ‘Edit in visual editor’
I created the automation as you suggested and I don’t see it under the Automation GUI, but I do see it as a YAML file. Just does not appear to be executing. The code seemed to be fine, no errors