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

Change sound if someone are home (multiple conditions in automation)

$
0
0

@Ekstrom wrote:

Hi!

I need to add multiple conditions to one automation. If “device_tracker.Mua_iphone” and “device_tracker.Mark_iphone” is “away” (everybody are away) I want to play the sound fanfar.mp3. If Mua_iphone are “home” i want to play MUA.mp3. If device_tracker.Mark_iphone are “home” I want to play MARK.mp3.

This is my automation on the front door today:

- id: '1570641644419'
  alias: Automation_Front_Door
  trigger:
  - entity_id: binary_sensor.sensor_front_door
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - service: media_player.play_media
    data_template:
      entity_id: media_player.baa
      media_content_id: http://soundking.com/sounds/fanfar.mp3
      media_content_type: audio/mp3
  - service: media_player.volume_set
    data_template:
      entity_id: media_player.baa
      volume_level: 0.5

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



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