Skip to content

Commit

Permalink
Add support for the Heatmiser Neo
Browse files Browse the repository at this point in the history
Update license to MIT, same as Ben Pirt original work
  • Loading branch information
Carlos Sanchez committed Apr 28, 2014
1 parent 70a21df commit ee47c4e
Show file tree
Hide file tree
Showing 10 changed files with 811 additions and 389 deletions.
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
heatmiser-node
==============

A nodejs module to talk to heatmiser thermostats
A nodejs module to talk to Heatmiser WiFi and Neo thermostats

Credits
See more examples in the `examples` dir

* Ben Pirt for the reading functions in Node https://github.com/bjpirt/heatmiser-js
* heatmiser-wifi Perl project for the overall ideas and algorithms https://code.google.com/p/heatmiser-wifi/
# Heatmiser Neo

var neo = new Neo("192.168.1.100");

neo.on('success', function(data) {
console.log(data);
});
neo.on('error', function(data) {
console.log(data);
});

# Reading the thermostat status
neo.info();
neo.statistics();
neo.setAway(true, ["living","kitchen"]);


# Heatmiser WiFi

## Reading the thermostat status

var hm = new Heatmiser('localhost', 1234);

Expand All @@ -21,7 +36,7 @@ Credits

hm.read_device();

# Writing to the thermostat
## Writing to the thermostat

var dcb;

Expand All @@ -45,3 +60,8 @@ Credits
}
}
hm.write_device(dcb);

# Credits

* Ben Pirt for the Heatmiser WiFi reading functions in Node https://github.com/bjpirt/heatmiser-js
* heatmiser-wifi Perl project for the overall ideas and algorithms https://code.google.com/p/heatmiser-wifi/
61 changes: 61 additions & 0 deletions examples/example-neo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
var heatmiser = require("../lib/heatmiser");

var neo = new heatmiser.Neo("192.168.1.112");

neo.on('success', function(data) {
console.log(data);
});
neo.on('error', function(data) {
console.log(data);
});

neo.info();
neo.statistics();

var devices = ['bathroom', 'livingroom'];

neo.setAway(false, devices);
neo.setStandby(false, devices);

var comfortLevels = {
"bathroom": {
"monday": {
"wake": ["07:00", 20],
"leave": ["09:00", 16],
"return": ["24:00", 21],
"sleep": ["24:00", 16]
},
"sunday": {
"wake": ["09:00", 20],
"leave": ["11:00", 16],
"return": ["24:00", 21],
"sleep": ["24:00", 16]
}
},
"livingroom": {
"monday": {
"wake": ["07:00", 19],
"leave": ["08:30", 16],
"return": ["16:30", 19],
"sleep": ["23:00", 16]
},
"sunday": {
"wake": ["09:00", 19],
"leave": ["10:00", 16],
"return": ["20:00", 19],
"sleep": ["23:00", 16]
}
}
}

var keys = Object.keys(comfortLevels);
for (var i=0; i<keys.length; i++) {
var name = keys[i];
neo.setComfortLevels(comfortLevels[name], [name]);
}


var wait = function() {
console.log("waiting");
}
setTimeout(wait, 1000);
43 changes: 43 additions & 0 deletions examples/example-wifi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
var heatmiser = require("../lib/heatmiser");

var hm = new heatmiser.Wifi("192.168.1.100", 1234);

hm.on('success', function(data) {
console.log(data);
});
hm.on('error', function(data) {
console.log(data);
});

hm.read_device();

var dcb;

// set temperature

// target before hold!
var dcb1 = {
heating: {
target: 20
}
}
var dcb2 = {
heating: {
hold: 5
}
}

hm.write_device(dcb1);
hm.write_device(dcb2);

// // set frost mode
dcb = {
runmode: 'frost'
}
hm.write_device(dcb);

// // set current date and time
dcb = {
time: new Date()
}
hm.write_device(dcb);
120 changes: 120 additions & 0 deletions examples/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"devices": [
{
"AWAY": false,
"COOLING": false,
"COOLING_ENABLED": false,
"COOLING_TEMPERATURE_IN_WHOLE_DEGREES": 0,
"COUNT_DOWN_TIME": "0:00",
"CRADLE_PAIRED_TO_REMOTE_SENSOR": false,
"CRADLE_PAIRED_TO_STAT": false,
"CURRENT_FLOOR_TEMPERATURE": 22,
"CURRENT_SET_TEMPERATURE": "7.0",
"CURRENT_TEMPERATURE": "17.9",
"DEVICE_TYPE": 1,
"ENABLE_BOILER": false,
"ENABLE_COOLING": false,
"ENABLE_PUMP": false,
"ENABLE_VALVE": false,
"ENABLE_ZONE": false,
"FAIL_SAFE_ENABLED": false,
"FLOOR_LIMIT": false,
"FULL/PARTIAL_LOCK_AVAILABLE": false,
"HEAT/COOL_MODE": false,
"HEATING": false,
"HOLD_TEMPERATURE": 21,
"HOLD_TIME": "0:00",
"HOLIDAY": false,
"HOLIDAY_DAYS": 0,
"HUMIDITY": 0,
"LOCK": false,
"LOCK_PIN_NUMBER": "0000",
"LOW_BATTERY": false,
"MAX_TEMPERATURE": "21.0",
"MIN_TEMPERATURE": "18.0",
"MODULATION_LEVEL": 0,
"NEXT_ON_TIME": "255 days 255:255",
"OFFLINE": false,
"OUTPUT_DELAY": 0,
"PREHEAT": false,
"PREHEAT_TIME": "255:255",
"PROGRAM_MODE": "5DAY/2DAY",
"RADIATORS_OR_UNDERFLOOR": false,
"SENSOR_SELECTION": "BUILT_IN_AND_FLOOR",
"SET_COUNTDOWN_TIME": 0,
"STANDBY": true,
"STAT_MODE": {
"THERMOSTAT": true
},
"TEMPERATURE_FORMAT": false,
"TEMP_HOLD": false,
"TIMECLOCK_MODE": false,
"TIMER": false,
"TIME_CLOCK_OVERIDE_BIT": false,
"VERSION_NUMBER": 69,
"WRITE_COUNT": 11,
"ZONE_1PAIRED_TO_MULTILINK": true,
"ZONE_1_OR_2": false,
"ZONE_2_PAIRED_TO_MULTILINK": false,
"device": "livingroom"
},
{
"AWAY": false,
"COOLING": false,
"COOLING_ENABLED": false,
"COOLING_TEMPERATURE_IN_WHOLE_DEGREES": 0,
"COUNT_DOWN_TIME": "0:00",
"CRADLE_PAIRED_TO_REMOTE_SENSOR": false,
"CRADLE_PAIRED_TO_STAT": false,
"CURRENT_FLOOR_TEMPERATURE": 255,
"CURRENT_SET_TEMPERATURE": "7.0",
"CURRENT_TEMPERATURE": "18.0",
"DEVICE_TYPE": 1,
"ENABLE_BOILER": false,
"ENABLE_COOLING": false,
"ENABLE_PUMP": false,
"ENABLE_VALVE": false,
"ENABLE_ZONE": false,
"FAIL_SAFE_ENABLED": false,
"FLOOR_LIMIT": false,
"FULL/PARTIAL_LOCK_AVAILABLE": false,
"HEAT/COOL_MODE": false,
"HEATING": false,
"HOLD_TEMPERATURE": 21,
"HOLD_TIME": "0:00",
"HOLIDAY": false,
"HOLIDAY_DAYS": 0,
"HUMIDITY": 0,
"LOCK": false,
"LOCK_PIN_NUMBER": "0000",
"LOW_BATTERY": false,
"MAX_TEMPERATURE": "20.0",
"MIN_TEMPERATURE": "18.0",
"MODULATION_LEVEL": 0,
"NEXT_ON_TIME": "255 days 255:255",
"OFFLINE": false,
"OUTPUT_DELAY": 0,
"PREHEAT": false,
"PREHEAT_TIME": "255:255",
"PROGRAM_MODE": "5DAY/2DAY",
"RADIATORS_OR_UNDERFLOOR": false,
"SENSOR_SELECTION": "BUILT_IN_AIR_SENSOR",
"SET_COUNTDOWN_TIME": 0,
"STANDBY": true,
"STAT_MODE": {
"THERMOSTAT": true
},
"TEMPERATURE_FORMAT": false,
"TEMP_HOLD": false,
"TIMECLOCK_MODE": false,
"TIMER": false,
"TIME_CLOCK_OVERIDE_BIT": false,
"VERSION_NUMBER": 69,
"WRITE_COUNT": 4,
"ZONE_1PAIRED_TO_MULTILINK": true,
"ZONE_1_OR_2": false,
"ZONE_2_PAIRED_TO_MULTILINK": false,
"device": "bathroom"
}
]
}
39 changes: 39 additions & 0 deletions examples/statistics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"houserecords": {
"highestmonthtemp": "280.5",
"highestweektemp": "280.5",
"highestyeartemp": "280.5",
"lowestmonthtemp": "10.0",
"lowestweektemp": "10.0",
"lowestyeartemp": "10.0"
},
"preheatrecords": {
"monthrun": "bathroom",
"weekrun": "bathroom",
"yearrun": "bathroom"
},
"preheatstarts": {},
"roomrecords": {
"bathroom": {
"highestmonthtemp": "280.5",
"highestweektemp": "280.5",
"highestyeartemp": "280.5",
"lowestmonthtemp": "17.9",
"lowestweektemp": "17.9",
"lowestyeartemp": "17.9"
},
"livingroom": {
"highestmonthtemp": "280.5",
"highestweektemp": "280.5",
"highestyeartemp": "280.5",
"lowestmonthtemp": "16.9",
"lowestweektemp": "16.9",
"lowestyeartemp": "16.9"
}
},
"runrecords": {
"monthrun": "livingroom",
"weekrun": "livingroom",
"yearrun": "livingroom"
}
}
Loading

0 comments on commit ee47c4e

Please sign in to comment.