I tried to find how to solve my problem but I’m fail.
Rule like below works ok:
var Number temperature = (JAD_11.state as DecimalType) sendCommand(Termostat_jadalnia,temperature.toString)
but If I want to generate state dynamically based on other variable and item - it fails
var Number hours = now.getHour var Number temperature = ("JAD_" + hours + ".state") as DecimalType sendCommand(Termostat_jadalnia,temperature.toString)
I have tried many combinations of (), “” and always have error
Could not cast JAD_8.state to org.openhab.core.library.types.DecimalType