Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95399

Help with automation and trigger

$
0
0

@msahar wrote:

I want to listen jingle bells at 9 AM every Friday, Saturday, and Sunday. Below are the code spinets from configuration and automation files. I am not able to achieve this despite several attempts. I would be grateful if anybody point out what is wrong with my code. Thanks

configuration.yaml

binary_sensor:
  - platform: workday
    country: AU
    workdays: [fri, sat, sun]

automation.yaml

#################### Jingle Music ####################
- alias: 'Jingle Bells'
  trigger:
     platform: time
     at: '09:00:00'
  condition:
      condition: state
      entity_id: 'binary_sensor.workday_sensor'
      state: 'on'
  action:
   - data:
       entity_id: "media_player.sahar_google_mini"
       media_content_id: "https://incompetech.com/music/royalty-free/mp3-royaltyfree/Jingle%20Bells%203.mp3"
       media_content_type: "music"
     service: media_extractor.play_media
   - data:
       entity_id: media_player.sahar_google_mini
       volume_level: '0.7'
     service: media_player.volume_set

Best Regards,
Sahar

Posts: 4

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95399

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>