Identifying a mobile device

Hello everyone
I'm running my NodeRed for my alot of stuff in my house. One of those things is a door lock. Now getting trough this door is simpler if you just kick it down so security does not need to be uptight. I setup my android device with an app that I made in AppInventor. You tap the app while on my home WiFi and it sends a get request. NodeRed then takes a random number and sends it to my app and calculates a custom CRC for that number. Now the app must do the same and sends it back. If the App calculation and NodeRed calculation matches the door opens. This works great (yeah I know complicated but I had fun and learned some stuff) You just tap the app and it closes it iself in a few seconds.
Now everything went down the toilet when after 12 years I bought an iPhone... no free apps and I defenetly will not pay 99 bucks/year so my app can keep running on my phone🤦‍♂️.
So I have been thinking of a simple webpage shortcut. But I would like to identify who opened the link. Was it my device? Yeah I have a WiFi password, but my friends may also have it.
Any ideas?

Hi,
If you share a link, the easiest way is to add a user to the link
(http://example.com/my-house/?user=someone)
because it is not possible (I think) to know who it is; only authentication could do it.

I don't know anymore what the limit is but you can also use Home.app and share the home with your friends.

You can also use a Telegram Bot: you create a group and each user enters a /open / close command to open/close the door. It allows you to get the user in the request and it's more secure than a link.

No I don't want to share a link :grin:. If someone on my wifi tries to open a specific link I would like to identify it he/she is allowed. I'm aiming for a one tap opening of the door :grin:

This is what I meant by shared link

I recommend Telegram, it’s more versatile (use keyboard instead of command :yum:)

Ok so I'm a total noob about this. Can this work without internet? Or does it need to connect to a server.. i don't use Telegram so sorry for the stupid question🙈

You also mentioned the Home app? This is supposed to be homekit right? Did anyone here get this up and running I tried to use the nodes but I my phone does not find node red as a device (at least I think this should work like that?)
There are 2 nodes if I remember correctly but I could't get ether working

Uh it's a server on the internet like Messenger and Discord.

Yes use node-red-contrib-homekit-bridged (node) - Node-RED

Works fine for me

For me there is a problem. It seems I have a partial install. I see only status and service nodes. I think I'm missing a few. Like the bridge it self. If I import an example it throws unknown nodes error

I run my nodered on an TrueNAS Core as an app. Maybe this is the problem

Then follow the installation described at GitHub - NRCHKB/node-red-contrib-homekit-docker: Node-RED-homekit-docker is a Node-RED based project with support for homekit.

It is generally this parameter that must be defined:

network_mode: host

I forgot to reply to the previous message: this is normal, only the service and status nodes are displayed in the left bar.

Two thoughts:

First use a cookie and without this the door does not open. You will need to look at creating and reading the cookie but that's not too hard with a little bit of php. Node-Red is happy reading cookies (the 'HTTP In' node has cookies as a property IIRC).

Second - you do not need to pay to develop Apple apps and use on your own 'phone (as long as the Apple ID matches IIRC) - the Apple site states:

Do I need to enroll to install apps on a device?

No. You can install apps on a device for free with Xcode. You’ll only need to enroll if you’d like to distribute apps, access beta software, and integrate with capabilities such as Siri, Apple Pay, and iCloud.

From Enrollment - Support - Apple Developer

1 Like

I installed via Nodered? I don't know any other methods on installing on a TrueNAS Core.

As for the iOS: yeah I found that, but there is a "fine print" AFAIK. The app wirks for 7 days and then you need to reinstall it via Xcode.
Also I made the app in Appinventor that now supports iOS, but you need a certificate for installation that is only provided by Apple for the paid account. MIT is working on solutions, but I doubt they will get far in the near future :disappointed:

A simple webpage shortcut - Yes, use the local IP address of your Node-red server dashboard and it will only work if you are connected to wifi.

Was it my device? Reserve the IP address of your iPhone in the router (assumes iPhone does not connect with a fake MAC address) or in the iPhone (I assume that's possible).
The ui_control node can tell the IP address of the device using it. https://discourse.nodered.org/t/tracking-users-ip-address/52801

I tried going the homekit way, but the node does not work for me.. The accessory is not getting discoverd..
This boila down to the way that TrueNAS Core handled its Apps. The apps get a specific port and they all share the same IP as the server. So in my case the app has only one port and that is why my iPhone cannot discover it. I think i'm goind to move my Nodered to a Raspberry and be done with it.
I coul setup a VM in Truenas. But when i tried I hade strange problems with my second interface. So I just gave up

Using iOS....
Create a Shortcut with the shortcut app, add it as a button to Home Screen, to send a web request to Node RED and including the Hardware MAC address in the http request.

You can then share that shortcut with friends/family

Store the MAC Address(s) in Node RED that are allowed to open the door

This was the way I was thinking originally. But AFAIK i can't get the MAC of my phone, iOS won't allow it. Or gig you have something elese in mind? This would be the prefered way
By Web request sou mean get right?

1 sec...
I am taking a screen shot

@AndrewBeasley

Here you go - something like this.
Just include the MAC in the headers and provide the correct IP:Port/Path of NR HTTP IN

you can then save this on Home Screen - share with others (as long you add their MAC in NR)
and read the USER header in NR

Shortcuts App

2 Likes

Wohoooaaa wait wait :joy: I kust douplicated you image (tanks so much for that) where do I put the url? Damnn this Shortcuts is limitless.. how the hell do you know your way around​:see_no_evil:

Get contents of 192.168.xxx.xxx:1234?