Help me get the conditions right

I have some bird sound which play every hour, works fine!

But recently I don’t want them to be playing when we are out, I have input Boolean to mark if no one is at home.

Now the issue, I am not able to get the conditions right,

below is what i have, can someone help please…

- id: '123123423423'
  alias: ambient sounds
  trigger:
    platform: time
    hours: /1
    minutes: 0
    seconds: 10
  condition:
  - condition: or
    conditions:
    - condition: state
      entity_id: media_player.living_room_home
      state: 'off'
    - condition: state
      entity_id: media_player.living_room_home
      state: 'idle'
    - condition: and
      conditions:
        - condition: state
          entity_id: input_boolean.home_occupied
          state: 'on'

 
  - after: 07:00:00
    before: '23:00:00'
    condition: time

Combining conditions can be a bit confusing. But I think what you want is:

- id: '123123423423'
  alias: ambient sounds
  trigger:
    platform: time
    hours: /1
    minutes: 0
    seconds: 10
  condition:
  - condition: or
    conditions:
    - condition: state
      entity_id: media_player.living_room_home
      state: 'off'
    - condition: state
      entity_id: media_player.living_room_home
      state: 'idle'
  - condition: state
    entity_id: input_boolean.home_occupied
    state: 'on'
  - after: '07:00:00'
    before: '23:00:00'
    condition: time

Read this like (media off or media idle) and home occupied and time between 7am & 11pm.

1 Like

Thanks Phil Again! :grinning:

1 Like