# Using NFC tag as override for other automations

**URL:** <https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832>\
**Category:** General\
**Created:** [17 September 2022 05:41 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832 "2022-09-17T05:41:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![melch98](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@melch98](https://discourse.nodered.org/u/melch98)\
**Post date:** [17 September 2022 05:41 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/1 "2022-09-17T05:41:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/50cfcde5942c7eb83e04ed92d1be7d05efb959af.png)

Hi,

I have the light automations setup in the photo attached.

I want to be able to use an NFC tag to disable the automations in this flow so I can set a scene for all the lights in my room so even if I walk past a sensor it will keep its current state that I have set in the scene. Then use the same or a different NFC tag to enable the automations again. I am new to Node Red and am having issues finding a solution for this.

Appreciate any help

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [18 September 2022 14:36 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/2 "2022-09-18T14:36:36Z")

</div>

Hi @melch98 Welcome to Forums!

I may sound BIAS here - but do you happen to use an iOS device?  
If so - the shortcuts application can kick off a web request when it comes into contact with an NFC tag.

you can use this ability to send Node RED a request.

---

<div class="post-metadata">

**Author:** ![melch98](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@melch98](https://discourse.nodered.org/u/melch98)\
**Post date:** [19 September 2022 10:04 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/3 "2022-09-19T10:04:51Z")

</div>

Hi Marcus, thanks for the reply.

I currently have an android phone.

I was looking to use the toggle node to take an input from the nfc tag then use that state as a condition

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [19 September 2022 10:13 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/4 "2022-09-19T10:13:56Z")

</div>

This is what you would need to do.

Find an application on the Android platform, that is capable of listening for NFC tags.  
This application, should allow you to trigger things to happen on such android device.

Trigger what exactly?  
Send a HTTP request to Node RED.

Node RED has the `HTTP IN` node, and you do what you need to, when the HTTP request comes in.

On the iOS platform - we have a shortcuts app, that allows to automate things given a trigger (such as coming into contact with an associated tag) one can send a HTTP request when this triggers.

I don't know what is available for Android in that respect - so hopefully someone can chip in.

in nut shell

- Set up a `HTTP IN` node to do things when a request is made
- Have your android device send this request, when it detects the NFC

EDIT:  
If this.

> <https://play.google.com/store/apps/details?id=com.llamalab.automate&hl=en_GB&gl=US>
>
> Automate almost any task on your devic...

Can trigger a http request, when it detects an NFC - it should get you going (and is 95% of the way there)

---

<div class="post-metadata">

**Author:** ![melch98](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@melch98](https://discourse.nodered.org/u/melch98)\
**Post date:** [19 September 2022 11:19 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/5 "2022-09-19T11:19:21Z")

</div>

![Screenshot_20220919-211222_Home Assistant](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/1/e1a67bbf5ee8685479909f066c7381033438af5f.jpeg)  
I am able to trigger the nfc tag for this automation and am able to output true on false with the toggle node but am not sure how to use this as an override in my automations

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [19 September 2022 11:50 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/6 "2022-09-19T11:50:19Z")

</div>

> [@melch98](#):
>
> but am not sure how to use this as an override in my automations

Sky's the Limit!

Maybe store the output from the `toggle` node in a global variable (you can do this with a `change` node)

To make use of this variable...  
Put a `switch` node before any of your actions - so the `switch` node will only allow a message to pass if the variable is of a certain value

---

<div class="post-metadata">

**Author:** ![melch98](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@melch98](https://discourse.nodered.org/u/melch98)\
**Post date:** [19 September 2022 12:42 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/7 "2022-09-19T12:42:03Z")

</div>

I am having some issues using the toggle as it only takes in a msg.payload

Not sure how I can toggle with my own variable and link with the automation.

Again thanks for your help

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [19 September 2022 12:51 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/8 "2022-09-19T12:51:17Z")

</div>

You don't have to send anything yourself to the toggle node - you're already doing that from your tag output (at least according to your screenshot)

What I mean is, store the "true" / "false" output from it into a variable, and use that variable later to decide if an automation should occur using a `switch` node

EDIT:  
See rudimentary example below.

```auto
[{"id":"2825c99144e4da06","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"331994428e895cea","type":"inject","z":"2825c99144e4da06","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":150,"y":340,"wires":[["a87240968ef305bc"]]},{"id":"5acf9bb884275c06","type":"inject","z":"2825c99144e4da06","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":150,"y":440,"wires":[["a87240968ef305bc"]]},{"id":"a87240968ef305bc","type":"change","z":"2825c99144e4da06","name":"Set Variable","rules":[{"t":"set","p":"ShouldAutomate","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":380,"wires":[[]]},{"id":"cfa56a42589a2b15","type":"inject","z":"2825c99144e4da06","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":160,"wires":[["50f88c6c50658a82"]]},{"id":"d0dec19452e383bb","type":"debug","z":"2825c99144e4da06","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":160,"wires":[]},{"id":"50f88c6c50658a82","type":"switch","z":"2825c99144e4da06","name":"","property":"ShouldAutomate","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":370,"y":160,"wires":[["d0dec19452e383bb"]]},{"id":"15620a9fd398be24","type":"comment","z":"2825c99144e4da06","name":"This emulates your toggle","info":"","x":190,"y":300,"wires":[]},{"id":"1f632c63741d8b09","type":"comment","z":"2825c99144e4da06","name":"Will only pass if ShouldAutomate = true","info":"","x":390,"y":120,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![melch98](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@melch98](https://discourse.nodered.org/u/melch98)\
**Post date:** [23 September 2022 05:46 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/9 "2022-09-23T05:46:02Z")

</div>

Ok thanks for that Marcus I got it all working thanks a bunch

---

<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:** [7 October 2022 05:46 UTC](https://discourse.nodered.org/t/using-nfc-tag-as-override-for-other-automations/67832/10 "2022-10-07T05:46:06Z")

</div>

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