rock3r
(Peter Johansson)
January 22, 2018, 7:48pm
1
Hi!
I’m trying to get 2 conditions to work. I get the following errror in my automation condition section:
Unsupported condition: or
{
"condition": "or",
"conditions": [
{
"after": "20:45",
"before": "20:47",
"condition": "time",
"weekday": [
"mon",
"tue",
"wed",
"thu",
"sun",
{
"condition": [
{
"after": "23:05",
"before": "23:15",
"condition": "time",
"weekday": [
"fri",
"sat"
]
}
]
}
]
}
]
}
The yaml looks like this:
- action:
- data:
entity_id: light.koket
service: light.turn_off
alias: Släck - Köket
condition:
- condition: or
conditions:
- condition: time
after: '20:45'
before: '20:47'
weekday:
- mon
- tue
- wed
- thu
- sun
- condition:
- condition: time
after: '23:05'
before: '23:15'
weekday:
- fri
- sat
id: '1516446946941'
trigger:
- at: '20:46'
platform: time
- at: '23:10'
platform: time
Isn’t or condition supported or have I missed something else?
1 Like
Your spacing is incorrect
your ‘OR’ condition should sit even with your other condition
rock3r
(Peter Johansson)
January 22, 2018, 8:03pm
3
Thanks!
Could you perhaps show with a code snippet?
I’ve read the page but don’t really get what you mean by “should sit even with your other condition”.
My formatting might be off on this, but you just added too many ‘levels’ of condition. the problem is with this:
- sun
- condition:
- condition: time
Remove the first -condition and line the rows back up.
- action:
- data:
entity_id: light.koket
service: light.turn_off
alias: Släck - Köket
condition:
- condition: or
conditions:
- condition: time
after: '20:45'
before: '20:47'
weekday:
- mon
- tue
- wed
- thu
- sun
- condition: time
after: '23:05'
before: '23:15'
weekday:
- fri
- sat
id: '1516446946941'
trigger:
- at: '20:46'
platform: time
- at: '23:10'
platform: time
rock3r
(Peter Johansson)
January 22, 2018, 9:04pm
6
Still struggling… made the changes (I think…) but still getting the same error:
Unsupported condition: or
{
"condition": "or",
"conditions": [
{
"after": "20:45",
"before": "20:47",
"condition": "time",
"weekday": [
"mon",
"tue",
"wed",
"thu",
"sun"
]
},
{
"after": "23:05",
"before": "23:15",
"condition": "time",
"weekday": [
"fri",
"sat"
]
}
]
}
for yaml:
- action:
- data:
entity_id: light.koket
service: light.turn_off
alias: Släck - Köket
condition:
condition: or
conditions:
- condition: time
after: '20:45'
before: '20:47'
weekday:
- mon
- tue
- wed
- thu
- sun
- condition: time
after: '23:05'
before: '23:15'
weekday:
- fri
- sat
id: '1516446946941'
trigger:
- at: '20:46'
platform: time
- at: '23:10'
platform: time
I’m running Hass.io (Home Assistant 0.61.1) but that shouldn’t matter I guess?
GroovyTrue
(George Mcinally)
February 13, 2018, 1:03pm
7
I have the same issue. Did you figure it out?
- action:
- data:
entity_id: light.soverom_pernille
service: light.turn_on
- delay: '00:15:00'
- data:
entity_id: light.soverom_pernille
service: light.turn_off
alias: Autolys Pernille
condition:
condition: or
conditions:
- condition: time
after: '08:00:00'
- condition: time
before: '19:30:00'
id: '1518454246987'
trigger:
- entity_id: binary_sensor.motion_sensor_158d0001a92a38
from: 'off'
platform: state
to: 'on'
shire210
(Shire210)
February 13, 2018, 1:33pm
8
What are you trying to do with that condition? It is always going to be after 8:00 or before 19:30…
If you are trying to trigger the automation only between those times, you do not need an “or” condition. You should be able to use the following:
condition: time
after: '08:00'
before: '19:30'
1 Like
rock3r
(Peter Johansson)
February 13, 2018, 2:53pm
9
Hi!
No, haven’t figured it out yet. For now I’m using one condition for Sunday to Thursday and one condition for Friday to Saturday. Would like to have them in on condition though.
GroovyTrue
(George Mcinally)
February 14, 2018, 7:17am
10
Yes that is what I am trying to do. I thought I got an error by typing like you do, and started trying OR instead. It worked without OR now, thanks.
budlyte
(Bud Schultz)
March 9, 2018, 11:53pm
11
Are you saying you removed the “or” word and just had
condition:
conditions:
- condition: (1)
GroovyTrue
(George Mcinally)
March 10, 2018, 1:50pm
12
Since the condition would always be between “after” and “before” times, I took away anything relating to normal OR method. The automation is just like this now:
condition:
after: 09:30
before: ‘19:30’
condition: time
rock3r
(Peter Johansson)
March 10, 2018, 4:06pm
13
Can you please post the yaml code for the automation?
GroovyTrue
(George Mcinally)
March 12, 2018, 11:10am
14
> - action:
> - data:
> entity_id: light.tradfri_bulb_e27_w_opal_1000lm_9
> brightness: 130
> service: light.turn_on
> alias: Autolys Emmeline ON
> condition:
> - after: 09:30
> before: '19:30'
> condition: time
> id: '1519336547971'
> trigger:
> - entity_id: binary_sensor.motion_sensor_158d0001b15df4
> from: 'off'
> platform: state
> to: 'on'
gragal
(Павел Ефимов)
September 30, 2019, 9:43am
15
what if i need multiple periods of time?
condition:
- condition: state
entity_id: binary_sensor.door_window_sensor_158d00035831c7
state: 'off'
- after: '10:00'
before: '13:00'
condition: time
- after: '15:00'
before: '23:00'
condition: time
But automation didnt start at all …
finity
September 30, 2019, 2:43pm
16
are those conditions supposed to be “or” or are they “and”?
gragal
(Павел Ефимов)
October 1, 2019, 6:23am
17
i think its “or”.
actualy i want
door and (time or time )
finity
October 1, 2019, 1:23pm
18
condition:
- condition: state
entity_id: binary_sensor.door_window_sensor_158d00035831c7
state: 'off'
- condition: or
conditions:
- after: '10:00'
before: '13:00'
condition: time
- after: '15:00'
before: '23:00'
condition: time
1 Like
Did you figure this out? I still get the error and I’ve used your formatting ‘finity’, it didn’t help.
condition:
- condition: time
after: '09:30'
before: '20:30'
- condition: or
conditions:
- state: 'home'
entity_id: person.derek_bredl
condition: state
- state: 'home'
entity_id: person.elaine_bredl
condition: state
Is my code and it’s still giving the error.