Need help with my automations…only about half of them are working/showing up in the web interface for HA. Looks to be all the automations that have conditions in them; so that is probably where I’m failing. Weirdest thing is this automation WORKED for like 2 weeks after I wrote it and now won’t work anymore without any changes to the config. Check out my code --> http://hastebin.com/pupisaruse.pl
What the heck am I doing wrong…this seems so straight forward.
Saw this yesterday and for some reason it popped back in my head today as I was working on my HA.
Are you conditions being met? Are both lights on and its after sunset? If anyone of those isn’t met (since you are using and) I don’t think the condition will run. So if its before sunset or one of the lights is already off the automation won’t trigger I believe.
Have you changed anything else in your config? Maybe tweaked the name of the sensor or the light(s).
Finally, unless you have a lot of config text I would post it in the forum. My experience on other forums is people are eihter lazy and won’t open the link or are worried about malicious links and generally avoid them.
All the conditions are being met. The automations aren’t being accepted by HA as in the automations that have conditions are not showing up on the automation card like the other “non-conditioned” automations do. So there is something wrong with how I am writing the conditions section, even though I just copied and pasted from the example and tweaked entity names. All entity names have been checked an innumerable number of times…
Here is the config file so as not to require a link;
alias: "Bedroom Door Open Lights On"
trigger:
platform: state
entity_id: binary_sensor.bedroom_door_sensor
state: 'off'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: state
entity_id: light.stairs
state: on
- condition: state
entity_id: light.upstairs_hall
state: on
action:
- service: light.turn_off
entity_id: light.stairs
- service: light.turn_off
entity_id: light.upstairs_hall
Also; for the record when I comment out the extra conditions --> no problem, when I comment out to use only a single condition --> no problem, when I use either an AND or an OR with multiple conditions like above code —> Problem.
Using most up to date Docker Image and utilizing !include_dir_list with individual .yaml’s for each automation in the directory. Context for the spacing seen in the code above.
I am stumped. One last long shot is the state of your lights. Is ‘on’ the correct state? Turn the light on and check its state. Pay attention to the capitalization also as HA is case sensitive.
When you find the solution please post it up, Ill be interested to see what it was.
same outcome by adding ‘states’ so that wasn’t the issue. I see you got rid of the conditions bit of code too which is not how documentation recommends .
@rabittn I think you may just be THE MAN! I restarted my docker and the automation in question is present in my ‘automation card’ now along with 4 other automations that didn’t show up previously…probably because they were alphabetically named after this failed .yaml file.
I ran a diff check on the origional and the current .yaml to see what the key change was:
You don’t have to wait until sundown. You can manually spoof the state using the <> screen. Click on the entity you want to fiddle with, make your changes and hit “set state.”