So I’m trying to narrow this down, but if i call sonos.snapshot and the then restore from an automaction it restores paused.
If i call sonos.snapshot and then restore from a script is restores but playing…
I’m rather confussed if it’s just a me thing, so if others have this issue?
This is the script that restores with the playlist playing
morninggreeting:
alias: Morning Greeting
sequence:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.james_home
state: 'on'
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
- service: sonos.snapshot
data:
entity_id: media_player.kitchen
with_group: false
- delay: '00:00:01'
- service: media_player.volume_set
data:
volume_level: 0.21
target:
entity_id: media_player.kitchen
- service: tts.speak
target:
entity_id: tts.piper
data_template:
media_player_entity_id: media_player.kitchen
message: '{% if now().strftime("%H")|int < 12 %} Good morning. {% elif now().strftime("%H")|int
< 18 %} Good afternoon. {% else %} Good evening. {% endif %} It''s currently
{{states.sensor.pirateweather_summary.state}} and {{states.sensor.pirateweather_apparent_temperature.state|round}}
degrees c. With highs of {{states.sensor.pirateweather_daytime_high_temperature_0d.state|round}},
and lows of {{states.sensor.pirateweather_overnight_low_apparent_temperature_0d.state|round}}.
Today will be {{states.sensor.pirateweather_summary_0d.state}} with {{states.sensor.pirateweather_daily_summary.state}}
later on. {% if states.sensor.met_office_rss_feed_south_east_weather_warnings.state
| int > 0 %} There is currently active weather warning from the met office.
{% endif %} {% if now().strftime("%H")|int < 9 and now().strftime("%w")|int
> 0and now().strftime("%w")|int < 6 and is_state("binary_sensor.workday_sensor",
"on")%} The current drive to Work in traffic is {{states.sensor.home_to_work.state}}
minutes. {% endif %} {% if states.sensor.grass_pollen == unknown %} The Pollen
count is not reported today. {% else %} The current pollen count is, grass
pollen {{states.sensor.grass_pollen.state}}, tree pollen is {{states.sensor.tress_pollen.state}},
weed pollen is {{states.sensor.weed_pollen.state}}. {% endif %}
{% if states.sensor.wrythe_lane_air_quality_index.state | int < 50 %} The air quality is currently good.
{% elif states.sensor.wrythe_lane_air_quality_index.state | int < 100 %} The air quality is currently moderate.
{% elif states.sensor.wrythe_lane_air_quality_index.state | int < 150 %} The air quality is unhealthly for sensitive groups.
{% elif states.sensor.wrythe_lane_air_quality_index.state | int < 200 %} The air quality is unhealthly.
{% elif states.sensor.wrythe_lane_air_quality_index.state | int < 300 %} The air quality is very unhealthly.
{% elif states.sensor.wrythe_lane_air_quality_index.state | int >= 300 %} The air quality is hazardous.
{% else %} Not quite sure what happened here.
{% endif %}
'
- wait_for_trigger:
- platform: state
entity_id:
- media_player.kitchen_2
- media_player.kitchen
from: playing
to: paused
for:
hours: 0
minutes: 0
seconds: 2
- service: sonos.restore
data:
entity_id: media_player.kitchen
with_group: false
This is an automation that restore paused.
- alias: 'Kumon Time'
initial_state: 'true'
trigger:
platform: time
at: "16:15:00"
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.guest_mode
state: 'off'
- condition: state
entity_id: binary_sensor.james_home
state: 'on'
- condition: time
weekday:
- mon
- tue
- thu
- fri
action:
- service: media_player.media_pause
entity_id: media_player.kodi
- service: sonos.snapshot
data:
entity_id: media_player.frontroom, media_player.kitchen, media_player.aryas_bedroom
with_group: false
- delay: '00:00:01'
- service: media_player.volume_set
data:
volume_level: 0.21
target:
entity_id: media_player.frontroom, media_player.kitchen, media_player.aryas_bedroom
- service: tts.speak
target:
entity_id: tts.piper
data_template:
media_player_entity_id: media_player.frontroom, media_player.kitchen, media_player.aryas_bedroom
# announce: true
# extra:
# volume: 20
message: >
'{{ ["It's time for Kumon", "Hey, Time for Kumon", "Excuse me, it's Kumon Time", "Time for Kumon", "Hey, don't forget about Kumon"] | random }}'
- delay: '00:00:06'
- service: sonos.restore
data:
entity_id: media_player.frontroom, media_player.kitchen
with_group: false