Xbox Achievement Unlocked
Detects when the user unlocks an achievement (gamer score increases) on Xbox Live, then you can run any desired action (flash lights, play mp3 files, activate scenes).
Since it’s based on Xbox Live cloud services it should support any platform (Xbox, PC, XCloud).
Requirements:
- Xbox Integration
- Xbox Gamer Score entity, by default the integration comes with this entity disabled and you’ll need to manually enable it.
Optional:
- Conditional sensor, the actions will only be performed if this entity status in ‘on’ or ‘home’.
Credits to /u/zjleblanc on Reddit for sharing his automation.
Blueprint Code
Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)
Or import this Blueprint by using the forum topic / Gist URL:
blueprint:
name: Xbox Achievement Unlocked
description: |
## Xbox Achievement Unlocked 2022.01
Detects when the user unlocks an achievement (gamer score increases) on Xbox Live, then you can run any desired action (flash lights, play mp3 files, activate scenes).
Since it's based on Xbox Live cloud services it should support any platform (Xbox, PC, XCloud).
### Requirements:
- [Xbox Integration][1]
- Xbox Gamer Score entity, by default the integration comes with this entity disabled and you'll need to manually enable it.
### Optional:
- Conditional sensor, the actions will only be performed if this entity status in 'on' or 'home'.
Credits to [/u/zjleblanc][2] on Reddit for sharing his automation.
[1]: https://www.home-assistant.io/integrations/xbox
[2]: https://www.reddit.com/r/homeassistant/comments/rrgwqo/xbox_achievement_unlocked_automation/
domain: automation
source_url: https://gist.github.com/cvroque/27d2add657cbdf0651aee4394cc15ca2#file-xbox_achievement-yaml
input:
trigger_entity:
name: User Game Score
description: Choose entity named "YOURGAMERTAG Gamer Score"
selector:
entity:
domain: sensor
integration: xbox
condition_entity:
name: (Optional) Condition
description: Only perform actions if selected entity is 'on' or 'home'.
default: []
selector:
entity: {}
actions:
name: Actions
description: Actions (e.g. flash lights, start scenes, play sounds...)
default: []
selector:
action: {}
variables:
condition_entity: !input 'condition_entity'
trigger:
- platform: state
entity_id: !input trigger_entity
condition:
- condition: template
value_template: '{{ trigger.to_state.state | float(0) > trigger.from_state.state | float(0) }}'
- condition: template
value_template: '{{ trigger.from_state.state | float(0) > 1 }}'
- condition: template
value_template: '{{ states(condition_entity) in [''unknown'', ''on'', ''home'']}}'
action:
- choose: []
default: !input 'actions'
mode: queued
max_exceeded: silent