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:
- Attach an NFC tag to the bin.
- Register the tag with Home Assistant.
- Create automation in Home Assistant using Node-RED
- 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:
- Launch the Home Assistant app.
- Go to ‘Settings.’
- Select ‘Tags.’
- Add a new tag and give it a name (in this example, I used “bins”).
- 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:
- Capture the NFC tag scanning event.
- Send a notification if the tag has not been scanned.
- Reset the notification cycle for the next bin collection day.
Capturing the NFC Tag Scanning Event
- Launch Node-RED in Home Assistant and create a new tab for the bins automation.
- Drag a ‘Tag’ node from the left pane into the workspace.
- Double-click on the node to configure it.
- Name the node (e.g., “Tap Bin Tag”) and select your registered NFC tag (e.g., “bins”).
- Click ‘Done.’
Sending a Notification if the Tag has not been Scanned
- Drag an ‘Inject’ node into the workspace.
- Configure the node with a name (e.g., “Notify when bin is full”).
- Set the node to repeat every hour between the hours you want to receive reminders (e.g., 7 a.m. to 12 p.m.).
- Select the appropriate day(s) of the week for your bin collection (e.g., Wednesdays).
- Connect the ‘Tag’ node to the ‘Inject’ node.
Next, we’ll use a ‘Switch’ node to check the status of the bin tag:
- Drag a ‘Switch’ node into the workspace.
- Configure the node with a name (e.g., “Notify if bin tag is no”).
- Set the variable to the flow variable of your choice (e.g., “flow.bin_tapped”).
- Set the comparison value to “no” (indicating the NFC tag has not been scanned).
- Connect the ‘Inject’ node to the ‘Switch’ node.
Lastly, we’ll create a notification for your phone:
- Drag a ‘Call Service’ node into the workspace.
- Configure the node with a name (e.g., “Notify bins are late”).
- 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”).
- Set an appropriate title for the notification (e.g., “Bin emergency”).
- 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:
- Drag an ‘Inject’ node into the workspace.
- Configure the node with a name (e.g., “Reset tag variable”).
- 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”:
- Drag a ‘Change’ node into the workspace.
- Configure the node with a name (e.g., “Reset tag variable”).
- Set the variable to the appropriate flow variable (e.g., “flow.bin_tapped”).
- Set the value to “no”.
- 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!