0.8.1 • Published 4 years ago

@tomvh/home-automation v0.8.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Home automation

nmp badge

ESLint

Markdown Linter

Tests

Description

This app will provide a json of the airco and heater. When the temperature is too low, the heater will turn true and the airco false. when the temperature is too high, the airco will turn true and the heater false. When the temperature is perfect, the airco and the hearer are false.

you can provide more dan 1 unit. this converter works with Celsius, Fahrenheit and Kelvin it will convert automatically to the correct unit.

Installation instruction

Make sure typescript is installed at your PC. You can find how to install here:

https://www.typescriptlang.org/v2/download

Once installed: All you need to do is set the temperatures in the wanted unit with a json object.

npm publish package

npm init --scope@my-org
npm publish --access public

Multiple usage instructions and examples

The temperatures (json objects) are now hard code in our project. You can modify the app to read values from a real sensor. This app is just a example of the usage. First step is download the project to you pc. The first json object in the app is the setting of the thermostat. You need to provide a fixed temperature, the range and the unit of your temperature value.

{
 "temperature": 25,
 "range": 1.0,
 "unit": "Celcius"
}

Next, you'll provide json objects with the temperature and unit. This object looks like:

{
 "temperature": 28.0,
 "unit": "Celsius"
}

There are some examples of these objects in the code. Next, you'll open the command line interface and type:

ts-node index.ts

And the app will run. If you hadn't modify the project, you'll use the hard code values (the json objects like above) and it will return a json object in the cli that tells the airco and heater what to do.

{
 "cooling": true,
 "heating": false
}

this is the result of the temperature of 28°C with an temperature set on 25°C with an range of 1°C, this is will return a true for the airco and a false for the heater. You can set many temperatures that you wanted. You can set many values you want in any unit. it will convert automatically.

V0.5 adds a temperature thats comes from a website. You don't need to do much, you only need to specify a url in the app.ts file. Look for the method app2(). You also need to provide some settings. You can choose what you want.

    const http = new HttpThermostat('http://dummy-sensors.azurewebsites.net/api/sensor/abba5');
    http.settings(20, 1, "Celsius");

You'll also get a json object as return.

{
 "cooling": true,
 "heating": false
}

You can view the full description of the classes in the next website Description

There are some test build in too, don't hesitate to use them! They give a nice indication of how good (or bad) you're programming. You can start the test by the following command

npm test

Licence

This project, is under the MIT licence. View the license file for full license description. You can find this file here: license.md

Author information

Name: Van Hove Tom
Email: r0742463@student.vives.be
Role: student
School: Vives University
Location: Bruges Belgium

0.8.1

4 years ago

0.8.0

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.5.0

4 years ago

0.6.0

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

1.0.0

4 years ago