Skip to content

Smart home thermostat web-server built using Flask and vanilla JS, CSS3, and HTML5

Notifications You must be signed in to change notification settings

OpenSHT/SmartHub

Repository files navigation

alt text

GitHub GitHub issues GitHub top language GitHub repo size GitHub forks GitHub stars GitHub contributors

Reason to Exist:

This project aims to fill a gap in the market of smart home thermostats for Do-It-Yourselfers and Power-users; those looking to build their own projects and have full control, without having to tackle the learning curve of larger ecosystems (OpenHAB, SmartThings, etc).

The goal is to provide greater extensibility than modern competitors (EcoBee, Nest, etc) in terms of extra sensors, types of sensors and custom settings on your homes temperature control. Currently the system supports:

  • up to x20 Bluetooth Classic temperature/humidity/motion sensors (Indoor/Outdoor)
  • Unlimited 2.4 GHz NRF wireless sensors (within limits of compute power)
  • Future support for simultaneous use of BLE sensors
  • App settings for home, awake, and away temperature setpoints
  • Intelligent operation by correlating with outdoor temperature (OpenWeatherMap/Sensors)

Table of Contents

RoadMap

Current Features:

  • Responsive and mobile friendly Web APP that can set a centered background image, tiled image, or a custom color
  • Thermostat support for modern HVAC systems that DO NOT have a compressor
  • Seperate thermostat settings for Home Awake, and Away
  • OpenWeatherMap API integration
  • ESP32 NodeMCU External sensors feeding local and remote sensor data
  • Support for the DHT 11 / 22 / 21 on a GPIO connection
  • Support for any micro-controller streaming the data as (hum,temp):
  •     <64.8,23.5>
    
  • C/C++ code for the Arduino and ESP32 NodeMCU using the DHT11/22 sensor

Future Hub Integrations:

  • Alexa API
  • Google SmartHome
  • IFTTT
  • OpenHab
  • SmartThings
  • IOT Security Cameras (PiZero or other)
  • Possibly other sensors that are on the market

Features in need of YOU!, the open source community

  • Additional Thermostat configurations, such as:
    • Compressor system
    • Boiler system
    • No common (White wire usually)
    • Heat pump system
    • Humidifier/Dehumidifier?
  • Any of the aforementioned Integrations will be quite the project

Raspberry Pi Setup:

(Tested on RPI 3B+, 3)

  1. Write the iso using 'dd':

     sudo dd bs=4M if=YYYY-MM-DD-raspios-buster-armhf.img of=/dev/sdb conv=fdatasync status="progress"
    
  2. If using the HDMI&USB Connected TFT Touchscreens 'made' for RPi:

    i. With the fresh SD still plugged in, access the "/boot/config.txt" file

    ii. add the following options:

         hdmi_force_hotplug=1
         hdmi_group=2
         hdmi_mode=87
         hdmi_cvt=800 480 60 6 0 0 0
         hdmi_drive=1
         max_usb_current=1
    

    iii. Be sure to change to the appropriate resolution for the screen

  • NOTE: if you need ssh on first boot, place an empty file named '.ssh' in /rootfs
  1. Setup Auto Update:

     sudo apt-get install unattended-upgrades
    
  2. Configure interfaces and hostname etc...:

    i. Open terminal and type:

     sudo nano /etc/hosts
    

    ii. add the hostname 'openhub' to localhost as well as any 'static' IP you may have reseved on your router

Troubleshooting

  • "Permission denied" when trying to read a serial device. first step, list your usb connections with:

      ls /dev/tty*
    
  • next, we need to give to give ourselves permission to read and write to it with:

      sudo chmod a+rw /dev/ttyUSB0
    

Technologies

Requirements:

  • Flask>=1.1.2
  • Flask-APScheduler>=1.11.0
  • pyserial>=3.4

Pseudo Code:

alt text

Mobile Screenshots

Control panel Control panel Mobile Navbar














Control panel Control panel Mobile Navbar
























Desktop Screenshots

/thermostat

Control panel Control panel









/schedules ... /settings

Scheduler Solid color background









Centered image Tiled image