maxnowack / node-eq3ble Goto Github PK
View Code? Open in Web Editor NEWnode.js package to control an EQ3 bluetooth thermostat
License: GNU General Public License v3.0
node.js package to control an EQ3 bluetooth thermostat
License: GNU General Public License v3.0
here is my original issue: maxnowack/homebridge-eq3ble#24
package is not installable using node 10 (LTS version now).
this is most probably because of noble/node-bluetooth-hci-socket#84.
dependencies: node-eq3ble <- noble-device (which is not installable with node 10)
one solution would be to switch the node-eq3ble to https://www.npmjs.com/package/@nullent1ty/noble-device, wdyt ?
i have node 7.4.0
After running
var EQ3BLE = require('eq3ble');
EQ3BLE.discover((device) => {
device.connectAndSetup().then(() => {
// ...
})
})
i got:
TypeError: EQ3BLE.discover is not a function
at Object.<anonymous> (/home/pi/Projects/tempble/index.js:10:8)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3
Is there something wrong with inheritance?
Hi!
I was trying to make the https://github.com/maxnowack/homebridge-eq3ble work with my new thermostat. however, I've discovered strange problem.
when I do the discoverByAddress, then I'm getting Unhandled promise rejection (rejection id: 2)
:
code:
var EQ3BLE = require('eq3ble');
require('log-timestamp');
console.log('started discovery');
EQ3BLE.default.discoverByAddress('00:1a:22:06:69:85', function (device) {
console.log('discoverByAddress: discovered thermostat ' + device);
console.log('discoverByAddress: ' + device.id);
console.log('discoverByAddress: ' + device.uuid);
console.log('discoverByAddress: ' + device.address);
console.log('discoverByAddress: ' + device.addressType);
device.getInfo().then(function (info) {
console.log('discoverByAddress: ' + info);
});
});
output:
[2016-11-19T16:32:03.548Z] started discovery
[2016-11-19T16:32:25.828Z] discoverByAddress: discovered thermostat {"uuid":"f732af417b074113973a5402ea84a8b3"}
[2016-11-19T16:32:25.828Z] discoverByAddress: f732af417b074113973a5402ea84a8b3
[2016-11-19T16:32:25.828Z] discoverByAddress: f732af417b074113973a5402ea84a8b3
[2016-11-19T16:32:25.828Z] discoverByAddress: 00:1a:22:06:69:85
[2016-11-19T16:32:25.829Z] discoverByAddress: unknown
[2016-11-19T16:32:25.832Z] (node:52017) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: service uuid 3e135142654f9090134aa6ff5bb77046 not found!
[2016-11-19T16:32:25.832Z] (node:52017) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hi,
After using getInfo or setDatetime(new Date()) for getting eq-3 status - automatic mode stops working or works unpredictable.
Looking on Android Application getting status is performed by full setdate time command not just '03'.
And on the other hand I see some differences especially year is not in full format but last 2 digits (modulo 100):
Set Time:
public SetTimeCommand() {
this.commandData = new byte[7];
this.commandData[0] = (byte) 3;
GregorianCalendar calendar = new GregorianCalendar(TimeZone.getDefault());
calendar.setTimeInMillis(System.currentTimeMillis());
this.commandData[1] = (byte) (calendar.get(1) % 100);
this.commandData[2] = (byte) (calendar.get(2) + 1);
this.commandData[3] = (byte) calendar.get(5);
this.commandData[4] = (byte) calendar.get(11);
this.commandData[5] = (byte) calendar.get(12);
this.commandData[6] = (byte) calendar.get(13);
}
Get Status:
protected void onResume() {
...
((BLEApplication) getApp()).getBluetoothAPI().connectToGroup(this.groupID);
((BLEApplication) getApp()).getBluetoothAPI().sendCommandToGroup(this.groupID, new SetTimeCommand());
...
updateGroupStateUI(group);
}
Currently I have no fix for that.
As a workaround to get status from eq-3 and not disturbed automatic mode for getInfo I am using setAutomaticMode payload.
hi maxnowack,
any chance of reducing the license to MIT?
I've got a bunch of updates i did here https://github.com/alikh31/node-red-contrib-eq3-bluetooth which seems to be VERY similar code, but under an MIT license which you may find useful.
s
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.