![Raspberry Pi Scada Interface Raspberry Pi Scada Interface](/uploads/1/2/5/3/125391797/732838717.jpg)
Last year we Project Things by Mozilla. Project Things is a framework of software and services that can bridge the communication gap between connected devices by giving “things” URLs on the web.Today I’m excited to tell you about the latest version of the and how you can use it to directly monitor and control your home over the web, without a middleman. Instead of installing a different mobile app for every smart home device you buy, you can manage all your devices through a single secure web interface.
This blog post will explain how to build your own Web of Things gateway with a Raspberry Pi and use it to connect existing off-the-shelf smart home products from various different brands using the power of the open web.There are lots of exciting new features in the latest version of the gateway, including a rules engine for setting ‘ if this, then that’ style rules for how things interact, a floorplan view to lay out devices on a map of your home, experimental voice control and support for many new types of “things”. There’s also a brand new add-ons system for adding support for new protocols and devices, and a new way to safely authorise third party applications to access your gateway.HardwareThe first thing to do is to get your hands on a Raspberry Pi® single board computer.
![Raspberry Pi Scada Interface Raspberry Pi Scada Interface](/uploads/1/2/5/3/125391797/805887250.jpg)
The latest has WiFi and Bluetooth support built in, as well as access to GPIO ports for direct hardware connections. This is not essential as you can use alternative developer boards, or even your laptop or desktop computer, but it currently provides the best experience.If you want to use smart home devices using other protocols like Zigbee or Z-Wave, you will need to invest in USB dongles. For Zigbee we currently support the (ZB mesh version). For Z-Wave you should be able to use any, but so far we have only tested the and the (Gen5). Be sure to get the correct device for your region as Z-Wave operating frequencies can vary between countries.You’ll also need a microSD card to flash the software onto!
We recommend at least 4GB.Then there’s the “things” themselves. The gateway already supports many different smart plugs, sensors and smart bulbs from lots of different brands using Zigbee, Z-Wave and WiFi.
Take a look at the for devices which have already been tested. If you would like to contribute, we are always looking for volunteers to help us test more devices.
Let us know what other devices you’d like to see working and consider building your own adapter add-on to make it work! (see later).If you’re not quite ready to splash out on all this hardware, but you want to try out the gateway software, there’s now a Virtual Things add-on you can install to add virtual things to your gateway. SoftwareNext you’ll need to the Things Gateway 0.3 software image for the Raspberry Pi and flash it onto your SD card. There are of doing this but is a graphical application for Windows, Linux and MacOS which makes it easy and safe to do.If you want to experiment with the gateway software on your laptop or desktop computer, you can follow the to download and build it yourself. We also have an experimental OpenWrt package and support for more platforms is coming soon. If you’re targeting a different platform.
First Time SetupBefore booting up your gateway with the SD card inserted, ensure that any Zigbee or Z-Wave USB dongles are plugged in.When you first boot the gateway, it acts as a WiFi hotspot broadcasting the network name (SSID) “Mozilla IoT Gateway”. You can connect to that WiFi hotspot with your laptop or smartphone which should automatically direct you to a setup page.
M y favorite Raspberry Pi add-on is the PiTFT from Adafruit. With it, you easily get a Raspberry Pi GUI interface and touch screen. The PiTFT software install is just a few things and it is good to go. SCADA-Server and SCADA-Communicator have been ported on Raspberry Pi. SCADA-Web will be ported within this year. So you can easily create a home automation system. Be free to ask any questions about using Rapid SCADA on Raspberry Pi here. Update: SCADA-Web is also ported. Table views are supported.
75 comments. Ilya “connect the Raspberry Pi directly to your network using a network cable cable and type”That’s an extra cable I don’t have!;). Mike KienzleSpend a dollar and buy one?. brentWhoosh!. laoshawdoes this project from mozilla have anything to do with the old “web of things”:. Ben Francis does this project from mozilla have anything to do with the old “web of things”:Yes, actually we are working very closely with the founders of that website via the W3C Web of Things Interest Group on defining standards for the Web of Things. This is an ongoing evolution of the Web of Things, including their Web Thing Model member submission from 2015.
PhilI have google home and prefer to use that for my voice UI. How does this work with google home?Secondly, this seems like a GUI version of hass.io for automation.
Is this a competitor to hass.io or complementary?. Ben FrancisThere is no Google Home integration yet, but it should be possible if Google Home can call the REST/WebSockets API on the gateway. We have already demonstrated this is possible using Alexa.Things Gateway has many similar functions to Home Assistant. There are Mozillians who contribute to that project and I hope that we might be able to share adapter code, and maybe even converge on a common Web Thing API.
Brendon KozlowskiCame looking to see if this was the case. Very, very glad to hear that it is.
TYVM to your team(s) for all of this! Including attempts at standardization with protocols.
That’s.huge. I’m a current SmartThings owner, but will be keenly watching this space. PatrickThank you for the introduction!Is there an overview of how Project Things is different from other Home Automation solutions like FHEM, openHAB or Home Assistant (and why one should use one or the other?)?. Ben FrancisThe Things Gateway is built from the ground up to support the Web of Things.
OpenHAB is written in Java and Home Assistant is written in Python. Things Gateway is written in JavaScript (NodeJS), but adapters run in a separate process and can be written in any language (e.g. JavaScript, Python, Rust).OpenHAB and Home Assistant are more mature projects which already have support for a wide range of devices. Things Gateway exposes the Web Thing API and arguably has a friendlier UI.
We hope it will eventually have very broad hardware support via the Web of Things. John DoeRules engine questions:Is this limited to primitive rules like IFTTT is or can I nest IF statements and use AND/OR to link more than one trigger/condition? Can I set more than one action to result from a trigger/condition, such as wait and set levels & colors? Can I set & use variables and while-do loops? Can I post notifications back to the app or send SMS?If I can’t do these things it’s not ready to replace what I’ve got.
Ben FrancisThe rules engine only supports very simple rules so far, but this is quickly improving. We’ve also been able to integrate IFTTT via the OAuth support if you’d prefer to use that in the meantime. MartinLooking at how the interface is to use based, does the standard image support directly using a touchscreen on the RPi?. Ben FrancisIt is intended that a separate device like a smartphone, tablet or smart display will act as a web client to the web server running on the gateway.
But there’s no reason you couldn’t run a web browser on the same Raspberry Pi if you wanted to, with a connected touchscreen. The Things Gateway is based on Raspbian Lite and doesn’t have a graphical front end, so you’d have to install all the required packages or build your own OS image based on the full version of Raspbian. Tomasz WaraksaWould it be possible to have my numerous Raspberrys themselves available as Things, so that I can remotely control them from the dashboard? Things like reboot, run script etc. Would be extremely useful for managing that little army. Ben FrancisCertainly. Those Raspberry Pis would need to expose the Web Thing API via an HTTP or WebSocket server.
We’re currently working on software libraries in different programming languages to make it easier to build what we call “native web things” like this. For example, you could run a Python web server on the Raspberry Pis which hosts a Web Thing Description and a REST API which you can send an HTTP POST to request a “reboot” action. Grand Master PAre there add-ons available for smart locks (like Schlage Connect)?If not, can I use code for a smartthings z-wave device handler and use it on this platform?.
Ben FrancisThere’s no support for any smart locks yet, but we are in discussions with device makers. It may be possible to re-use existing open source code to build a Z-Wave adapter (or extend the existing one) to support smart lock devices. LinusHow about razberry wave module via the GPIO pins?And any message broker support? MQTT or maybe the more secure XMPP.Homekit / Homebridge?And the ability to make if and or nested statements is a must. Ben FrancisNot yet, I recommend you file these as feature requests on GitHub so other people can express their interest too and hopefully someone will write adapters.
There is already an issue for HomeKit. DanielI installed it and booted it up was am disappointed by a few things.I seem to be having a few issues.
I can’t install the extension for Tp-Link. It consistently fails and I see no option for debugging.Second: The update screen appears not to load at all.
The previous tutorials covered the process of and running it on your Raspberry Pi. Although the development tools of the REX Control System allow you to control Raspberry Pi over the network, a typical user needs a much simpler way to interact with the control algorithm. Leaving the physical pushbuttons aside, the most viable possibility is a web-based HMI (Human Machine Interface), which will allow you to control your pool with your tablet or smartphone via your home wifi network. The RexHMI componentsFor the mentioned purpose a set of programs and libraries is available, forming the so-called RexHMI family together.
This tutorial will guide you through setting up the individual components.The overall structure of RexHMI is shown in the following picture. RexHMI is based on HTML5 web pages, which are supported by modern browsers. The Lighttpd webserver provides HMI webpages via standard HTTP protocol. When the page is loaded in the browser the WebSocket connection is established between the page in your browser and the RexCore runtime core running on the Raspberry Pi. The Lighttpd webserver and RexWSTcp websocket server act as interpreters between the user and the control algorithm. This allows the user to easily monitor and adjust selected signals and parameters of the running control algorithm.
Running the control algorithm for pool automation. First download the project files from our GitHub repository. It is most convenient to in the form of a standard.zip file. The files are located in the RaspberryPiexamples03PoolAutomation folder. If you are familiar with Git and GitHub server, you will probably use the direct link to the. You already know how to run the control algorithm on your Raspberry Pi, don't you?
If you need a hint at this moment, visit the. Connect to your Raspberry Pi using the RexView diagnostic tool and check that the control algorithm is running. Unfold the tree view of the running algorithm and you must see all the function blocks which are included in the project. Now when the control algorithm is running, it is time to install the components necessary for RexHMI to run.Installing RexHMI components on your Raspberry Pi.
You already installed the webserver and websocket server while running the, therefore you can dive right into work. If you are running another webserver on your Raspberry Pi, e.g. Apache (LAMP) server, you will need to change the default port of the Lighttpd server from 80 to e.g. 8008.Running your first HMI. The RexView on your PC is still connected to the Raspberry Pi, right?.
From the menu, select Target- PC to target device. In the dialog select Visualization (HMI) and browse for the HMI subfolder included in the project. Click the Start Download button and wait for the files to download. As soon as the HMI files are copied to the Raspberry Pi, you can view the HMI in your browser - simply type the IP address of your Raspberry Pi into the address bar. You should see something like this:. If you can see the clock ticking and there are no errors then everything is set up correctly.
This is the most basic type of web-based HMI of the REX Control System. It is composed from simple Buttons and Displays, hence the name WebBuDi. During the scheduled intervals for pool filtration, you will see the filtration pump running.
Now you can push the button, which will disable filtration until you press the button and enable it again. The button is connected to the MPBUTTON function block, which you should remember from the. It controls the RSNOFILTER flip-flop function block, which you can watch in RexView and RexDraw simultaneously and observe the effect of pushing the button. Also try pushing the physical button which is wired to your Raspberry Pi.Modifying the WebBuDi HMI. In order to modify the HMI, you need to edit the index.html file in the HMI subfolder of the pool automation project. Simply open the file in your favourite code editor (not MS Word!). The index.html file is the only one which you need to edit.
You can see some header and footer in the file but you are interested only in the document.ready function where the individual elements of the HMI are defined. As you can see, the HMI consists of two sections named controls and status. Each section has a title and contains rows of buttons and displays. Each line in the rows array represents one element in the HMI screen.
The definition of each element contains a unique alias, description, the so-called connection string and type definition. The connection string is in fact a path to the parameter or signal in the REX control algorithm. The connection string pooltask.NOTLIGHTS:U refers to the U input of the NOTLIGHTS function block inside the pooltask algorithm. The most common elements are:. DR - Digital Read.
DW - Digital Write. AR - Analog Read. AW - Analog Write.
MP - Manual Pulse. ES - Empty Space.
Each element has also additional properties which control its appearance but we will not list them here. Instead we encourage you to explore the code yourself and also to inspect the HMIs in the other examples in our repository. Once you are done modifying the index.html file, simply repeat the procedure of downloading the HMI folder to your Raspberry using RexView and refresh the webpage in your browser.Beyond the scope of this tutorial: A complex WebBuDi HMI for PiFace DigitalAn example of more complex WebBuDi visualization is included in the. See the video which illustrates the possibilities of the WebBuDi HMI and the REX Control System:Is there any way to create graphical HMI instead?Yes, there is! Check out our, which allows you to create a stunning HMI for your project. TroubleshootingGot stuck at any point?
We want to hear about it, do. Additional informationYou can also:. Read the and watch our which both explain a PID control loop example. Explore the rich of the REX Control System. Visit the webpage, where you can find more information about the Raspberry Pi minicomputer.Raspberry Pi is a trademark of the.