SmartHouse Architecture

Andrii Kucherenko
Yuriy Tkachenko

Smart House

SMART_HOUSE
    .get_api('0.0.1')
    .then(function (api){
        api.on('message', ['in-house-temperature'], function(){
            var in_house_temperature = api.device.get('in-house-temperature');
    
            if (in_house_temperature.value > 25) {
              console.log('it`s HOT');
            }
    
            if (in_house_temperature.value < 15) {
              console.log('it`s COLD');

              api.device.get('light-diode').send('ON');
            }
    
        });
    });

SMART_HOUSE
        .get_api('0.0.1')
        .then(function(api){
            api.on('message', ['temperature', 'humidity'], function() {
                console.log('New message from temperature device', 
                        api.device.get('temperature').value);
                console.log('New message from humidity device', 
                        api.device.get('humidity').value);
            });
        });

Архитектура

SMART_HOUSE
    .get_api('0.0.1')
    .then(on_api_get);

function on_api_get(api){
    api
        .stream
        .input
        .filter(e=>e.device === SOURCE_DEVICE_ID)
        .map(get_new_state)
        .filter(v=>!!v)
        .distinctUntilChanged()
        .subscribe(send_value);


    function get_new_state(event) {
        var input_value = Number.parseInt(event.value);
        if (input_value > (THRESHOLD + SHIFT/2)) {
            console.log('OFF: ', input_value);
            return 'OFF';
        }

        if (input_value < (THRESHOLD - SHIFT/2)) {
            console.log('ON: ', input_value);
            return 'ON';
        }
    }


    function send_value(value){
        api.device.get(EXECUTOR_DEVICE_ID).send(value);
    }
}

Разработка SmartHouse

github
travis ci
taiga.io
coding ninja
heroku

etc..

JS Mentoring Program

Coding Day

Init project

3 weeks of home work and tranings

3 weeks of home work and tranings

3 weeks of home work and tranings

3 weeks of home work and tranings

Coding Day

Coding Day

Delivery day

JavaScript Mentoring Plus Program 

12 weeks

Coordinator/Owner

Leads/Mentors

Developers/Mentees

QAs/UX/BA

SmartHouse

Ideas to implement

  • Auth/ACL 
  • Statistic aggregation and monitoring
  • Map visualization
  • Mobile/native applications
  • New hardware support

Feel free to add new ideas

https://github.com/garage-it/

https://tree.taiga.io/project/kucherenko-smart-home/

Questions?

Thank you

SmartHouse Architecture

By Andrey Kucherenko

SmartHouse Architecture

  • 1,677