So in short you’re kinda right. It’s a context problem. Solvable. There are a couple of posts you will need to read. They’re both ridiculously sprawling but tell the same story
You can’t just drop in an LLM and expect plug and play magic.
And thyraz’ post
Now as to your device issue
The prompt context does not contain info about ‘devices’ it does ‘entities’ … So are you matching the right item.