Maths functions in Hubitat?

I have a distance sensor I want to linearise with its exponential curve. I’ve worked out the maths so I know what the distance is based on the voltage Rea’s from the device but it involves natural logs ie

X= ln(10y-4)/41
——————
Ln(1.16)
How can I do this? Rule machine doesn’t seem to cover it. Can it be added to the device code some way?

You can do it in the driver if it is a user driver you can modify - not an option if you are using an in-box driver.

You can do it in a groovy app, and shove the value into a virtual device.

You can do it externally in js, node-red, python, or other and use Maker API to shove the value into a virtual device.

Webcore may be able to do this depending on the formula

Good point! forgot that one - or use webcore. :slight_smile:

I used to like Webcore in Smartthings but I’ve steered away from it in Hubitat. I’m going to try in the driver code first like suggested and really appreciate the help thanks.