[SOLVED] Syntax Error Using Number:Temperature in Rules

I have two Items of type Number:Temperature (namely Radiator_Target_Temp and Occupied_Target_Temp), and in a Rule I want to assign the value of one Item to the other Item. IMHO the logical syntax would be as follows; however this fails with an error “mismatched input ‘:’ expecting ‘)’”

Radiator_Target_Temp.sendCommand(Occupied_Target_Temp.state as Number:Temperature)

By changing the code to the following, I can remove the syntax error, however I think that this “solution” is wrong, since it destroys the UOM information. Or ??

Radiator_Target_Temp.sendCommand(Occupied_Target_Temp.state as Number)

I think the practical workaround is

Radiator_Target_Temp.sendCommand(Occupied_Target_Temp.state.toString)

which will include current units.

The more abstractly “correct” approach is - I think?! - more like

Radiator_Target_Temp.sendCommand(Occupied_Target_Temp.state as QuantityType<Temperature>)

Many thanks @rossko57, I will try your “correct” approach first, and will report back on which one works.

I confirm that the following “correct” syntax does indeed work:

Radiator_Target_Temp.sendCommand(Occupied_Target_Temp.state as QuantityType<Temperature>)