Troubles migrating EXEC calls from OH1.8 to OH2

I’ve almost managed to migrate all my OH1.8 setup to my test OH2 install, however one thing I’ve having troubles with is the exec(2) binding.

In most respects I’ve got it working just fine, however I can’t for the life of me figure how to get it to output into a Number item like my OH1.8 version does fine (in this case, for float values of temperature etc that I use for calculations).

The only way I’ve been able to capture the output is into a String item (as a text representation of something like 18.22452452) and even then it throws exceptions when I try to parse it into a Float for use.

I think there is a bug in the binding at the moment that prevents direct binding to a Number item. Here is an example how I convert a value from a string to a double and update the Number item with it:

rule "Convert SYS_SUSV_V_in_Output_String to number"
when
    Item SYS_SUSV_V_in_Output_String received update
then
    SYS_SUSV_Voltage_in.postUpdate(Double::parseDouble(SYS_SUSV_V_in_Output_String.state.toString()))
end

Issue link: https://github.com/openhab/openhab2-addons/issues/2149

Ah, damnit, that works :stuck_out_tongue:

I was hoping I wouldn’t have to add workarounds to keep it working, but so be it. What’s another 100 lines or so of config :stuck_out_tongue_winking_eye: