Thx, I was also thinking of this approach, but I hoped there was another solution. With simple switch items I use ‘changed from on to off’ or ‘changed from off to on’
This implies that, assume you do it that way, you can‘t continue to use Blockly on an existing code (which you only want to fire if the previous value was not NULL), since you can’t include custom code into Blockly without converting the entire Blockly into code, correct?
The way I understood Blockly, I can only chose from the blocks that are available (e.g. this one: ).
What I have not found so far is an off-the-shelf block that gets previousState of an item, nor the ability to define a custom block or include custom code that gets previousState. Or am I misunderstanding something?
previousState in this usage is not “the previous state of a specific named Item” it is instead “the previousState of whatever triggered this rule”, thats the contextual part.