Skip to content

Commit

Permalink
v2.1 fix home onoff
Browse files Browse the repository at this point in the history
  • Loading branch information
NitrofMtl committed Dec 17, 2018
1 parent 82f5116 commit e2abbdf
Show file tree
Hide file tree
Showing 32 changed files with 63 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Arduino-Home-Thermostat Version 2.0
# Arduino-Home-Thermostat Version 2.1
10 rooms thermostat


Expand Down
Binary file modified app/build app/android/app-debug.apk
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@


<ion-content padding>
<ion-list *ngFor = "let input of inputs">
<ion-list *ngFor = "let input of inputs; let i = index">
<div>
<h5>{{input.canal}} : </h5>
<h3 class="h3temp">{{input.temperature}} \xB0C</h3>
<h3 class="h3offset"> Offset {{input.offset}}</h3>
<button ion-button round (tap)="minus(i)">-</button>
<h3>{{input.canal}} : </h3>
<h3> Offset {{input.offset}}</h3>
<button ion-button round (tap)="plus(i)">+</button>
</div>
<ion-item>
<ion-range [(ngModel)]="input.offset" color="darkblue" pin="true"min="-25" max="25" step="1" list="tickmarks" (ionChange)="changeOffset(input.canal, input.offset)"></ion-range>
</ion-item>
<!--<h3 class="tcenter">{{input.temperature}} \xB0C</h3>-->
<h3 class="tcenter">{{input.temperature.toFixed(2)}} \xB0C</h3>
</ion-list>
</ion-content>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@

}
}
div.inputContner {
display: inline-block;
}
.tcenter {
justify-content: center;
text-align: center;
}
border-radius: 20px 19px 70px 70px;
-moz-border-radius: 20px 19px 70px 70px;
-webkit-border-radius: 20px 19px 40px 40px;
border: 4px solid #3a7080;

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ export class ConfigsInputsPage {
request: 'unsubscribe'
}

plus(chan: number) {
if (this.inputs[chan].offset < 25) {
this.inputs[chan].offset++;
this.changeOffset(chan, this.inputs[chan].offset);
}
}

minus(chan: number) {
if (this.inputs[chan].offset > -25) {
this.inputs[chan].offset--;
this.changeOffset(chan, this.inputs[chan].offset);
}
}

changeOffset(chan: number, input: number): void {

let configChannel = {
Expand Down
4 changes: 3 additions & 1 deletion app/src/ardThermostatApp/src/pages/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export class HomePage {
}*/

switchChannel(cb: Channel) { //version websocket
let switchCh = cb.canal;
let switchCh = {
canal: cb.canal
}

let postMessage = {
id: "homeSwitch",
Expand Down
2 changes: 1 addition & 1 deletion app/src/ardThermostatApp/src/pages/load/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class LoadPage {

ionViewDidEnter() {
console.log('ionViewDidLoad LoadPage');
this.statusMessage = "Getting adrresse from storage";
this.statusMessage = "Getting addresse from storage";
//console.log(this.statusMessage);
this.server.getServer().then(()=>{
this.statusMessage = "Got data. Check for server response";
Expand Down
6 changes: 0 additions & 6 deletions multi_room_thermostat/Backup.ino
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ void restore() {
//alarm.prettyPrintTo(Serial);
SPAlarm[alarmTag].parseJSON(alarm);

/*byte alarmType = alarm["type"]; ////???
bool alarmSwitch = alarm["switch"];
byte wHour = alarm["hour"];
byte wMin = alarm["minute"];
SPAlarm.set(alarmTag, alarmType, alarmSwitch, wHour, wMin);*/

JsonArray& setpoints = alarm["setpoints"];
//setpoints.prettyPrintTo(Serial);

Expand Down
6 changes: 6 additions & 0 deletions multi_room_thermostat/Setup.ino
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,9 @@ void init_alarmMemory() { //initiane alarm memory matrix to 21C by default
}
}
}

void blink13() {
static bool state = false;
digitalWrite(13, state);
state = !state;
}
2 changes: 1 addition & 1 deletion multi_room_thermostat/WebCmd.ino
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ JsonObject& JSONconfigs__Corrected(JsonBuffer& jsonBuffer) {
JsonObject& chan_in = jsonBuffer.createObject();
chan_in["offset"] = inChannelID[i].offset;
chan_in["canal"] = String(i);
chan_in["temperature"] = inChannelID[i].Ainput;
chan_in["temperature"] = roundToDigit(inChannelID[i].Ainput, 2);//inChannelID[i].Ainput;
chan.add(chan_in);
}
configs["systemTime"] = systemTime(jsonBuffer);
Expand Down
7 changes: 4 additions & 3 deletions multi_room_thermostat/WebSocket.ino
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ void wsRequestHandler(JsonObject& root, int num) {
for (int i = 0; i < SWSPC; i++) { //i for request index
if ( strcmp(root["id"], wsPutContainer[i].id) == 0 ) {
Serial << "found put request: " << wsPutContainer[i].id << endl;
root["data"].printTo(Serial); Serial << endl;
wsPutContainer[i].parse(root["data"]);
backup(); //store any change data
}
Expand Down Expand Up @@ -166,18 +167,18 @@ void wsSubscribeDataHome() {
}

void wsParseHomeSwitch(JsonObject& data) {

//root.prettyPrintTo(Serial);
uint8_t chanId = data["switchCh"]["canal"];
uint8_t chanId = data["canal"];
outChannelID[chanId].channelSwitch = !outChannelID[chanId].channelSwitch;
//if (outChannelID[chanId].channelSwitch) Serial.println("true"); else Serial.println("false");
wsSubscribeDataHome();//update live data to devices
}

void wsParseHomePutSetpoint(JsonObject& data) {
//data.prettyPrintTo(Serial); // for debug
byte chanId = data["canal"];
strcpy(inChannelID[chanId].channelName, data["name"]);
outChannelID[chanId].sp = data["setpoint"];
wsSubscribeDataHome();//update live data to devices
}

//-----------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion multi_room_thermostat/multi_room_thermostat.ino
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ Interval timerMainRegulator;
Interval timerWeeklyAlarm;
Interval timerSSROutput;
Interval timerWebSocket[WEBSOCKETS_SERVER_CLIENT_MAX];
Interval led13;
void blink13();

//programable alarm section
const byte numAlarm = 10; // set the number of alarm
Expand Down Expand Up @@ -148,7 +150,8 @@ void setup() {

Serial.print("Free memory is: ");
Serial.println(freeMemory());

pinMode(13, OUTPUT);
led13.interval(2000, blink13);
}

//-----------------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions version_history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version history:

2.1
-Fix on/off home button
-Change slider to +- button and fix to 2 digit temps on input calibration
-Add led13 flash to track arduino status ok

Knowed bugs:
-Windows platform seem to not connect with local connection.
-Silder temp adjust setpoint do not display properly on windows.

0 comments on commit e2abbdf

Please sign in to comment.