# Alarm system for portable item

**URL:** <https://discourse.nodered.org/t/alarm-system-for-portable-item/61731>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [24 April 2022 20:14 UTC](https://discourse.nodered.org/t/alarm-system-for-portable-item/61731 "2022-04-24T20:14:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smitterer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smitterer/32/59179_2.png) [@smitterer](https://discourse.nodered.org/u/smitterer)\
**Post date:** [24 April 2022 20:14 UTC](https://discourse.nodered.org/t/alarm-system-for-portable-item/61731/1 "2022-04-24T20:14:10Z")

</div>

Hi,

I'm planning on creating an alarm system for a portable device.

Externally, in Home Assistant, I set an alarm to be on or off. When its state changes to armed, I want Node-Red to take the current location of the device (taken from Home Assistant) and set it as the current location / the one which is ok +- some meters around it.

When the GPS location gets out of the last message taken and therefore set as the "one which is ok", I want Node-Red to trigger the alarm.

How would I set the location till it's overwritten again? Maybe also externally in Home Assistant?

Do you have an idea on how to use node-red-node-geofence to dynamically set the geofence using the previously taken location or do you have any other idea on how to achieve that?

Thanks!

---

<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:** [23 June 2022 20:15 UTC](https://discourse.nodered.org/t/alarm-system-for-portable-item/61731/2 "2022-06-23T20:15:07Z")

</div>

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