Folks,
on motion I would love to hear my favorite radio station. From time to time my sonos seams to forget the radio station and I have to go to my sonos app and choose the station. Now I would love to enhance my trigger From:
- alias: "Switch on BAD Media Player if Motion is detected during day"
trigger:
platform: state
entity_id: sensor.vision_zp3111_multisensor_4in1_burglar_10_10
from: '0'
to: '8'
condition:
condition: time
# At least one of the following is required.
after: '8:00:00'
before: '23:00:00'
action:
service: media_player.turn_on
entity_id: media_player.bad
To:
- alias: "Switch on BAD Media Player if Motion is detected during day"
trigger:
platform: state
entity_id: sensor.vision_zp3111_multisensor_4in1_burglar_10_10
from: '0'
to: '8'
condition:
condition: time
# At least one of the following is required.
after: '8:00:00'
before: '23:00:00'
action:
service: media_player.turn_on
entity_id: media_player.bad
##the radio station #
when I look to my logs after i switched on my Sonon in my bathroom:
Dec 28 19:45:40 home-assistant hass[11883]: 16-12-28 19:45:40 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state media_player.bad=playing; media_duration=0, supported_media_commands=10766, volume_level=0.18, media_content_type=music, friendly_name=Bad, media_album_name=, media_artist=, is_volume_muted=False, media_title=HITRADIO RT1 SĂDSCHWABEN, media_content_id=livestream.mp3, source=HITRADIO RT1 SĂDSCHWABEN, entity_picture=/api/media_player_proxy/media_player.bad?token=1848527760&cache=2936b, source_list=[âANTENNE BAYERNâ, âB5 plusâ, âBayern 3â, âDASDINGâ, âHITRADIO RT1 SĂDSCHWABENâ, âLORA MĂźnchenâ, âMeine Shazam-Titelâ, âTop10â] @ 2016-12-28T20:45:33.793157+01:00>, old_state=<state media_player.bad=playing; media_duration=0, supported_media_commands=10766, volume_level=0.18, media_content_type=music, friendly_name=Bad, media_artist=, is_volume_muted=False, media_title=HITRADIO RT1 SĂDSCHWABEN, media_content_id=x-sonosapi-stream:s57038?sid=254&flags=8224&sn=0, source=HITRADIO RT1 SĂDSCHWABEN, entity_picture=/api/media_player_proxy/media_player.bad?token=1848527760&cache=2936b, source_list=[âANTENNE BAYERNâ, âB5 plusâ, âBayern 3â, âDASDINGâ, âHITRADIO RT1 SĂDSCHWABENâ, âLORA MĂźnchenâ, âMeine Shazam-Titelâ, âTop10â] @ 2016-12-28T20:45:33.793157+01:00>, entity_id=media_player.bad>
The state of my media Player shows:
media_duration: 0
supported_media_commands: 10766
volume_level: 0.18
media_content_type: music
friendly_name: Bad
media_album_name:
media_artist:
is_volume_muted: false
media_title: HITRADIO RT1 SĂDSCHWABEN
media_content_id: livestream.mp3
source: HITRADIO RT1 SĂDSCHWABEN
entity_picture: /api/media_player_proxy/media_player.bad?token=1848527760&cache=2936b
source_list: ANTENNE BAYERN,B5 plus,Bayern 3,DASDING,HITRADIO RT1 SĂDSCHWABEN,LORA MĂźnchen,Meine Shazam-Titel,Top10
The âHITRADIO RT1 SĂDSCHWABENââ is the channel I wanna use. How can I tell HA always play that station? Can you help?