# Push notification when status changes with status

**URL:** <https://community.smartthings.com/t/push-notification-when-status-changes-with-status/87233>\
**Category:** webCoRE\
**Created:** [May 12, 2017, 9:17pm UTC](https://community.smartthings.com/t/push-notification-when-status-changes-with-status/87233 "2017-05-12T21:17:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![GRClark](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/grclark/32/44774_2.png) [@GRClark](https://community.smartthings.com/u/GRClark)\
**Post date:** [May 12, 2017, 9:17pm UTC](https://community.smartthings.com/t/push-notification-when-status-changes-with-status/87233/1 "2017-05-12T21:17:06Z")

</div>

Is there a way to create a piston that sends a push notification every time the status changes which will also include what the current status is in the notification? Right now I’m using a smart app to notify me of changes, but it doesn’t include the status.

 ![](https://global.discourse-cdn.com/smartthings/original/3X/c/4/c42112adca559e945f53494a1b0b67f92271f0fc.PNG)

---

<div class="post-metadata">

**Author:** ![destructure00](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/destructure00/32/87397_2.png) [@destructure00](https://community.smartthings.com/u/destructure00)\
**Post date:** [May 12, 2017, 10:41pm UTC](https://community.smartthings.com/t/push-notification-when-status-changes-with-status/87233/2 "2017-05-12T22:41:26Z")

</div>

Sure, add a new Basic piston like the following:

```auto
If 
    [presence sensor] changes
then
    using location, send push notification "{$currentEventDevice} is {$currentEventValue}"
```

This will produce a push notification that says “So-and-so is present” or “So-and-so is not present”

Alternately, you could do something like this with a Simple piston where you enter your own text:

```auto
if 
    [presence sensor] is present
then 
    using location, send push notification "So-and-so arrived at home"
else
    using location, send push notification "So-and-so left home"
```

---

<div class="post-metadata">

**Author:** ![GRClark](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/grclark/32/44774_2.png) [@GRClark](https://community.smartthings.com/u/GRClark)\
**Post date:** [May 12, 2017, 11:58pm UTC](https://community.smartthings.com/t/push-notification-when-status-changes-with-status/87233/3 "2017-05-12T23:58:52Z")

</div>

My apologies for not being more clear - I was actually looking for notifications about the location status.

---

<div class="post-metadata">

**Author:** ![destructure00](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/destructure00/32/87397_2.png) [@destructure00](https://community.smartthings.com/u/destructure00)\
**Post date:** [May 13, 2017, 4:17pm UTC](https://community.smartthings.com/t/push-notification-when-status-changes-with-status/87233/4 "2017-05-13T16:17:08Z")

</div>

Ah ok. Try this then. $locationMode is a system variable in CoRE that shows the current mode.

```auto
If
    [presence sensor] changes
Then
    using location, send push notification "mode is {$locationMode}"
```

---

<div class="post-metadata">

**Author:** ![GRClark](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/grclark/32/44774_2.png) [@GRClark](https://community.smartthings.com/u/GRClark)\
**Post date:** [May 18, 2017, 7:02pm UTC](https://community.smartthings.com/t/push-notification-when-status-changes-with-status/87233/5 "2017-05-18T19:02:26Z")

</div>

How do I set the variable? Do I need to first put it into the global variables section?

---

<div class="post-metadata">

**Author:** ![GRClark](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/grclark/32/44774_2.png) [@GRClark](https://community.smartthings.com/u/GRClark)\
**Post date:** [May 19, 2017, 12:19am UTC](https://community.smartthings.com/t/push-notification-when-status-changes-with-status/87233/7 "2017-05-19T00:19:26Z")

</div>

Thank you so much!

---

<div class="post-metadata">

**Author:** ![GRClark](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/grclark/32/44774_2.png) [@GRClark](https://community.smartthings.com/u/GRClark)\
**Post date:** [May 20, 2017, 4:34pm UTC](https://community.smartthings.com/t/push-notification-when-status-changes-with-status/87233/8 "2017-05-20T16:34:26Z")

</div>

I was wondering if anyone could tell me what other system variables are available to use?
