# Home assistance alarm node red trigger notification

**URL:** https://discourse.nodered.org/t/home-assistance-alarm-node-red-trigger-notification/24630
**Category:** General
**Created:** [11 April 2020 08:47 UTC](https://discourse.nodered.org/t/home-assistance-alarm-node-red-trigger-notification/24630 "2020-04-11T08:47:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bhyatyab](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@bhyatyab](https://discourse.nodered.org/u/bhyatyab)
#### Post date: [11 April 2020 08:47 UTC](https://discourse.nodered.org/t/home-assistance-alarm-node-red-trigger-notification/24630/1 "2020-04-11T08:47:53Z")

</div>

Hi. I’m using node red for my home assistant alarm. I’m trying to integrate [Automations](https://github.com/akasma74/Hass-Custom-Alarm/blob/fdd4ef84d20e6067f153eeeeac93b2792c0d1d50/custom_components/bwalarm/resources/doc/examples/automations.yaml) into my flows.

I’m using a function node link to an email node, The email subjects works. the email body shows the below text instead of the alarm trigger

Copy to clipboard

```auto
{"data":{"message":"ALARM TRIGGERED!!! {{ states[states.alarm_control_panel.house.attributes.changed_by.split(\".\")[0]][states.alarm_control_panel.house.attributes.changed_by.split(\".\")[1]].name }}"}}

```

Below is my function node code.

Copy to clipboard

```auto
msg.topic = "Home Assistant - Alert - Automation"
msg.payload = { "data": {message: 'ALARM TRIGGERED!!! {{ states[states.alarm_control_panel.house.attributes.changed_by.split(".")[0]][states.alarm_control_panel.house.attributes.changed_by.split(".")[1]].name }}'} }
return msg;

```

Please help me fix my code so it shows which sensor triggered the alarm

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [10 June 2020 08:53 UTC](https://discourse.nodered.org/t/home-assistance-alarm-node-red-trigger-notification/24630/2 "2020-06-10T08:53:25Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
