[Ecobee] Binding not working anymore to sethold

I do not know why this suddently start failing, and I do not have the hardware, too. I do not know why getActions("ecobee", "ecobee:…") returns null.

My reading is that getActions return null, but using MainUI → Settings → Thing → Actions, then it works for any action. Maybe getAction() is called too early, before the add-on is initialized?

How about looping some times with delay of 1s, trying getActions() in each iteration and checking if if returns null, and if all times fail, then give up by logging an error?

Fall-throught for switch expressions is described at Xtext - Integration with Java : one has to use comma ,; the examples do not contain break or return. I guess, a switch is an expression, as everything in Xbase, and if there is a match, the right-hand side after the match is the value of the switch expression. The switch example I posted at https://community.openhab.org/t/network-pingdevice-detects-sometimes-incorrectly-offline-state/ also does not contain fall-through, break, return, but it works.

For Type mismatch: cannot convert from LinkedHashMap<String, State> to Map<String, Object>; line 27, column 1088, length 6 you can try

  val Map<String, Object> params = newLinkedHashMap('coolHoldTemp' -> ecobee_userCool.state, 'heatHoldTemp' -> ecobee_desiredHeatTemp) // or
  val Map<String, Object> par =                   #{'coolHoldTemp' -> ecobee_userCool.state, 'heatHoldTemp' -> ecobee_desiredHeatTemp}

Of course I do not know what exactly appears on line 27 column 1088.

When I type just

rule a
when
  System reached start level 100
then
  var QuantityType<Temperature> ecobee_desiredHeatTemp
end

I get

[INFO ] [el.core.internal.ModelRepositoryImpl] - Loading DSL model 'a.rules'
[INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in DSL model 'a.rules', using it anyway:
The value of the local variable ecobee_desiredHeatTemp is not used

I suggest creating some minimal script, which by adding a line produces an error and without that line the script runs fine.

Given that DSL Scripts can produce more correct errors/warnings, compared to DSL Rules, meaning at least failing earlier when things go wrong, I suggest to create minimal example, which breaks, as DSL Script, not as DSL Rule.

Here and other places:

if (ecobee_desiredHeat.state instanceof QuantityType) {
    ecobee_desiredHeatTemp = ecobee_desiredHeat.state as QuantityType<Temperature>
}         

After insteanof and before state as QuantityType<Temperature>, ecobee_desiredHeat.state could be set to NULL, so that ecobee_desiredHeat.state as QuantityType<Temperature> does not work and aborts the execution. To avoid this, casting must be done in try…catch and for that to work first script.model.ScriptInterpreter: emit what cannot be casted to what after a single evaluation of the cast by dilyanpalauzov · Pull Request #5329 · openhab/openhab-core · GitHub must be included.