Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Enable “Night Mode” on Sonos at different times depending on whether it’s a weekday or the weekend

$
0
0

@jjross wrote:

I’m trying to create a single automation that will enable “Night Mode” on my Sonos at different times depending on whether it’s a weekday or the weekend. I realize that I can do this pretty easily with two different automations but I would love to combine this into one that will cover both uses cases.

Here is what I have so far but it doesn’t seem to get triggered:

- id: '1579144335141'
  alias: Sonos Test
  description: ''
  trigger:
  - platform: template
    value_template: '{{ states.media_player.living_room.attributes.source=="TV"}}'
  condition:
  - condition: or
    conditions:
    - after: '20:00:00'
      before: 08:30:00
      condition: time
      weekday:
      - sun
      - mon
      - tue
      - wed
      - thu
    - after: '21:30:00'
      before: 09:30:00
      condition: time
      weekday:
      - fri
      - sat
  action:
  - data:
      night_sound: true
    entity_id: media_player.living_room
    service: sonos.set_option

I notice that the docs seem to mention that you can use before and after OR weekday. Is that actually the case or is it possible to combine the two?

If it is, how often would the trigger be evaluated? I would like this trigger to fire if, at any point during the before and after period, the Sonos switches to it’s TV playback mode. Is the trigger constantly checked during that time frame?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles