"look up" helper

Wondering if anyone has any thoughts or ideas around some sort of helper that allows you to kind of create a lookup table.

Ex: i am using grocy for doing some chore management. I have users configured for my kids in both grocy and in home assistant. I am using nfc tags to auto mark off some of the chores. I can detect that “kid1” scanned the tag, but I need to translate “kid1” into id=3 in grocy.

I know i could put that code in a template with some if statements but wondering if anyone has any thoughts or ideas on how to leverage a helper or maybe a way to add custom attributes to the “persons” in HA that would have more of this meta info?

You can add custom attributes to entities by editing the configuration.

This will work with persons too? I did not realize. that might be the perfect answer then!!

Yep, just add it like:

homeassistant:
  customize:
    person.a:
      grocy_user_id: 1

Then after a restart it will be added to the state object:

1 Like

worked perfectly!!! thanks!