Using SmithTek 3DM Canvas for a home automation project

Although SmithTek 3DM SCADA Canvas is primarily aimed at creating dashboards for industrial applications such as process control, it can also be used very effectively for home-based projects where a flexible and/or creative dashboard layout is required.

Here's a link to the SmithTek 3DM Canvas node details, including examples and installation instructions.

My Home Sensor Project

In my particular case, I have four sensor nodes located around the exterior of my house. They report temperature, humidity and atmospheric pressure, as well as providing infrared detection for security purposes.

All of this information is sent to Node-RED via a private local MQTT broker, where it can be processed and displayed.

I also have an experimental ESP32-NOW network, consisting of a Base Station, Relay Station and several Remote Sensor nodes. This network collects additional information, which is also passed to Node-RED using MQTT.

Connecting Node-RED to 3DM Canvas

One of the things I particularly like about 3DM Canvas is how easy it is to integrate with an existing Node-RED system.

As shown below, it was very straightforward to create a small Node-RED flow to re-format the MQTT payload into the structure required by 3DM Canvas.

Dashboard for the Four Home Sensors

The next step was to create a 3DM dashboard for my four external sensors.

I found a suitable PNG image on the Internet and resized it so that it worked well within the 3DM Canvas environment.

I used a Table widget to display the current temperature, humidity and pressure, together with the time the last reading was received, for each of the four sensor nodes.

This gives me a simple at-a-glance view of the current conditions around the house.

ESP32-NOW Network Dashboard

My next project was to create a dashboard for the ESP32-NOW network.

The basic approach was exactly the same as for the home sensors — I created a suitable background image and then added a number of Table widgets to display the information being received from the different nodes.

I then experimented with the layout and added some additional widgets to produce a cleaner and more informative display where the function of the various nodes is colour coordinated.

Using Actions for Drill-Down Information

One particularly useful feature is the Action widget, which allows an element on the dashboard to be used to trigger an action — in my case, to drill down to a more detailed page.

This makes it possible to keep the main dashboard relatively uncluttered while still providing access to more detailed information when required.

Conclusion

Although 3DM Canvas is clearly capable of producing sophisticated industrial SCADA interfaces, I have found that it is equally useful for smaller home automation and IoT projects.

The combination of MQTT, Node-RED and 3DM Canvas provides a very flexible way of collecting data from a variety of devices and then presenting that information in a visually appealing and highly customised dashboard.

For anyone already using Node-RED, I think 3DM Canvas is well worth investigating, particularly if the standard Node-RED dashboard components don't provide the flexibility or visual appearance you are looking for.

I used AI to document my first attempt at using 3DM Canvas and produce a "Quick Start Guide" using a very simple payload structure and canvas layout.

3DM_SCADA_Canvas_Node_RED_Quick_Start_Guide.pdf (44.9 KB)

Note: At the moment, the links to reference documents in the PDF are mangled (don't work).

Looks good Dave!

Knocked this up this afternoon (the fan at the bottom left is 'spinning')...

The per-sensor timestamp is useful here. Is it the sample time supplied by the sensor, or the time Node-RED received the MQTT message?

If you use retained messages, an old reading can arrive immediately on a new subscription and look fresh if its timestamp is set on receipt. Keeping sample time alongside receipt time, with an age or stale indicator for each sensor, would make the four locations easier to compare after a restart.

The retained-message behaviour is described in the Node-RED cookbook.

My house and Dave's look surprisingly alike.

We probably used the same architect - it's a sort of low-cost flat-pack design.

Looks like we even have the same furniture and taste in decoration - how spooky is that?

By the way, thanks Dave for helping me get this off the ground

Generally it is best not to use a retained message for transient data such as sensor readings.

Agreed. If 3DM Canvas doesn't have its own cache, you should implement it in Node-RED and have something to manage cache replays when needed. You could use UIBUI:DERs uib-cache node for example. You need some feedback from the front-end though so that you can trigger a replay.

Thanks, Colin and Julian. Keeping live sensor traffic separate from initial dashboard state makes sense. For a cached reading, I'd preserve its measurement timestamp through replay so the dashboard can show its age. That was the distinction I was trying to get at.

Nice build, Dave. The layout import/export in 3DM Canvas looks handy for a setup like this, since you could keep the house view and an experimental ESP-NOW view as separate files. Free-form layouts like this are something we think about a lot while building Novastart, an infinite canvas workspace, and lines that follow the equipment when you move it are a nice touch.

Gerry, did you start from one of the example layouts that ship with the package, or build yours from scratch?

@dynamicdave was kind enough to send me his flow and coach me enough to get mine up and running. That's why his background and mine are the same, it came from him. He has expanded his considerably it looks like while my efforts have stalled while I finish up some other things. I didn't want to miss the chance to at least get started with it so I got one page sorted.