I’m trying to use the epic games integration along with notify.discord to send a notification to everyone in my server when a new free game is available on epic.
alias: Epic Games New Games Notification
trigger:
- platform: state
entity_id: sensor.epic_games
action:
- service: notify.disc_assistant
data:
message: ""
target: '87285139647683840'
data_template:
embed:
title: 'Free Epic Games'
url: 'https://store.epicgames.com/en-US/free-games'
color: 199363
image:
url: 'https://www.macobserver.com/wp-content/uploads/2020/06/Epic-games-logo.jpg'
fields:
Im not quite sure what i need to put into the fields section though. Before bothering anyone i decided to see if gpt could give me the answer i was looking for but that didn’t work. This was its response.
fields:
{% set games = trigger.to_state.attributes.games %}
{% for game in games %}
- name: '{{ game.title }}'
value: >
Rating: {{ game.rating }}
Release Date: {{ game.release }}
Runtime: {{ game.runtime }}
Studio: {{ game.studio }}
inline: false
{% endfor %}
Would really appreciate help getting this one going and thanks in advance.
Edit: Here is the attribute data I’m getting for the sensor.
data:
- title_default: $title
line1_default: $rating
line2_default: $release
line3_default: $runtime
line4_default: $studio
icon: mdi:arrow-down-bold
- title: Idle Champions of the Forgotten Realms
poster: >-
https://cdn1.epicgames.com/offer/7e508f543b05465abe3a935960eb70ac/IdleChampions_FreeGamesPromo_1200x16001_1200x1600-764258f78394b9f79815bbd9010e8454
rating: N/A
synopsis: >-
Idle Champions is a licensed Dungeons & Dragons strategy management video
game uniting iconic characters from novels, campaigns, and shows into one
epic adventure.
studio: Codename Entertainment
runtime: '2021-02-16'
release: $date
airdate: '2021-02-16'
- title: 'theHunter: Call of the Wild™'
poster: >-
https://cdn1.epicgames.com/salesEvent/salesEvent/EGS_theHunterCalloftheWild_ExpansiveWorlds_S2_1200x1600-1e9b46aaabc33fe0a08cf5b418e76ba2
rating: N/A
synopsis: >-
Experience an atmospheric hunting game like no other in this realistic and
visually breathtaking open world. Immerse yourself in the atmospheric single
player campaign, or share the ultimate hunting experience with friends.
studio: Expansive Worlds AB
runtime: '2021-11-18'
release: $date
airdate: '2021-11-18'
- title: Guacamelee! Super Turbo Championship Edition
poster: >-
https://cdn1.epicgames.com/spt-assets/7041a1ca4ed543459b95d78887047bd9/guacamelee-stce-ztldk.jpg
rating: '80'
synopsis: >-
Guacamelee! is a Metroidvania-style action-platformer set in a magical
Mexican-inspired world. The game draws its inspiration from traditional
Mexican culture and folklore, and features many interesting and unique
characters.
studio: Drinkbox Studios Inc.
runtime: '2023-06-08'
release: $date
airdate: '2023-06-08'
- title: Guacamelee! 2
poster: >-
https://cdn1.epicgames.com/spt-assets/b05acd7d28d34f6d93a961b0e53ddf0b/guacamelee-2-1lym2.jpg
rating: '84'
synopsis: >-
Head back to the Mexiverse in this long-awaited sequel to the smash hit
Guacamelee! Uppercut your way to victory across stunning new hand-crafted
levels. Featuring a dense and colorful world, new luchador moves, sassy new
bosses, twice the enemies, and 300% more chickens!
studio: Drinkbox Studios Inc.
runtime: '2023-06-08'
release: $date
airdate: '2023-06-08'
- title: PAYDAY 2
poster: >-
https://cdn1.epicgames.com/offer/d5241c76f178492ea1540fce45616757/mammoth-h1nvv_2560x1440-ac346d6ece5ec356561e112fbddb2dc1
rating: '79'
synopsis: >-
PAYDAY 2 is an action-packed, four-player co-op shooter that once again lets
gamers don the masks of the original PAYDAY crew - Dallas, Hoxton, Wolf and
Chains - as they descend on Washington DC for an epic crime spree.
studio: Epic Dev Test Account
runtime: '2023-06-01'
release: $date
airdate: '2023-06-01'