I’m using the Nintendo Wishlist component which is able to track the price of games in the nintendo eshop. The component creates a sensor for each game which is on the list. Each sensor has the state 0 if the game is not on sale and 1 if the game is on sale. Each has a name like:
on_sale:
unit_of_measurement: on sale
friendly_name: Nintendo Wishlist game a
icon: mdi:nintendo-switch
custom_ui_state_card: state-card-custom-ui
on_sale:
unit_of_measurement: on sale
friendly_name: Nintendo Wishlist game b
icon: mdi:nintendo-switch
custom_ui_state_card: state-card-custom-ui
I want to create a notification based on the change of the state of the sensor. In the notification I want to see the name of the game. How can I archieve this?
I’ve created a basic notification but dont know how to geht the name from friendly_name of the game which is on sale in the text and how to use a wildcard in the entity id.
- alias: 'Benachrichtigung wenn eShop Angebot.'
trigger:
platform: numeric_state
entity_id: sensor.nintendo_wishlist_onimusha
above: 0
action:
service: notify.ios_my_devices
data:
title: "Nintendo eShop Angebot:"
message: "Neues Spiel im Angebot"
Can someone give me a hint about what to do next?
Thank you in advance
Note:
This assumes the sensor returns a number (most return a string)
if unsure / if a string is returned, you can then remove the above: 0 line and add a condition:
if you mean you can’t trigger the automation manually, then yes it’s correct. as the automation was not triggered by a state change, {{ trigger.entity_id is invalid and therefore the automation fails to run
You can always manually set an entity’s state (Developer Tools > States > Set State) to trigger an automation
I change the value from one of the entities to 1.
The automation is triggered but i dont get the value of “friendly_name”. When I delete {{ trigger.entity_id.attributes.friendly_name }} I get the the notification.