Using multiple entity attributes in a notify message

Hi. I’d like to get a message with the reason why my sunscreen closed (can be multiple reasons, sunset, rain, wind speed, etc.).

How can one use multiple entity attributes in a notify message please?

Expecting:
Sunscreen closed. OpenWeatherMap Wind speed is now 33 km/h.

Getting:
Sunscreen closed. OpenWeatherMap Wind speed is now 33 33

Message

service: notify.my_phone
data:
  message: >-
    Sunscreen closed. {{ state_attr(trigger.entity_id, 'friendly_name') }}
    is now {{ states(trigger.entity_id) }} {{ states(trigger.entity_id,
    'unit_of_measurement') }}

Entity + attributes: sensor.openweathermap_wind_speed
state_class: measurement
unit_of_measurement: km/h
attribution: Data provided by OpenWeatherMap
device_class: wind_speed
friendly_name: OpenWeatherMap Wind speed

Any pointers are welcome!

PS Found this, but it I could not fix the problem with it: Working with the trigger object - #4 by Didgeridrew

It is usually unnecessary to use the states() or state_attr() function on the trigger variable.

Assuming you are using a state trigger

service: notify.my_phone
data:
  message: >-
    Sunscreen closed. {{ trigger.to_state.attributes.friendly_name }}
    is now {{ trigger.to_state.state }} {{ trigger.to_state.attributes.unit_of_measurement }}
1 Like

Works like a charm! Thank you, you thought me a new concept today.