:::: MENU ::::

Using NFC tags in Home Assistant – Never forget bin day again!

This blog post is based on a transcript from a YouTube video that demonstrates a practical example of using NFC tags and Home Assistant to help you remember to take the bins out.

Do you often forget to put your bins out on the curb for collection? In this blog post, I will show you how to use NFC tags and Home Assistant to create a simple reminder system so that you never forget to take the bins down again.

NFC Tags and Home Assistant

Near Field Communication (NFC) tags are small, passive chips that do not require power. They can be activated when they come into contact with a compatible device, like a smartphone. In this example, we’ll attach an NFC tag to a bin and use Home Assistant to create an automation that reminds us to take the bins out.

Here’s an overview of the process:

  1. Attach an NFC tag to the bin.
  2. Register the tag with Home Assistant.
  3. Create automation in Home Assistant using Node-RED
  4. Set a reminder cycle for the bin collection day.

Attaching the NFC Tag

First, you’ll need to pick an NFC tag that can stick onto your bin. In this example, I used a flat NFC tag and adhered it to the side of the bin with a strong adhesive.

Registering the NFC Tag with Home Assistant

To register the NFC tag with Home Assistant, you will need to use the Home Assistant phone app. Make sure your phone is NFC-compatible and follow these steps:

  1. Launch the Home Assistant app.
  2. Go to ‘Settings.’
  3. Select ‘Tags.’
  4. Add a new tag and give it a name (in this example, I used “bins”).
  5. Tap ‘Create and Write,’ then tap your phone to the NFC tag attached to the bin.

This will now register the NFC tag with Home Assistant and trigger an event when the tag is scanned.

Creating the Automation in Home Assistant with Node-RED

In this section, we will set up the automation that will remind us to take out the bins using Node-RED, a popular visual programming tool for Home Assistant. If you’re not familiar with Node-RED, check out this introductory video.

We will need to do three things with our automation:

  1. Capture the NFC tag scanning event.
  2. Send a notification if the tag has not been scanned.
  3. Reset the notification cycle for the next bin collection day.

Capturing the NFC Tag Scanning Event

  1. Launch Node-RED in Home Assistant and create a new tab for the bins automation.
  2. Drag a ‘Tag’ node from the left pane into the workspace.
  3. Double-click on the node to configure it.
  4. Name the node (e.g., “Tap Bin Tag”) and select your registered NFC tag (e.g., “bins”).
  5. Click ‘Done.’

Sending a Notification if the Tag has not been Scanned

  1. Drag an ‘Inject’ node into the workspace.
  2. Configure the node with a name (e.g., “Notify when bin is full”).
  3. Set the node to repeat every hour between the hours you want to receive reminders (e.g., 7 a.m. to 12 p.m.).
  4. Select the appropriate day(s) of the week for your bin collection (e.g., Wednesdays).
  5. Connect the ‘Tag’ node to the ‘Inject’ node.

Next, we’ll use a ‘Switch’ node to check the status of the bin tag:

  1. Drag a ‘Switch’ node into the workspace.
  2. Configure the node with a name (e.g., “Notify if bin tag is no”).
  3. Set the variable to the flow variable of your choice (e.g., “flow.bin_tapped”).
  4. Set the comparison value to “no” (indicating the NFC tag has not been scanned).
  5. Connect the ‘Inject’ node to the ‘Switch’ node.

Lastly, we’ll create a notification for your phone:

  1. Drag a ‘Call Service’ node into the workspace.
  2. Configure the node with a name (e.g., “Notify bins are late”).
  3. Set the domain to ‘notify,’ the service to your phone’s model (e.g., ‘Pixel 7 Pro’), and the message to a reminder (e.g., “The bins need to be at the road”).
  4. Set an appropriate title for the notification (e.g., “Bin emergency”).
  5. Connect the ‘Switch’ node to the ‘Call Service’ node.

Resetting the Notification Cycle

In this final step, we’ll create another ‘Inject’ node to reset the bin tag variable each week:

  1. Drag an ‘Inject’ node into the workspace.
  2. Configure the node with a name (e.g., “Reset tag variable”).
  3. Set the node to repeat at a specific time once a week, after your bins have been emptied (e.g., 2 p.m. on Wednesdays).

Now, connect a ‘Change’ node to set the bin tag variable back to “no”:

  1. Drag a ‘Change’ node into the workspace.
  2. Configure the node with a name (e.g., “Reset tag variable”).
  3. Set the variable to the appropriate flow variable (e.g., “flow.bin_tapped”).
  4. Set the value to “no”.
  5. Connect the ‘Inject’ node to the ‘Change’ node.

Final Thoughts

Now you have a smart bin reminder system using NFC tags and Home Assistant that will notify you to take the bins out on the scheduled collection day. If you have found this tutorial helpful, please subscribe to my channel, like the video, and share it with others.

Do you have any other Home Assistant automation ideas using NFC tags? Share in the comments below!