I am trying to get my first zwave switch to turn on at sunset
I just made this script by using examples on the docs. Config checker says good but it didn’t work.
My ? is the sunset event valid AT and beyond sunset or only at sunset? It’s well after sunset so not sure if that is the issue or it doesn’t like my code?
Also some of the documentation seems conflicting.
Should this code go into the main Configuration.yaml file or the automation.yaml file?
I tried it in Configuration.yaml (and it did not work), then I tried it in automation.yaml .
But In automation.yaml it says the automation: header is invalid,.
you only use automation: as a headed if you have your automations IN the config.yaml file. If you have split the config and used the automations.yaml file, the automation: header is not to be used
I actually use Packages now which I prefer over all of the file methods, but the next best (in my opinion) is to have a folder called “automations” and keep a separate yaml file for each automation you have (eg: kitchen_light_auto.yaml etc.) and then put automation old: !include_dir_list automations in your configuration.yaml
You could temporarily change the trigger to a specific time just for testing purposes (then change it back to use sunset).
If you feel you must test the automation at sunset, change the computer’s clock time so it’s just before sunset in your location. You may need to restart Home Assistant so that it’ll be in sync with the new time. NOTE: if your computer is periodically syncing its clock with an NTP server, this trick might not work (or only work for a short period of time).
Maybe later but this is just confusing for him right now. I use packages and have an automations file with 90% or my automations in it. I personally see no benefit is having different files for each automation but that’s just me… I have less than 20 in total so maybe if I had more it might make more sense.
My issue is I am new at this and need to make sure it works before I remove all my switches from Wink.
Since I got zwave working yesterday, the system takes even longer to reboot I set offset to 8pm and missed the window by 3 min. So let me try again …I will try just an exact time 815pm and see what happens…thanks.
OK so if you use the automation editor, you should not need to restart. If you have used a YAML file then maybe edit that file and then use the reload automations option instead of restarting home assistant.
I am not sure the automation editor is actually working. It says nothing is there when it is.
I have been using the hass.io editor. The same one I use for the main config. Once I get things working I will see whats wrong with the automation editor.
If you created the file in a text editor and saved a YAML file then the automation editor won’t work as it needs an ID in the file. Here is a sample of mine: