I kinda gave up on the whole concept of Entities and Devices for battery powered buttons (In my case I use MOES Scene Switches). Instead I changed to using the hardware id’s of the switches, per the linked thread.
Currently I have a single automation that handles all button presses (maps the id’s to logical names). Then a single script which uses the logical names to take the relevant actions (most of which are just activating scenes).
TBF, It doesn’t really solve your problem, instead it eliminates the need to solve it.