From 17c00727dda370f012001caa91c04fa9ebd70954 Mon Sep 17 00:00:00 2001 From: Martin Berg Date: Tue, 14 Nov 2017 12:57:39 +0100 Subject: [PATCH] Add doc for new changed_by attribute (#3650) --- .../_components/alarm_control_panel.spc.markdown | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/_components/alarm_control_panel.spc.markdown b/source/_components/alarm_control_panel.spc.markdown index 673e687fa3b..78e7066f00e 100644 --- a/source/_components/alarm_control_panel.spc.markdown +++ b/source/_components/alarm_control_panel.spc.markdown @@ -18,3 +18,19 @@ The `spc` alarm control panel platform allows you to control your [Vanderbilt SP The requirement is that you have setup your [SPC hub](/components/spc/). +The `changed_by` attribute enables one to be able to take different actions depending on who armed/disarmed the alarm in [automation](/getting-started/automation/). + +```yaml +automation: + - alias: Alarm status changed + trigger: + - platform: state + entity_id: alarm_control_panel.alarm_1 + action: + - service: notify.notify + data_template: + message: > + {% raw %}Alarm changed from {{ trigger.from_state.state }} + to {{ trigger.to_state.state }} + by {{ trigger.to_state.attributes.changed_by }}{% endraw %} +```