Created
February 8, 2020 08:14
-
-
Save DavidDeSloovere/669fc055a2eba713534fb59ba9919d19 to your computer and use it in GitHub Desktop.
Home Assistant automation for Magic Cards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- alias: Play Station from Magic Cards | |
trigger: | |
- platform: event | |
event_type: magic_card_scanned | |
event_data: | |
card_type: station | |
action: | |
# - service: notify.group_deef | |
# data_template: | |
# title: "Magic Cards {{ trigger.event.data.card_code }}" | |
# message: "Station Card URI was {{ trigger.event.data.card_uri }}" | |
- service: system_log.write | |
data_template: | |
message: "Station Card URI was {{ trigger.event.data.card_uri }}" | |
level: info | |
logger: custom.magic_cards | |
# 2019-08-16 16:26:52 INFO (MainThread) [custom.magic_cards] Station Card URI was kitchen|VRT Studio Brussel 94.5 (Modern Rock) | |
- service: media_player.select_source | |
data_template: | |
entity_id: "media_player.{{ trigger.event.data.card_uri.split('|')[0] }}" | |
source: "{{ trigger.event.data.card_uri.split('|')[1] }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment