meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
homeautomation2017:group3:start [2017/03/10 11:58]
suganmira
homeautomation2017:group3:start [2017/03/11 01:11] (current)
suganmira
Line 42: Line 42:
  
 ===== Cognitive Prediction (Code Snippet) ===== ===== Cognitive Prediction (Code Snippet) =====
- +This is the Predition service code sample to train the neural network model with collected home data 
-''// This is the Predition service code sample to train the neural network model with  +<code>
-// collected home data. +
 var brain = require('brain'); var brain = require('brain');
- 
 var fs = require('fs'); var fs = require('fs');
  
 // Training data for temperature, humidity and switch response // Training data for temperature, humidity and switch response
 var training_data = JSON.parse(fs.readFileSync('training.json', 'utf8')); var training_data = JSON.parse(fs.readFileSync('training.json', 'utf8'));
 +var net = new brain.NeuralNetwork();
  
- 
-var net = new brain.NeuralNetwork(); 
 // Training the neural network // Training the neural network
 net.train(training_data); net.train(training_data);
Line 60: Line 56:
 // Predict a switch response based on a temperature and humidity input // Predict a switch response based on a temperature and humidity input
 var output = net.run([0.22, 0.11]);     // 0.00112'' var output = net.run([0.22, 0.11]);     // 0.00112''
 +</code>
  
 ===== FHEM Definitions (Code Snippet) ===== ===== FHEM Definitions (Code Snippet) =====
-''Normal Mode +Normal Mode 
-define NormalMode notify DoorWindowSensor {if (($EVENT eq "closed") && (ReadingsVal("TempHumiditySensor","temperature","") >= 25.0)) {fhem "set Switch on"} else {fhem "set Switch off"}}+<code> 
 +define NormalMode notify DoorWindowSensor { 
 +   if (($EVENT eq "closed") && (ReadingsVal("TempHumiditySensor","temperature","") >= 25.0)) { 
 +        fhem "set Switch on" 
 +         
 +   else { 
 +       fhem "set Switch off" 
 +        } 
 +  } 
 +</code>
  
 Shield Mode Shield Mode
-define ShieldMode notify MotionSensor {if (($EVENT eq "motion")) {fhem "set Switch off"}}+<code> 
 +define ShieldMode notify MotionSensor { 
 +    if (($EVENT eq "motion")) { 
 +        fhem "set Switch off" 
 +        } 
 +  } 
 +</code>
  
 Child Mode Child Mode
-define ChildMode notify DoorWindowSensor {if (($EVENT eq "open")) {fhem "set Switch on"} else {fhem "set Switch off"}}''''Monospaced Text'' +<code> 
 +define ChildMode notify DoorWindowSensor { 
 +     if (($EVENT eq "open")) { 
 +         fhem "set Switch on" 
 +         } 
 +     else { 
 +         fhem "set Switch off" 
 +         } 
 +  
 +</code>
  
  
Line 128: Line 148:
   * Code Package : {{ :homeautomation2017:group3:ai-service.zip |}} {{ :homeautomation2017:group3:cognitivelivingweb-frontend.zip |}}   * Code Package : {{ :homeautomation2017:group3:ai-service.zip |}} {{ :homeautomation2017:group3:cognitivelivingweb-frontend.zip |}}
   * Presentation Slides : {{ :homeautomation2017:group3:cognitiveliving.pptx |}}   * Presentation Slides : {{ :homeautomation2017:group3:cognitiveliving.pptx |}}
-  * Report : +  * Report : {{ :homeautomation2017:group3:cognitive-living_report.pdf |}}
   * Energy Analysis : {{ :homeautomation2017:group3:standby-energy-consumption-stats.xlsx |}}   * Energy Analysis : {{ :homeautomation2017:group3:standby-energy-consumption-stats.xlsx |}}