This snippet of my rule worked before installing the latest snapshot 5380.
var int value = (Miio_Vacuum_Status_StateId.state as Number).intValue
var String message
switch (value) {
case 9: {
message = "Vacuum has reported a charging error"
}
case 10: {
message = "Vacuum is paused"
}
}
Now I’m seeing an error when the rule loads.
2026-05-19 12:02:26.165 [WARN ] [el.core.internal.ModelRepositoryImpl] - DSL model 'TestRule.rules' has errors, therefore ignoring it: [32,14]: mismatched character ' ' expecting set '0'..'5'
[35,5]: no viable alternative at input '}'
If I comment out the case 10 portion of the rule it loads fine. Seems like anything more than a single digit will cause the problem.
@Lolodomo I know there have been numerous changes to DSL grammar. Any idea what might be causing this? Is the problem already known?
I started looking through the closed PRs for things that touched the grammar. I would assume this is an issue with the grammar but I don’t really know for sure.
because the digit 5 does not appear on other places in the grammar, in a way that it makes it distinct from the digit 6, to justify this error message. So the parser (I guess) tries to fill TIME after seeing ('0'..'1') ('0'..'9') ':'.
And indeed, with a space before the colon it works:
var int value = (Miio_Vacuum_Status_StateId.state as Number).intValue
switch (value) {
int at the beginnig of the first line and the parentheses around value on the second line can be removed - they do not make a difference execution-wise:
var value = (Miio_Vacuum_Status_StateId.state as Number).intValue
switch value {