I don’t know of any better way to do it, SmartThings sort of assumes that you aren’t using direct association, and when the Linear devices were first designed, they assumed that you were and that the hub was not in the Association group, hence the problem that you uncovered. So I think your method is probably the best way for now.
I would note for people who find this topic in the future that association changes significantly with zwave plus devices. So it’ll probably require an entirely new method once Linear releases Z wave plus versions of their switches.