Here the value of trigger.payload_json.id would be 'B1', is it possible to use it to somehow call defined variable B1 so it can act as an appropriate entity_id ?
The way we can do that in some programming langs, like python for example:
someVar = 'myVariable'
myVariable = 'Hello'
print(eval(someVar)) # Example 1, prints "Hello"
print(globals()[someVar]) # Example 2, prints "Hello"
#getattr in objects .....
It’s not too many, more than 20, i wouldn’t like to make spaghetti with if/else, maintenance would be bad. I already made it work by sending the actual entity_id instead of an ID, however i would like to explore option using variables in this way, it would make cleaner code than if/else, and the other reason is to keep information logic on the HA side, instead of sending entity_id from external source, so i was just wondering if it is possible