Hey @mari0,
glad you like it - and I hope I can help you.
I’m not calculating anything by roomId, so it should work with the letters as well.
Not had much time to look at the code, but from a first sight, I think the error is in the “calculation” of your command:
actionCommand: "='spotArea:' + ((vars.cleanA ? 'A';'') + (vars.cleanB ? 'B';'') + (vars.cleanC ? 'C';'') + (vars.cleanD ? 'D';'') + (vars.cleanD ? 'D';'') + (vars.cleanE ? 'E';'') + (vars.cleanF ? 'F';'') + (vars.cleanG ? 'G';'') + (vars.cleanH ? 'H';''))"
Just looking at the small part
spotArea:' + ((vars.cleanA ? 'A';'') + (vars.cleanB ? 'B';'')
would mean, that if vars.cleanA
and vars.cleanB
is true the result will be
spotArea:AB
if not an error in calculation.
In my opinion would be correct:
spotArea:' + ((vars.cleanA ? 'A;':'') + (vars.cleanB ? 'B;':'')
So the true option is not just the letter, but always a letter and ;
. and the true and false options are seperated by :
instead.
You need to change that in the whole line, but afterwards it should work.
Hope that helps
Tetsuo
Edit: Link to shorthand if statement might help to better understand the syntax of this “command-calculation”: Java Short Hand If...Else (Ternary Operator)
Edit 2: Be aware that I linked to Java instead of JavaScript but the syntax is identical.