Skip to content

I have a dream: to give HomeAssistant the ability to reason and perform actions logically and comprehensively, using AppDaemon, Sklearn, and Decision Tree.

License

Notifications You must be signed in to change notification settings

dadaloop82/MyHomeSmart-HASS-AppDeamon

Repository files navigation


Home assistant | AppDeamon | Scikit-learn (tree)

"Buy Me A Coffee"

[ Table of Content ]

1. Inspired by projects:

I sincerely thank these people for the great inspiration, ideas and information they have shared with me!

2. What does mean "Give intelligence to Home automation"?

Today we can enjoy several devices called "smart"; devices that seem to possess reasoning, logic and deduction skills in performing seemingly spontaneous actions. In reality, this is not the case at all, each device is programmed to do actions under certain conditions, without any understanding of what it is doing and the possible consequence that such actions can do. For example, smart speakers simply read what they find on the web, but they don't know if what they read is right or they cause the user to do the wrong thing. A smart television is not smart, it just offers more opportunities for digital services. And so on.

Giving intelligence to home automation means giving a logical and comprehensive reasoning to the action that the home automation system should do to reach a certain objective.

3. What is the goal of this project?

The goal of this project is to apply to Home Assistant (HASS) a system of automatic creation of dynamic automations able to activate or deactivate autonomously entities to achieve the prefixed purpose, whether it is dictated by the habits of the user or it is the right thing to do to achieve a certain purpose. Home assistant already has the ability to manually create automations based on various conditions and it is also capable of predicting possible situations (Bayesian Sensor) but it has not been conceived to autonomously implement actions without the user having programmed them in advance.

4. Can you give a simpler explanation?

A home automation system designed in this way would have the advantage of being able to autonomously perform actions for a given purpose, whether it is usually achieved by the user or the consequence of other factors.

Current Situation:

- There are 22°C in the house
- The heating is off
- The window is closed
- The optimal temperature is 20°C
- It's cooking at home

Learning Model:

- When the heaters are off, the temperature in the house rises
- When the windows are closed, the house temperature rises
- When cooking at home temperature rises

Decision tree:

- Can the radiators be turned on? [ YES ]
- Can windows be opened? [ YES - someone is in the house to do it ]
- Can you stop cooking ? [ NO ]

Reasoning:

- Are the radiators on at this time ? [ NO ]
- Have the radiators ever been turned on with the window open [ NO ]
= Turn on radiators is to be discarded

Final Solution

- Open the home window or ask the user to do so.

5. The configuration file

The configuration file is: apps.yaml

  • hass_myhomesmart

This is the name of the section that appDaemon wants to define the operation of the script

  • module

    The name of the python file that should run

  • class

    The name of the python class that must run for the script to work

  • config

    the configuration section for MyHomeSmart-HASS-AppDeamon

    • include_entities

      Entities that you want to include in the MyHomeSmart system

      • Can enter the name of the entity as provided by HomeAssistant

        example: sensor.room_temperature

      • Can insert the entity class to include all entities of the same class example: sensor.*

      The system will automatically recognize read-only entities from editable ones

    • exclude_entities

      Entities that you want to exclude from those included in the "include_entities" section

      • Can enter the name of the entity as provided by HomeAssistant

        example: sensor.room_temperature

      No value indicates that no entity, included in the section "include_entities" is excluded

6. How to install the script?

Follow these instructions ONLY if a stable, finished version has been released! Look at the top of this readme !

  • Install AppDeamon -> follow here

  • Open a file manager and go to folder

    [appDeamonFolder]/apps

  • Do a gitClone of this repository:

    git clone [email protected]:dadaloop82/MyHomeSmart-HASS-AppDeamon.git

    or

    git clone https://github.com/dadaloop82/MyHomeSmart-HASS-AppDeamon.git

  • Now you have the folder

    [appDeamonFolder]/apps/MyHomeSmart-HASS-AppDeamon

  • Open this configuration file and modify it according to the instructions in the file

    [appDeamonFolder]/apps/MyHomeSmart-HASS-AppDeamon/apps.yaml

  • Restart AppDeamon

  • Restart Home Assistant istance

  • Enjoy :)

About

I have a dream: to give HomeAssistant the ability to reason and perform actions logically and comprehensively, using AppDaemon, Sklearn, and Decision Tree.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages