I have created an alert if any of my windows are opened (using a helper I created for a separate alert) if the forecast is raining etc but in the alert I would like the actual state e.g. raining, pouring, snowing, does anyone know how I can do this? Below is the code I created via the UI:
alias: Rain alert + window opened notif
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.living_room_window_left_opening
- binary_sensor.living_room_window_right_opening
- binary_sensor.kitchen_window_opening
- binary_sensor.bedroom_one_window_left_opening
- binary_sensor.bedroom_one_window_right_opening
from: "off"
to: "on"
condition:
- condition: device
device_id: XXXX
domain: device_tracker
entity_id: d272519f302aedf87c0b3cffa3c14a15
type: is_not_home
enabled: false
- condition: or
conditions:
- condition: state
entity_id: weather.forecast_home
state: lightning-rainy
- condition: state
entity_id: weather.forecast_home
state: rainy
- condition: state
entity_id: weather.forecast_home
state: pouring
- condition: state
entity_id: weather.forecast_home
state: snowy-rainy
- condition: state
entity_id: weather.forecast_home
state: snowy
action:
- device_id: XXXXXYYYY
domain: mobile_app
type: notify
message: >-
{{ trigger.to_state.attributes.friendly_name }} has been opened while
raining
mode: single
Thanks!
Chris