Fix notification message in socket blueprint

This commit is contained in:
2026-06-29 00:24:15 +01:00
parent 0f6e5fa089
commit 1dba5c2f14
@@ -35,13 +35,20 @@ blueprint:
unit_of_measurement: W
default: 1.0
notify_device:
name: Notification Action
description: The notification service to alert you when an active appliance is turned off.
name: Notification Device
description: Choose the mobile app device that should receive the notification.
selector:
action: {}
device:
integration: mobile_app
mode: restart
# Bridge blueprint inputs into variables so Jinja can read them
variables:
switch_target: !input target_switches
sensor_entity: !input power_sensor
zone_entity: !input home_zone
trigger:
- platform: zone
entity_id: !input home_zone
@@ -72,8 +79,17 @@ action:
entity_id: !input power_sensor
above: !input power_threshold
then:
- choose: []
default: !input notify_device
- domain: mobile_app
type: notify
device_id: !input notify_device
title: "⚠️ Appliance Safely Turned Off"
message: >-
{% set switch_entity = switch_target.entity_id if switch_target.entity_id is string else (switch_target.entity_id | first | default('')) %}
{% set name = state_attr(switch_entity, 'friendly_name') | default('An appliance') | lower %}
{% set area = area_name(switch_entity) | default('') %}
{% set zone_name = state_attr(zone_entity, 'friendly_name') | default('home') | lower %}
The {{ name }}{% if area %} in the {{ area | lower }}{% endif %} was actively drawing power when you left {{ zone_name }}. It has been shut down automatically. Please verify if this requires further attention.
# Turn off the target sockets
- action: switch.turn_off