Automation programs editor with Blockly (video)

140 views
Skip to first unread message

Generoso Martello (Gene)

unread,
Mar 2, 2023, 8:50:46 AM3/2/23
to Blockly
Hi all,

here is a short video of a visual programming editor implemented with Blockly and used to create scenarios in a home automation software.

(starting from 00:35)

Thanks for this great library =)

Beka Westberg

unread,
Mar 2, 2023, 1:13:30 PM3/2/23
to blo...@googlegroups.com
That is so cool! I love the how you integrated the ability to test the program =) Thank you for sharing!!
--Beka

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/59db0743-116e-4442-bb82-4ae290e9495fn%40googlegroups.com.

Generoso Martello (Gene)

unread,
Mar 6, 2023, 4:59:37 PM3/6/23
to Blockly
Just added blocks for async events handling and the switch statement.
Here's a new video:


I promise the last one! though I will continue having fun and make progress with Blockly =))

Christopher Allen

unread,
Mar 8, 2023, 7:48:57 AM3/8/23
to blo...@googlegroups.com
Hi Gene,

Just added blocks for async events handling and the switch statement. 
Here's a new video:


Nice!

I had a couple of thoughts:
  • The switch block will be familiar to those with a background in programming, but I wonder if it might be a little confusing to non-programmers: for example, it's not totally obvious that the value in the first input gets compared to the values in the second and subsequent inputs.  Maybe there is a way of making this block's labels more explanatory?  Of course it is easy enough for less experienced users to get the same effect with an if block and explicit comparisons, so perhaps having a fancy block for "advanced" users is fine.
  • I think the "setup" block is interesting, but I was sort of surprised that you nested the "when" blocks inside it.  I think a more typical approach to event-driven programming in Blockly is to have event-listener blocks be top-level blocks.  (Though of course they could be both: active all the time when used at the top level, and active only once executed when nested inside some other blocks.)
Just my tuppence worth, of course…


Christopher

Generoso Martello (Gene)

unread,
Mar 8, 2023, 10:30:53 AM3/8/23
to Blockly
Hi Christopher,

I am in general trying to make these blocks looks more readable for non-programmers, so absolutely agree about the "switch..case" labels.
Maybe the label "switch" could be "check value of <field_name> case .. case..." and the label "default" could be replaced with "otherwise".
The "switch" statement can be more visually effective than a "if" at least because there's no need to repeat the property name for every value that has to be checked.

The setup block reflects how the automation program engine works in this software. It's exactly in there that program initialization takes place.
The "when" handlers can be defined either in the setup or the main  and could also be registered or not based on some condition.

Anything outside the "setup" and "main" blocks do not generate any code at all and can be used as "place holder" or "snippets" that gets saved along with the workspace.
I find this approach somehow handy during the design of a program with the visual editor.

Thanks for the feedback :)
Reply all
Reply to author
Forward
0 new messages