I tried to find a answer for my question but don’t know how to best search for it what are the best query words?
Maybe it is a dumb question but i would like to keep everything local as much as possible. I scan a local QR Code with my mobile phone, which is local via wifi, to switch on my local smart light. My HA system is local. Everything is local. But the qr code tag goes to a external url (www.home-assistant.io/tag/{id}). Why?
Is there a way to not do it that way? Just connect to my own HA Core system with the QR code id (or NFC tag) and HA switches on my lamp and nothing has to go out on the open internet?
I will look into the link in a minute, thank you.
The phone is the weak link you say. The HA app on my phone can reach my HA system. Why can’t the HA system do all the work. Why does it have to go www.home-assistant.oi/tag/… first? Or at least have a choice.
@stevemann thank you for the link to the Arduino qr/barcode scanner. But my phone has no problem scanning the QR Code. If i scan a QR code generated by HA tag a url pops up on my phone to https://www.home-assistant.io/tag/{id}. If i click that internet url my light bulb turns on / off. What i would like to know is: why does it have to connect to this url outside of my local network if everything needed is local to make the scan switch on my light bulb? Why can’t it use my https://hass.mydomain.local/tag/{id} instead?
because both the android and iOS needed to support this with a universal link that both platforms accept. You actually are not supposed to hit that URL if you scan it using the native apps as the apps can register for the URL and process the tag.
A Iphone and my Android devices are both local just like the HA system. Everything could be handled on my local network. I still not understand why https://www.home-assistant.io/tag/{id} is needed.
I scan the QR Code with the camera app on my Android phone. Then wen it successfully scans the QR Code it shows a url like this one https://www.home-assistant.io/tag/{id} with a unique id. I have to click/tick that url in order to switch on my light bulb i connected to this QR Code in HA.
I have the HA app installed on the phone of course but there is no QR scanner in the HA app. Or well not that i know off.
Whether they are local or not has nothing to do with the format being used. The entire purpose is so the apps can register the URL as a deep link and so that it works with both platforms.
no but the app registers for these deep links to handle them when you click on them…check the app info screen and check that the app is still registered to these deep links
This is still not correct, see my response above as to what should be happening with open by default. The entire purpose is to tell the apps to handle it, your HA system is not aware because the apps handle sending the event to your HA instance. Thats all scanning a tag does.
Really don’t know how many times people have to tell you - it is NOT connecting to home-assistant.io and activating things remotely. You can prove this yourself by going to exactly the same address that your phone is showing - in a browser on a computer. You will see that it takes you to a page like this:
It is NOT remotely connecting to your home assistant instance and activating anything - it is just that when an app on Android or iOS wants to intercept a call, it has to register a common URL format so that Android (and iOS) knows which app to send the request to.
I’m reviving this thread just to answer the question in a more friendly way (after I asked myself the same question):
No, it is not absolutely necessary, but it has to be in the shape of a url.
My dream would have been to be able to dynamically configure the prefix directly from within the app. But to date, Android does not allow this, that is as simple as this: the HA team don’t really have a say in it here.
You have to preconfigure the format of the url within the manifest of the app before building it.
So the only way (which I’m about to try now) is to clone the repo of home assistant app, edit the android manifest to set you’re preferred location. Recompile, and install on your device.
On iOS both the website and the app (at build time) has to declare that they support echother for universal links. Without that, iOS would want to open the link from the nfc tag in Safari. The URL doesn’t get queried, it is just passed to HA app to do whatever it wants with it.
I think you can also use the other type of deeplinks, just write a “press nfc helper button 17” on them and you can use the button press as a trigger: URL Handler | Home Assistant Companion Docs
Not sure I understand you last answer. But as far as I’m concerned, I just wanted to be able to adapt Home Assistant to my QR codes (no NFC) rather than the other way around.
So, since I was in “challenge accepted” mood, and since I didn’t want to mess up with the code of HA, I just built a very very simple QR Code link replacer that anyone can recompile with their own strings, just modifying the gralde buildConfig strings.
I don’t care about iOS at the moment, so it’s a good enough workaround.
And I had fun asking ChatGPT to generate this for me, including logo