Rule ‘Test Rule’: An error occured during the script execution: Cannot convert number literal to typeorg.eclipse.smarthome.core.library.types.DecimalType
var ThresholdBlowTemp = new DecimalType()
ThresholdBlowTemp = 70
sendMail("email@example.com", “ALERT:Temp Timer Ecobee Greater than or equal to”, "Laundry_Temperature: " + Laundry_Temperature.state + "\nCurrentTemp: " + weather_forecasts0_temperature.state + "\nDesiredCool: " + runtime_desiredCool.state + "\nThreshold Temp: " + ThresholdBlowTemp.state + " ")
Also tried removing .state from the ThresholdBlowTemp and that doesn’t work either.
What am i missing here?
This is a variable
Variables don’t have .state, that is for OH Items.
Numeric variables won’t fit into a string without some work, though.
...Temp: " + ThresholdBlowTemp.toString + " ")
Am I even assigning variables correctly?
Still can’t get it working; i ran a test rule with just this:
var testBlowTemp = new DecimalType()
testBlowTemp = 70
sendMail("firstname.lastname@example.org", “test”, “test”)
I never get the email; if i comment out the var and assignment lines and retry, the email is sent out.
It seems like I dont understand how to assign values?
This seems to have solved the “test” issue:
var Number testBlowTemp = new DecimalType()
Now, I’ll go apply this to the original problem.