I’ve got a Zigbee Smart Knob that I want to mount outside. The behaviour I want is:
- If the Sonos is playing something, take a snapshot and then pause the music when the button is pressed.
- If the Sonos (O-Pool) is not playing anything then play something (I’m defaulting to PopRocks on XM) when the button is pressed UNLESS there is a snapshot, then resume the snapshot.
- Volume up and down should respond to turning the knob.
Everything above is working except resuming the snapshot. How do I know if there is a snapshot saved?
alias: O_SmartKnob Volume
description: ""
trigger:
- device_id: 113e1441be41fea5c6c704fbac64ef33
domain: zha
platform: device
type: device_rotated_slow
subtype: right
id: VolUpSlow
- device_id: 113e1441be41fea5c6c704fbac64ef33
domain: zha
platform: device
type: device_rotated_slow
subtype: left
id: VolDownSlow
- device_id: 113e1441be41fea5c6c704fbac64ef33
domain: zha
platform: device
type: remote_button_short_press
subtype: button
id: VolReport
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: VolUpSlow
sequence:
- service: media_player.volume_up
data: {}
target:
device_id: 7cb8206605453577ff2d0593925dee3d
- service: media_player.volume_up
data: {}
target:
device_id:
- fba266a21cc44ffbe54b21040155cf2c
- conditions:
- condition: trigger
id: VolDownSlow
sequence:
- service: media_player.volume_down
data: {}
target:
device_id: 7cb8206605453577ff2d0593925dee3d
- service: media_player.volume_down
data: {}
target:
device_id: fba266a21cc44ffbe54b21040155cf2c
- conditions:
- condition: trigger
id: VolReport
- condition: device
device_id: fba266a21cc44ffbe54b21040155cf2c
domain: media_player
entity_id: media_player.o_pool
type: is_paused
sequence:
- service: media_player.play_media
target:
entity_id: media_player.o_pool
data:
media_content_id: FV:2/61
media_content_type: favorite_item_id
metadata:
title: 17 - PopRocks
thumbnail: >-
http://pri.art.prod.streaming.siriusxm.com/images/channel/20180725/9450-1-17-00-320x320.png
media_class: genre
children_media_class: null
navigateIds:
- {}
- media_content_type: favorites
media_content_id: ""
- media_content_type: favorites_folder
media_content_id: object.item.audioItem.audioBroadcast
- conditions:
- condition: trigger
id: VolReport
- condition: device
device_id: fba266a21cc44ffbe54b21040155cf2c
domain: media_player
entity_id: media_player.o_pool
type: is_playing
sequence:
- service: sonos.snapshot
data:
with_group: true
entity_id: media_player.o_pool
- service: media_player.media_pause
data: {}
target:
entity_id: media_player.o_pool
mode: single