I am getting an error on all my automations; I could have sworn they were all working fine a few days ago. I’ve tried a number of variations on the indentation but the result is either the same, or a different error, related to the bad spacing.
Unfortunately - the quotes didn’t solve the problem
I realised that ‘and’ made more sense in this instance - but after changing it, I get the same error; except now it’s “Unsupported condition: and”.
Version is 0.60.0, maybe I’ll try a docker update. This just seems like I’ve collected a bug somehow…
Code:
- alias: Arriving Home
id: arriving
trigger:
platform: state
entity_id: group.people
from: not_home
to: home
condition:
condition: and
conditions:
- condition: time
after: '06:30:00'
- condition: time
before: '22:00:00'
action:
- service: switch.turn_on
entity_id:
- switch.synology_home_mode
- service: switch.turn_off
entity_id:
- switch.foscam_motion
- switch.ipwebcam_motion
- switch.dlink_motion
- service: notify.pushbullets7
data:
title: Home again
message: Kelly and/or Matt are home again
Good point finity - I should have mentioned this already; the only errors I see are in the Automations web editor part of the console. The log has nothing interesting.
My current log started like this:
2018-01-30 07:41:00 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=337 from 2018-01-28 20:06:11.095179)
2018-01-30 07:43:11 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Audio Station Active, the state is unknown.
So when you make the changes to your configuration in automations.yaml as you did in the first post at the top and you restart home assistant what happens?
Do you get any errors then? Does the frontend load? Is there any errors about automations.yaml in the home-assistant.log file?
No errors in the interface or main log - not when I hit ‘check config’ either. If I check it in an online yaml-checker it is fine too.
I thought everything was working, until I noticed an automation went off while I was not at home, against condition rules. This lead me to look at the conditions within the Automations web editor (http://hasshost:8123/config/automation), which is the only place that I see an issue.
I just ran a docker pull, but the version still says ‘0.60.0’
Has anyone managed to find what is causing this error? I am fairly new to HA and trying a simple automation example. As far as I can see, I have followed the example for an OR condition at https://www.home-assistant.io/docs/scripts/conditions/ For example:
Test multiple conditions in 1 condition statement. Passes if any embedded condition is valid.
condition:
condition: or
conditions:
- condition: state
entity_id: ‘device_tracker.paulus’
state: ‘home’
- condition: numeric_state
entity_id: ‘sensor.temperature’
below: ‘20’
So here is my actual automation code:
id: ‘1527151265839’
alias: Light Off
hide_entity: True
trigger:
at: ‘22:28:00’
platform: time
condition:
condition: or
conditions:
condition: state
entity_id: switch.hall_light
state: ‘on’
condition: state
entity_id: switch.familyroom
state: ‘on’
action:
So - my question is - does this work or doesn’t it? Is the ‘OR’ condition supported or isn’t it? I don’t want to waste time trying to correct something that just doesn’t work!! Thanks for any assistance…
OK, thanks so much for the prompt replies - and great news to know that it’s really NOT a problem! I had a sneaky suspicion that the automation worked - I’d seen the lights go off!! But - as I wasn’t sure that the HA Automation was working, I’d kept the original non-HA app “live” for the two lights. Now I feel much more confident that I can go ahead and rely solely on HA. As an aside, is there any news as to when this - somewhat irritating, and slightly disconcerting - bug might be looked at? I see quite a number of respondents in various forums who, like me, are concerned that they appear to have done everything ‘by the book’ and still get error messages.
Most people who do more complicated automations won’t use the GUI and that is the standard advice I have seen. I don’t think it’s a priority from what I have seen.