Giter Site home page Giter Site logo

pavelprokes / pavels-homespan-thermostat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 5hubh4m/homespan-thermostat

0.0 1.0 0.0 1.26 MB

HomeKit connected smart thermostat based on Arduino using HomeSpan. Now upgraded with OLED display, database logging, HTU21D and rounded temp.

License: MIT License

C++ 100.00%

pavels-homespan-thermostat's Introduction

Pavel's HomeSpan Thermostat

Forked from https://github.com/5hubh4m/homespan-thermostat

HomeKit connected smart thermostat based on Arduino using HomeSpan.

Background and Motivation

I have a boiler at home that heats the apartment. I wanted a smarter solution than a stupid thermostat. Control the thermostat using HomeKit, according to time, location and everything that HomeKit allows. I searched and found this repository. I'm not a C++ expert and my modified code looks like that. But I wanted to go ahead and make it better. Display for those who are in the room and go to see the temperature and how the temperature is set. I will gradually add the description, connections, a box printed from a 3D printer and other information.

Original(I have a 24 V Heat-only system with a 2-wire system (No C wire, only R and W). It used a manual Honeywell single-point thermostat. I wanted to get the functionalities of a HomeKit compatible smart thermostat without the hassle of installing a C wire myself and/or having to buy an expensive smart thermostat. So I created my own with a Wi-Fi capable microcontroller.)

Hardware

I used a Adafruit ESP32-S2 Feather board, along with a TMP36 analog temperature sensor, and a simple non-latching relay.

I wired up the TMP36 to an analog input pin (A5 i.e 8) and the relay to a digital pin (10), and connected the relay to the R and W wires in my heating panel in the NO mode i.e when the relay is off, the heater is also off. The circuit diagram is given below.

Software

Flashing the Code on the Microcontroller

Use the Arduino IDE to flash the code to the microcontroller. You could also do it using arduino-cli in either serial mode or OTA mode.

cd path/to/homespan_thermostat
arduino-cli compile -b esp32:esp32:adafruit_feather_esp32s2 --port PORT_PATH --protocol serial --upload

Or

cd path/to/homespan_thermostat
arduino-cli compile -b esp32:esp32:adafruit_feather_esp32s2 --port BOARD_IP --protocol network --upload

The latter will promt you for the OTA password. The default OTA password for HomeSpan is homespan-ota. It is recommended that you change it in the source code (see below) or using the O command of the HomeSpan CLI.

Configuration and Usage

There are a few parameters that need to be configured.

  • The Wi-Fi credentials can be defined in the source code as the macros WIFI_SSDI and WIFI_PASSWORD or can be set using the W command of the HomeSpan CLI.
  • The HomeKit pairing code can be defined in the source code as the macro HOMEKIT_PAIRING_CODE. Otherwise the default code 466-37-726 is used or it can be set using the S command of the HomeSpan CLI.
  • The HomeKit QR Setup ID can be defined in the source code as the macro HOMEKIT_PAIRING_QR_ID. Otherwise the default QR Setup ID HSPN is used or it can be set using the Q command of the HomeSpan CLI.
  • The OTA Password can be defined in the source code as the macro DEFAULT_OTA_PASSWORD. Otherwise the default password homespan-ota is used or it can be set using the O command of the HomeSpan CLI.

Pair the accessory to HomeKit. The general instructions are given here. That's pretty much it.

For my particular heating setup, I have enabled two heating modes: Heating, and Auto. Heating mode allows you to set a single Target Temperature which the thermostat will try to maintain. However, depending on how well insulated your home is, and how cold it is outside, it can lead to the heater turning on and off frequently consuming a lot of energy. Auto mode fixes that by allowing you to set two temperatures, a Heating Threshold and a Cooling Threshold. In this mode, the thermostat will only turn on if the temperature reaches below the Heating Threshold, and will provide heat until the Cooling Threshold is reached. This allows the heater to be on for a longer period of time, but also be turned off for a longer periods of time, which is more energy efficient than being turned on in bursts.

If you're connected to HomeKit, you should be able to control your heater using Siri.

This image shows how the this thermostat looks in the Home app.

TODO

  • images
  • 3D print model

pavels-homespan-thermostat's People

Contributors

5hubh4m avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.