SmartThings/Hubitat Portablity Library

For those interested, I have just posted a Groovy 'library' (of sorts) that may be helpful to those trying to develop Application or Device Handler code that can run unmodified on both SmartThings and Hubitat. I've spent literall hours testing performance of various approaches, supported by a number of core members of the Hubitat team, to come up with this library.

This SHPL is available (for free) here:

You will find documentation and some sample code in the README file. The code is free to use

Comments and feedback is welcome.

4 Likes

[begin miscellaneous second fiddle rant...]
hrrumph, HE is the else?
[end miscellaneous second fiddle rant]

4 Likes

Thanks for doing this!

Will allow me to merge the two HousePanel groovy files into one.

This is currently way over my head but good on you for putting it all together
Cheers,
Nic

Well, SmartThings has so much overhead that checking first for Hubitat almost doubles the execution time. Code running on Hubitat can figure out it is not on SmartThings with far fewer CPU cycles than code running on SmartThings can figure out that it is not on Hubitat.

So, in the interest of optimal performance on both platforms, I intentionally structured the code this way. That said. isHE/state.isHE are far faster on Hubitat than their equivalents on SmartThings.

2 Likes