mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-18 19:26:57 +00:00
Closes #118 - Easily trigger radio over the whole house audio system.
This commit is contained in:
68
packages/radio.yaml
Executable file
68
packages/radio.yaml
Executable file
@@ -0,0 +1,68 @@
|
|||||||
|
#-------------------------------------------
|
||||||
|
# Radio Related Packages
|
||||||
|
#-------------------------------------------
|
||||||
|
#------Whole House Radio Enabled via Emulated Hue----------------------------
|
||||||
|
homeassistant:
|
||||||
|
customize:
|
||||||
|
input_boolean.radio:
|
||||||
|
icon: mdi:radio
|
||||||
|
friendly_name: Streaming Radio
|
||||||
|
emulated_hue: True
|
||||||
|
hidden: False
|
||||||
|
#---Use this Boolean to trigger via GUI or Alexa------------------------------
|
||||||
|
input_boolean:
|
||||||
|
radio:
|
||||||
|
name: Radio
|
||||||
|
initial: off
|
||||||
|
|
||||||
|
#-----Turn on the Music--------------------------------------
|
||||||
|
automation:
|
||||||
|
- alias: 'Play Kickin Country on ChromeCast Audio'
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id:
|
||||||
|
- input_boolean.radio
|
||||||
|
state: 'on'
|
||||||
|
from: 'off'
|
||||||
|
|
||||||
|
action:
|
||||||
|
- service: media_player.turn_on
|
||||||
|
entity_id: media_player.livingroomCC
|
||||||
|
|
||||||
|
- service: media_player.volume_set
|
||||||
|
entity_id:
|
||||||
|
- media_player.livingroomCC
|
||||||
|
data_template:
|
||||||
|
volume_level: >
|
||||||
|
{% if now().strftime("%H")|int < 12 and now().strftime("%H")|int > 6%}
|
||||||
|
0.45
|
||||||
|
{% elif now().strftime("%H")|int > 12 and now().strftime("%H")|int < 17%}
|
||||||
|
0.7
|
||||||
|
{% else %}
|
||||||
|
0.40
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
- service: media_player.play_media
|
||||||
|
data_template:
|
||||||
|
entity_id:
|
||||||
|
- media_player.LivingRoomCC
|
||||||
|
media_content_id: "http://dir.xiph.org/listen/113920/listen.m3u"
|
||||||
|
media_content_type: audio/mp4
|
||||||
|
|
||||||
|
#-----Turn off the Music--------------------------------------
|
||||||
|
- alias: 'Turn off the Radio'
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id:
|
||||||
|
- input_boolean.radio
|
||||||
|
state: 'off'
|
||||||
|
from: 'on'
|
||||||
|
|
||||||
|
action:
|
||||||
|
- service: media_player.turn_off
|
||||||
|
entity_id: media_player.livingroomCC
|
||||||
|
|
||||||
|
- service: input_boolean.turn_off
|
||||||
|
entity_id: input_boolean.radio
|
@@ -15,12 +15,13 @@ binary_sensor:
|
|||||||
show_on_map: False
|
show_on_map: False
|
||||||
#-------------------------------------------
|
#-------------------------------------------
|
||||||
automation:
|
automation:
|
||||||
- alias: 'ISS is above us!'
|
- alias: 'ISS is above us'
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id:
|
entity_id:
|
||||||
- binary_sensor.iss
|
- binary_sensor.iss
|
||||||
|
state: 'on'
|
||||||
from: 'off'
|
from: 'off'
|
||||||
|
|
||||||
action:
|
action:
|
||||||
|
Reference in New Issue
Block a user