Pass content of varianle within sendCommand? (how to cast a Command Type)

Hi all,

can somebody tell me how to pass a variable (which content I have set in the GUI) within sendCommand?
I’m trying something like this - but ger a type mismatch error (Command vs NumberItem):
``
sendCommand(Keller_Temperatur_Setpoint,Keller_low)

How to cast Keller_low to a command type?

Thanks for your comments!
MM1804

If Keller_low is an Item.
It should be something like this:

sendCommand(Keller_Temperatur_Setpoint,Keller_low.state)

You just passed the Item, but not the value (state)) of the Item.

yet it is an item - actually a setpoint item so that I can set my target Temperature in the GUI instead of hardcoding.

I tried adding .state but then get a type mismatch Command vs state (so does also not help…)

sendCommand(Keller_Temperatur_Setpoint,20) works…

I think you have to cast the Type:

sendCommand(Keller_Temperatur_Setpoint,Keller_low.state as DecimalType)

1 Like

works perfect, thanks for the help!!!

Just love the help of this community