jdavidpeter / plc-home-automation

Complete MOSAIC project for a Tecomet CP-1000 based, live, home automation system. Made as hobby.
1 stars 0 forks source link
home-automation mosaic plc tecomat

TLDR

What is this?

As a hobby project, I have created a "smart home" system to make my home more comfortable and energy efficient. The entire thing runs off a Tecomat Foxtrot CP-1000 PLC. This is the Structured Text source code as well as all required MOSAIC IDE configuration files to reproduce my project.

Why is this on GitHub?

Although I have experience in software as well as a degree in embedded engineering, setting up the project was a pain due to the lack of documentation and available examples compared to mainstream languages like Java or C++. I hope providing a working, although far from perfect example will help other PLC projects to gain more motion.

"I'm going to hack your home!"

Nothing is exposed on the public internet and all systems included run on wired connection. I hope that is a high enough bar, but if isn't let me know!

Details

Hardware overview

This system have been fitted to a new construction home. Therefore, all sensors, inputs and actuators are wired.

Software overview

The code is entirely written in Structured Text using the Tecomat brand provided MOSAIC IDE. It requires a license and runs only in a very limited mode without it. My license is tied to my physical device I program.

There is significant project configuration (e.g. naming and mapping physical ports on the PLC) that's done over the MOSAIC UI, but is not actual code. I have added all the data files generated by MOSAIC which contains those project configuration to git. Maybe even more than what's needed. But I need a repo where after any change (that screws up my home) I can just roll back and reinstantiate previous functionality.

There is also autogenerated code for

The Structured Text code itself falls to 2 main categories:

Functional code usually follows the structure of having a module in 3 files:

Contribution

This is the live system of my home and frankly, I have doubts that anyone would like to contribute to the code. Still, suggestions are warmly welcome and I'm happy to merge changes that improve code quality.

Things I would do differently next time

For sure

Maybe