While you can build just about any kind of IoT device or project with Adafruit IO's feed dashboard functionality, you can add a little more logic and integration using Actions. In Adafruit IO, Actions are a way to do something when a certain situation occurs. We've built a custom Blockly App to allow easy creation and editing of Actions on Adafruit IO.
Whether you've used Actions before or not, this guide will get you up to speed using Blockly Actions to power up your Adafruit IO Project!
Blockly is an open-source project maintained by Google. It's a block-based code-editor, or in other words a tool for diagrammatic representation of code, designed to be easy to use for beginners and experts alike!
The editor uses puzzle-piece like blocks to represent code concepts like variables, logical expressions, loops, and more. It lets users program without having to worry about syntax or the intimidation of the command line.
While you can build just about any kind of IoT device or project with Adafruit IO's feed and dashboard functionality, you can add a little more logic and integration using Actions.
As our new use of Blockly grows, we plan to add all sorts of exciting features, like maths functions, logical operators, and other useful extensions for parsing data. However, for the initial release, we've concentrated on replicating the functionality of the existing Action forms.
In the past, we had 3 types of Actions (or Triggers) supported:
-
Reactive Action - Every time a feed is updated this action is immediately executed and its conditional expression is checked (if a feed value matches the desired condition).
-
Timed Action - This is very similar to reactive actions, as they are triggered based on a new feed value, but only executed after a set delay.
- Scheduled Action - The traditional timer or scheduling trigger, where you specify a set of times/days/dates when the action should run.
Each one was configured using an old input form, which was fine for simple use cases, but sometimes required a bit of guesswork as to how it functioned. This was especially true for the scheduling triggers.
Here we see a simple "Reactive Action" example, showing that if a value of 1
is sent to the toast_burnt
feed, then the reactive action will fire the value 1
to the disable_me
feed, effectively being used to disable power to my toaster.
The main improvements you'll see today using Blockly are that we have greatly enhanced the usability (for example feed names and blocks are searchable), and supplemented the help information available when editing your actions (menus and mouse-over tooltips).
The next page looks at the sections of the user-interface, what each thing is named (which is useful to know when asking / searching for help), and how to use each "thing".
Text editor powered by tinymce.