I had originally managed to set up a Christmas Tree light automation (using the z-wave configuration GUID in Home-Assistant), which turned on a single zwave Aeotec Smart Switch at a certain time, and then turned it off after a delay of 4 hours. I have now repurposed the switch into my pool enclosure to turn on my pool robot at a certain time and then off 4 hours later (basically i renamed the friendly_name value). I have been trying to add a condition onto the automation which will only activate the automation on Fridays, but i am having a lot of trouble…
First issue is there is no field on the GUID to add a Condition: Time > weekday > - fri, it only allows for Condition: Time > After and Before
Thus i have had to try to edit the code in the automation.yaml file which was auto generated when i created the Christmas Lights automation… The below code is working.
BUT, when i add the condition of fri, the code will not work… I have tried mutiple ways of adding the code, and NOTHING will work for me, giving me a different error each time.
Sorry, I am very new to this… Is there a way of generating the code tags, or is it just type them in manually, I am using Notepad++ and Atom and cannot see the option in either… I have taken a screenshot of the code though if that helps…
Because your automation was created with the ‘automation editer’ I’m not exactly sure of the formatting.
You’ll see I’ve put an entry in under ‘condition’ that I believe should work.
If not, let me know and we’ll re-format it so we know exactly what’s what
2018-02-05 20:31:14 ERROR (Thread-2) [homeassistant.util.yaml] while parsing a block collection
in “/home/homeassistant/.homeassistant/automations.yaml”, line 2, column 7
expected , but found ‘?’
in “/home/homeassistant/.homeassistant/automations.yaml”, line 9, column 7
2018-02-05 20:31:14 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block collection
in “/home/homeassistant/.homeassistant/automations.yaml”, line 2, column 7
expected , but found ‘?’
in “/home/homeassistant/.homeassistant/automations.yaml”, line 9, column 7
I should also say, im happy for someone to give it a go to create it using script rather than the guid… i can always delete the one the guid created.
Also, consider making your actions a script.
Once an automation has been triggered, like a raging bull, it cant be stopped ! Turning the automation off only stops it from being triggered again. It doesn’t stop it from running if already triggered.
When you turn a script off, it stops dead in its tracks.
Also, FYI, you can have conditions in actions, and in scripts !!
Thanks… il try that tonight when i get home and let you know how it goes. I will also read up on creating scripts as i have never created those before.
Thanks for attempting to get it the code… I dont receive any errors in the log any more however the task runs daily as opposed to Fridays…
i will red up on the Script option and try to code that myself (just like to give stuff a go myself before asking for help)… if i get stuck i will ask for assistance again.