Hi all,
I am trying to create an alarm clock using my Google Home mini and Spotify to play a free playlist (I don’t have spotify premium).
input_number:
alarm_1_hour:
name: Hours
icon: mdi:timer
initial: 6
min: 0
max: 23
step: 1
alarm_1_minutes:
name: Minutes
icon: mdi:timer
initial: 30
min: 0
max: 59
step: 1input_boolean:
alarm_1_weekday:
name: Giorni lavorativi
initial: on
icon: mdi:calendar
alarm_1_weekend:
name: Weekends
initial: off
icon: mdi:calendarsensor:
- platform: template
sensors:
alarm_1_time:
friendly_name: ‘Time’
value_template: >-
{{ “%0.02d:%0.02d” | format(states(“input_number.alarm_1_hour”) | int, states(“input_number.alarm_1_minutes”) | int) }}group:
alarm_1:
name: Sveglia Smart
entities:
- sensor.alarm_1_time
- input_number.alarm_1_hour
- input_number.alarm_1_minutes
- input_boolean.alarm_1_weekday
- input_boolean.alarm_1_weekendautomation:
- id: alarm_1_weekdays
alias: “Sveglia (giorni lavorativi)”
trigger:
- platform: time
minutes: ‘/1’
seconds: 0
condition:
- condition: state
entity_id: input_boolean.alarm_1_weekday
state: ‘on’
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: template
value_template: >-
{{ now().strftime(“%H:%M”) == states.sensor.alarm_1_time.state }}
action:
- data:
payload: ‘{“state”: “ON”, “brightness”: 0, “color”: {“r”: 0, “g”: 0, “b”: 255},
“effect”: “solid”}’
topic: lights/pcambiligh/set
service: mqtt.publish
- data:
brightness: 255
transition: 600
service: light.turn_on
- delay: 10
- data:
language: it
message: Buongiorno Davide, ti auguro una buona giornata.
service: tts.google_say
- delay: 5
- data:
entity_id: media_player.spotify
source: Camera
service: media_player.select_source
- data:
entity_id: media_player.spotify
media_content_id: spotify:user:spotify:playlist:22222323223
media_content_type: playlist
service: media_player.play_media
- id: alarm_1_weekend
alias: “Sveglia (weekend)”
trigger:
- platform: time
minutes: ‘/1’
seconds: 0
condition:
- condition: state
entity_id: input_boolean.alarm_1_weekend
state: ‘on’
- condition: time
weekday:
- sat
- sun
- condition: template
value_template: >-
{{ now().strftime(“%H:%M”) == states.sensor.alarm_1_time.state }}
action:
- data:
language: it
message: Bentornato a casa Davide, attivo tutte le automazioni.
service: tts.google_say
This automation works good, it let me set an alarm clock that light up my lights, but there is no way to tell google home mini to start a spotify playlist.
can you help me telling google home to start spotify playlist?
thanks