Git Product home page Git Product logo

automatic-air-conditioner's Introduction

Setup

Hardware

Project sketch

Software

  • Python 3

  • Pyhton modules Adafruit_DHT and RPi.GPIO

How to run

  • Create a config (i.e. with cp ./config.example.json ./config.json)

  • python3 main.py

Usage

The threshold temperature or the timeout period between the switches can be changed in the config.json file.

Program will adapt settings in next 10 seconds and does not require a restart

automatic-air-conditioner's People

Contributors

ebakoba avatar mariak4s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

automatic-air-conditioner's Issues

RelayService

This service should know in which state the relay currently is and also implement a function to switch to another state.

Implementation should look something like this:

class RelayService:
    def __init__(self, pin):
        # implementation

    def get_state():
        # implementation

    def switch():
        # implementation

Usage

relayService = RelayService(16)

current_state = relayService.get_state()
relayService.switch()

For the GPIO interaction this library should be used.

Configuration service

Configuration service should be able to read in config.json and serve values contained there to rest of the program.

Example of config.json, where threshold is on switch temperature in Celsius and is switch
so called cooldown period in minutes

{
  "threshold": 24,
  "cooldown": 60
}

Usage of this service should look something like this

from configuration import ConfigService

configService = ConfigService()

config = configService.getConfig()

threshold = config['threshold']
cooldown = config['cooldown']

One MUST HAVE aspect of the config service is that it must be live reloaded. Meaning that program must adapt changes is config without being restarted. Threads must be used for this, one option is to declare setInterval method like this.

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.