Hass NFC - Control Home Assistant with NFC tags


#1

Hi all,

I had a few NFC tags (cards, wrist bands, ketchains) laying around, and I purchased a new Android phone with NFC. So I was thinking, wouldn’t it be fun and easy to control Home Assistant with those tags?!

I’ve done some searching, and it’s already possible, but the current solutions are not working the way I like. You need to have 2-3 apps installed to configure the tags, and read them, and send a signal to Home Assistant.

So that’s why I’ve been working on Hass NFC; an Android app that reads specific tags (with a certain mimetype so only those trigger my app and nothing else) and fires a script on Home Assistant. Setting up the tags is very easy. All you need to write on it is the name of the script you would like to trigger.

When Hass NFC finds a NFC tag it sends a signal to the Home Assistant API and turns on the script that’s written on the tag.

Hass NFC securely saves your Home Assistant URL and API password which it uses for every call.

A good purpose for this app is to for example turn off your lights when you go to bed. Put a NFC tag on your bed table and simply put your phone on it when you go to sleep. The app then calls a Home Assistant script which turns off your lights.

Obviously the purposes are endless because you decide what happens in the script that you trigger.

You can download it in the Play Store: https://play.google.com/store/apps/details?id=com.gerbenbol.hassnfc


#2

I’d be interested in having a look for sure!


#3

Cool. Could you PM me your email or something I can send an .apk to?

Just built the write function as well in the app! So now you can read and write with just one app. Really pleased with it so far.


#4

Sounds great. How about making this an open source project at GitHub? There you could also publish the APKs for everybody to download at no cost. Just like the WallPanel project for example.


#5

PM’d you my details.


#6

I’d be very interested in this, very nice idea. I’ve got loads of NFC tags hanging around the house too would be nice to make use of them.


#7

That’s a good idea indeed. I’m not sure yet though. I also like the idea of putting it in the store for a buck or two so I make small cash for my efforts… I’ll have to think about it!


#8

Cool. I’ve sent Craig an .apk to test. I’ll continue tomorrow on the app I think and maybe put it in the store or upload the .apk somewhere. Not sure what I’m gonna do right now.

I’ll post here when there’s news!


#9

Just wanted to share that the app worked great! Programming a tag was simple and it worked without any issues once I used a good tag :slight_smile:


#10

Very interesting.


#11

I’m interested in this as well. I’ve experimented with Tasker with an NFC plugin, but it’s relatively fiddly and it would be nice to have a single app that made it easier.

I also think you could combine the Play store with having it on Github.

Some users will be willing to sideload an APK they’ve downloaded, but I’m sure most would prefer to use the Play store. I know I’m reluctant to open up my phone to sideloaded apps - even if I trust the particular app I’ve done that for, changing the setting opens up a potential security hole for other apps to exploit.

The Play store also makes it easier to keep the app updated automatically, so I think even if you publish it on Github you’ll still get interest via the Play Store as well.


#12

I’d be happy to buy the Play Store copy if you made it Open Source!


#13

Hi guys, thanks for your interest in this. I’ve been working with Craig and fixed some bugs and added some features.

I am planning to release it in the store soon, so you will be able to try it out there.

What would you be comfortable paying for it? I’m thinking about 0.99 or 1.99, or maybe for free with limited features and some kind of unlocker for a few bucks. I’m mainly trying to get the Google play costs out of it, so I’m not planning to sell it for 10 bucks or something, don’t worry.

About making it open-source, not sure about that. I’m first planning to release it in the store and gathering some feedback before I continue.


#14

I think a dollar sounds fair, but in the big picture 2 bucks isn’t bad either.

Can’t wait, I’ll keep an eye out!


#15

Sounds good to me, as long as it’s available in the UK :wink:


#16

Thanks for the feedback guys! Just released it to the store! It’s my first ever app, so be gentle please. :stuck_out_tongue:

Any feedback is welcome!

Link: https://play.google.com/store/apps/details?id=com.gerbenbol.hassnfc


#17

I purchased the app, cool!

I’ve entered my url (I have no port in my public url, is that ok??) and password. I enabled api component. I have some shell scripts inside my scripts folder.

In the Android app, I don’t see any scripts in the drop down, also when I manually write a name, nothing happens I can tell aside from a toast message “sent”.

Can you provide a full concise example?


#18

Thanks @ralfaro

If you have no port in your public URL that should be fine. Do you see the scripts in your HASS main page?

Have you also entered the password that you also have in your HTTP component? Or when you go to https://yourpublic-url.com/dev-state do you see any entities starting with ‘script.’?

if you see nothing in the dropdown there’s a big chance it will not work manually either. The dropdown should load all scripts that it can find. Also check your HASS log for errors about a wrong password for example.


#19

My mistake @Gerben321… I got confused with my sensors that use command-line scripts.

I’ll add a script component (https://www.home-assistant.io/components/script/) and test again.

My public endpoint + /api/?api_password=xxx shows me {"message": "API running."}, so I’m good there. Thanks! :slight_smile:

EDIT:
It works like a charm! Thanks :sunglasses:


#20

Haven’t tried it out yet, but sounds promising. Reading the description there’s one thing that can be worked around, but could be nicer with native implementation: calling services along with the JSON payload, just like on the dev-site of Home Assistant. It would annoy me to create wrapper-scripts for simple things.
That may already be on your agenda. In that case: is there an agenda so we can follow what can be expected in the future? :slight_smile: