OH3 Blockly with/without timer -> turned to be .rules file

Is what possible, any kind of timer? No - you must add a script section,in the scripting language of your choice.

Thanks, i will look into the script part for the timer.

I find it difficult to choose between the script languages. I still have to learn this but which one will be future proof (for OH4, OH5, etc :grinning: :wink:.) what can you advise for such a (simple) timer?

I have absolutely no idea. Nor would I worry about that.

Find an example you can understand.

Just forget the Blockly, I can’t find any use for it. Just use the graphical interface, or now I am using (or trying to use) RulesDSL through VSCode - with OH plugin. Pretty neat!
Some people on this forum are really helpful (thanks!), documentation is also good. I like it a lot!

is it the OH plugin v0.8.2 for VSCode ?

try this:

In the meantime Timers have been added to blockly available since 3.2.0. See Blockly Timer Support

For best practices, is it necessary to cancel timers? For instance, a fan switch is changed and ON triggers timer. If the fan switch is manually turned off, what happens to the timer? Here is what I have, and it works fine, just wondering if second part (cancel) is necessary.

image

Definitely a nice addition since expiration timers don’t work great with zwave devices over long periods.

If you right click on the block you can see the help URLs that I added during the implementation which takes you in this case to Timer-Documentation. It says here

  • cancel: prevents the scheduled timer from executing. Most of the time cancel is used used in conjunction with setting the timer handler to null as a convenient indicator that some previously defined timer is now finished with. However setting the handler to null does not interact with the timer itself.

Hope that helps a bit.