Skip to content

gixjoy/openmonday

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Monday

Monday is a smart home system based on Raspberry Pi and Shelly devices by Allterco Robotics.

Are you wondering why building another connected home system? Well, I needed a no-cloud solution, able to handle all my house data privately, even if with remote access. Besides I needed a "gym" to learn Flutter so I ended up building a system ready for Android and iOS, able to control most of my common home devices. Shelly devices have been selected among many similar types of devices and in my opinion they are the best engineered devices on the market, with REST API's available documentation online and strong hardware reliability. Plus they are very cheap and you can buy them on Amazon.

Basic features

Here you can find Monday basic version which allows you to control:

  • Lights
  • Heaters
  • Shutters
  • Outlets
  • Temperature
  • Humidity
  • Power consumptions
  • Charts (temperature, humidity, power consumptions)
  • Scenes (manual and automated)
  • Rooms

Monday has been developed following MVC pattern, so it can be extended with new modules/functionalities easily and quickly.

Source code structure

  • Client/monday: this is the package containing mobile apps source code in Dart language.
  • Server/api: it's the folder with REST APIs implementation for the backend services. It also contains the data model of main objects, for accessing MySQL tables on database
  • Server/process: this is the set of script that are executed periodically by a crontab task or by a systemctl service
  • Server/systemctl: the set of configuration files to copy under /etc/systemd/system on Raspbian, for having systemctl services configured and ready to run
  • Server/crontab: content to be copied inside crontab tasks, with bash command crontab -e on command line
  • Server/monday.sql: dump of SQL code for creating Monday database with tables and triggers

How to install

Shelly: follow guidelines on user manual for all types of Shelly devices. Once connected to your home WiFi network, configure on every Shelly device Mosquitto section with Monday IP address and Mosquitto credentials.

Mobile application: project can be imported into Android Studio or Apple's Xcode and built with command: flutter build apk or following instructions at https://flutter.dev/docs/deployment/ios for iOS version. A Google Firebase Messaging configuration file is needed for using Firebase Messaging notifications within the app. You can create it following guide at https://pub.dev/packages/firebase_messaging. Once you completed the guide, copy the Firebase account service configuration file under Apache or Lighttpd monday folder and edit file under root_server_folder/monday/api/config/firebase.php, line with withServiceAccount function, setting the right name of the file generated by Firebase console. Finally uncomment lines 27 to 29 of main.dart file of mobile app.

Back-end: with Raspbian ready to use and a running Apache or Lighttpd server instance, folders "api" and "process" have to be created under root_server_folder/monday. Remember to install PHP on Raspbian for executing all PHP code.

Systemctl services: copy/paste all configuration files within directory /etc/systemd/system

Mosquitto broker: once you have installed and configured an instance of Mosquitto broker, set the right credentials for allowing Monday to access it, on file under root_server_folder/monday/api/config/mosquitto.php

Maria-db: install and configure maria-db server on Raspbian; edit file under root_server_folder/monday/api/config/database.php with all information needed for accessing database; create a database named monday; import Monday database inside Maria-db server instance.