so I have registered my iPhone as device via the official home assistant companion app.
In HA it creates a device with multiple entities looking like in this picture:
As you can see the device ID of my iPhone registered wihtin HA and the device ID for the NFC scan are different ones.
My question now is, how can I bring both together using a template?
I would like to see that the NFC Scan was fired by my iPhone without the need for a manual mapping table…
The device_id in the tag_scanned event comes from the config entry of the device, which should map to the same value you’d get from e.g. {{ device_id('device_tracker.your_iphone') }}. I’m not sure why you’re seeing a different one, unless you’re running a version of HA before the scan_tag event in the mobile_app integration, which was a long time ago. The device_id you are seeing there looks like a UUID, which is generally what the app sends in other events and when it thinks the server is too old.
If you go to the app’s settings > Debugging > Export Logs, you can look for the ‘scan_tag’ or ‘tag_scanned’ text in the HomeAssistant.txt log file and it should at least give some indication which of the paths it’s taking – the direct event [for older HA] or the webhook [for newer HA] – which may point to where the issue is taking place.
To me it looks like the app is using webhook exactly as it should, does it?
Please additionally note that I have connected my server via Nabu Casa remote ‘Home Assistant Cloud’ - maybe this makes a difference?