diff --git a/automation/mealtime.yaml b/automation/mealtime.yaml index 90e123b3..a68476f5 100755 --- a/automation/mealtime.yaml +++ b/automation/mealtime.yaml @@ -19,3 +19,6 @@ - group.living_room_lights - service: input_boolean.turn_off entity_id: input_boolean.meal_time + - service: script.speechcon + data_template: + speechcon: "bon_appetit" diff --git a/customize/input_booleans.yaml b/customize/input_booleans.yaml index 9b0ce849..a1c72eb3 100755 --- a/customize/input_booleans.yaml +++ b/customize/input_booleans.yaml @@ -28,8 +28,6 @@ input_boolean.garage_check: hidden: False - - input_boolean.good_morning: friendly_name: 'Good Morning' emulated_hue: True diff --git a/script/speechcons.yaml b/script/speechcons.yaml new file mode 100755 index 00000000..5c80426f --- /dev/null +++ b/script/speechcons.yaml @@ -0,0 +1,48 @@ +###################################################################################################### +###Script to send notifications to the ChromeCast Audios during normal hours and only when we are home! Call like this: + # action: + # service: script.speechcons + # data_template: + # speechcon: 'Bazinga' +# @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +###################################################################################################### + +speechcon: + sequence: + - condition: template + value_template: > + {% if is_state('media_player.livingroomCC', 'playing') %} + false + {% else %} + true + {% endif %} + - condition: state + entity_id: input_boolean.speech_notifications + state: 'on' + - service: switch.turn_on + entity_id: switch.living_room_amp + + - 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.3 + {% elif now().strftime("%H")|int > 12 and now().strftime("%H")|int < 17%} + 0.65 + {% else %} + 0.30 + {% endif %} + + - service: media_player.play_media + entity_id: + - media_player.LivingRoomCCa + data_template: + media_content_id: > + "https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/sounds/speechcons/{{speechcon}}._TTH_.wav" + media_content_type: audio/mp4 diff --git a/script/voice_notify.yaml b/script/voice_notify.yaml index 488f3045..7721d920 100755 --- a/script/voice_notify.yaml +++ b/script/voice_notify.yaml @@ -105,14 +105,14 @@ voice_notify: {%- macro uv_rays() -%} {% if now().strftime("%H")|int < 8 and now().strftime("%H")|int > 14%} {% if state.sensor.uv_index.states|int <= 4 %} - The U V index today will be very mild today. + The U V index today will be very mild today. {{states('sensor.uv_sun_advice')}} {% elif states.sensor.uv_index.state|int > 4 and states.sensor.uv_index.state|int <=7 %} The U V index will be {{states('sensor.uv_index')}} today. This is considered high. Be sure to drink lots of water and put on suntan lotion if you will be in the sun. {% elif states.sensor.uv_index.state|int > 7 and states.sensor.uv_index.state|int <=10 %} The U V index will be {{states(sensor.uv_index)}} today. This is considered very high. Be sure to drink lots of water and put on suntan lotion often today. - You could get a sunburn in about {{states('sensor.uv_burn_time')}} + You could get a sunburn in about {{states('sensor.uv_burn_time')}} minutes. {% endif %} {% endif %} {%- endmacro -%} @@ -194,8 +194,8 @@ voice_notify: {%endif%} {{ value1 }} - {{iss()}} - {{pihole()}} + {{ iss() }} + {{ pihole() }} cache: true diff --git a/sounds/speechcons/bon_appetit._TTH_.mp3 b/sounds/speechcons/bon_appetit._TTH_.mp3 new file mode 100755 index 00000000..af69fe72 Binary files /dev/null and b/sounds/speechcons/bon_appetit._TTH_.mp3 differ diff --git a/sounds/speechcons/ouch._TTH_.mp3 b/sounds/speechcons/ouch._TTH_.mp3 new file mode 100755 index 00000000..51e6f47d Binary files /dev/null and b/sounds/speechcons/ouch._TTH_.mp3 differ