Hey all trying to set up this condition but I can't get it to work.
This works fine
condition:
condition: or
conditions:
- condition: state
entity_id: group.people
state: 'not_home'
- condition: time
after: '24:00:00'
before: '06:00:00'
But this doesn't
condition:
condition: or
conditions:
- condition: state
entity_id: group.people
state: 'not_home'
- condition: and
conditions:
- condition: time
after: '24:00:00'
before: '06:00:00'
- condition: state
entity_id: media_player.kodiliving
state: 'idle'
The only difference I can see between mine and the example is the swapping of the AND and OR
[quote="danichispa, post:2, topic:8628"]
conditions under your and block
[/quote]
Do you mean like this? I'm a little unsure of what 'your and block' is in your comment.
condition:
condition: or
conditions:
- condition: state
entity_id: group.people
state: 'not_home'
- condition: and
conditions:
- condition: time
after: '24:00:00'
before: '06:00:00'
- condition: state
entity_id: media_player.kodiliving
state: 'idle'
I did try that but still no change.
I can comment it out this far till it shows up but can't find a working combination from that point onwards
condition:
condition: or
conditions:
- condition: state
entity_id: group.people
state: 'not_home'
# - condition: and
# conditions:
# - condition: time
# after: '24:00:00'
# before: '06:00:00'
# - condition: state
# entity_id: media_player.kodiliving
# state: 'idle'
Thanks for replying Dan
I ended up starting again and it’s now working, still not 100% sure where it was broken before but below is a copy of what I now have working including trigger and action. Thanks for all your replies you guys are great.
alias: "Reciever off"
trigger:
- platform: state
entity_id: binary_sensor.aeotec_zw100_multisensor_6_sensor_6_0
state: 'off'
- platform: state
entity_id: group.people
state: 'not_home'
condition:
condition: or
conditions:
- condition: state
entity_id: 'group.people'
state: 'not_home'
- condition: and
conditions:
- condition: state
entity_id: 'media_player.kodiliving'
state: 'idle'
- condition: time
after: '22:00:00'
before: '06:00:00'
action:
service: media_player.turn_off
entity_id: media_player.receiver