May I suggest a different and much simpler approach? Spin up a Home Assistant instance, install the Home Assistant automation for your device. Then, on Hubitat, install HADB, which brings Home Assistant devices into Hubitat. HADB is really well done and works well. I use it on several cloud devices for which no Hubitat driver exists.
The best code is code that you don’t have to write, debug, or maintain.