Industrial Drupal 8: the heating experience
Breadcrumb
- Home
- PronovixBlog
- Industrial Drupal 8: The Heating Experience
Drupal 8 is out the door – well, the release candidate at least, so it’s time to get intimate with it. As I’m mostly a backend developer with a focus on coding, I’m mostly interested in what’s under the hood: how should we write a new module. As we had our heating system upgraded this summer and I opted for a controller that can be instructed via the web, it was an extra motivational factor: it would be nice to have a heating system #madewithdrupal8. :)
Every proper project should:
Don’t expect a “usual” D8 introduction: there’s going to be no speaking about .yml files and structuring the code – there are quite a few of them already out there. I’m going to speak only about my own experiences.
My goals weren’t too high with this project. Honestly, the biggest one was trying to have one of my interests coincide with leveling up in my daily job.
Provide UI for user to enter:
Provide callback for TC to submit data:
Provide UI for user to display every enabled fields’ data for the past day, week, month and year, using some charting API. (Probably https://www.drupal.org/project/visualization as it seems to be the only one so far with a #D8CX pledge.)
Provide UI for users to import their previous data (preferably using the same syntax Thingspeak uses for export).
Provide UI for users to export their data (preferably using the same syntax Thingspeak uses).
Provide UI for users to change some Chart.js settings.
For all the data but the settings.
So the site owners can set up some rules/actions eg. send users an email when their TC reports above-threshold temperature.
Usual setup for a TC is a home/office/lab automation tool, behind a firewall with an ever-changing IP address. There aren’t too many free dynamic DNS providers, and this functionality depends on the DSL router/firewall. Dynamic DNS is not really needed if TC is set up to submit data every now and then: the Drupal module could store the last IP the TC has connected from, and the users could provide the port they have set up as a forward on for their TC. If the Drupal module knows the IP, the port and the credentials needed for TC, then it should be possible to control TC from a Drupal site – even through a firewall.
With a decent D7 coder background I thought I knew the main pain factors. Some of them turned out to be the main gain factors, luckily.
László has been a backend developer since he met Drupal in 2007. He has experience in HTML, PHP, MySQL, Git, Linux server administration, mentoring, and even a slight touch of jQuery. His main interests are interoperability, architectural discovery, gardening, music score engraving and volunteer church work.
Articles on devportals, DX and API docs, event recaps, webinars, and more. Sign up to be up to date with the latest trends and best practices.