Compare commits

...
29 Commits
Author SHA1 Message Date
Koenkk 738c31c758 0.1.1 2018-07-27 18:06:57 +02:00
Koenkk f8fcf3a7c8 Temp: lock zcl-packet to older version. #198 2018-07-27 17:49:56 +02:00
Koen Kanters ae863ba5ab Merge pull request #219 from jaaps/hue-bloom
Add Hue Bloom support
2018-07-27 17:39:45 +02:00
Koenkk 5e66019390 Update zigbee-shepherd-converters. 2018-07-27 17:39:31 +02:00
jaaps 696e6b4787 Add Hue Bloom support 2018-07-27 10:09:13 +02:00
Koen Kanters b33878304f Merge pull request #214 from Koenkk/issue_148
Add support for MQTT client ID. #148
2018-07-24 18:34:02 +02:00
Koenkk 6e71c48108 Merge branch 'issue_148' of https://github.com/Koenkk/zigbee2mqtt into issue_148 2018-07-24 18:31:41 +02:00
Koenkk 2b7aeed4fb Add support for MQTT client ID. #148 2018-07-24 18:31:16 +02:00
Koen Kanters b3cedc4ad1 Merge pull request #206 from tb-killa/rename-devices
Rename devices (friendly_name) ->  (#177)
2018-07-24 18:27:04 +02:00
Koenkk 8ea62f535e Update change friendly name of device. 2018-07-24 18:25:16 +02:00
Koenkk de879858a5 Update zigbee-shepherd-converters to 2.0.33. 2018-07-22 18:49:45 +02:00
Koenkk d4ba3ae069 Update zigbee-shepherd-converters. 2018-07-21 21:28:42 +02:00
Koenkk 0e608c7b2e Add disable_led option. #133 2018-07-21 21:13:28 +02:00
tb-killa aab18de88d ADD Rename Function via MQTT Command 2018-07-21 18:19:11 +02:00
tb-killa 6d684b7c11 ADD RenameFriendlyName Function 2018-07-21 18:15:56 +02:00
Koenkk 396e4b1bed Update zigbee-shepherd-converters. 2018-07-18 22:50:28 +02:00
Koenkk 04d7a87765 Fix logging of unsupported cid. #199 2018-07-18 22:30:51 +02:00
Koenkk 49878e093d Log message on unsupported cid. 2018-07-14 21:22:50 +02:00
Koenkk 209624cbef Update zigbee-shepherd-converters to 2.0.28. 2018-07-14 21:10:46 +02:00
Koen Kanters 65a9645677 Merge pull request #191 from tomusher/gledopto-rgbcct-controller-support
Add mapping for Gledopto RGB+CCT controller for Home Assistant
2018-07-12 17:47:29 +02:00
Koen Kanters ad41ed6dcf Merge branch 'dev' into gledopto-rgbcct-controller-support 2018-07-12 17:43:44 +02:00
Tom Usher b494136c22 Add mapping for Gledopto RGB+CCT controller for Home Assistant 2018-07-11 13:19:01 +01:00
Koenkk 356ed9fa39 Update zigbee-shepherd and zigbee-shepherd-conveters for 324131092621 support. #36 2018-07-10 18:43:31 +02:00
Koenkk 8b5938f73f Update zigbee-shepherd-converters. 2018-07-07 23:39:30 +02:00
Koenkk 51d8c79ef2 Update zigbee-shepherd (includes firmware revision information). https://github.com/Koenkk/zigbee2mqtt/issues/178 2018-07-05 21:23:30 +02:00
Koenkk 3897541366 Log zigbee-shepherd information on startup. #178 2018-07-05 20:06:38 +02:00
Koenkk 0eee507edb Travis.yml check if TRAVIS_TAG is set to “”. 2018-07-05 20:00:12 +02:00
Koenkk caf87e805d Update zcl-packet. https://github.com/Koenkk/zigbee2mqtt/issues/150 2018-07-05 19:43:54 +02:00
Koenkk ecc734cff9 Add support for MQTT client ID. #148 2018-06-26 19:33:26 +02:00
8 changed files with 124 additions and 43 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ build_and_push() {
# Only update Docker images for:
# - dev branch
# - version release
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ ! -z ${TRAVIS_TAG+x} ]
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ ! -z ${TRAVIS_TAG+x} ] && [ ! "$TRAVIS_TAG" = "" ]
then
echo "Updating docker images for master branch!"
login
+40 -2
View File
@@ -282,10 +282,14 @@ class Controller {
if (!converters.length) {
if (cid) {
logger.warn(
`No converter available for '${mappedModel.model}' with cid '${cid}' and type '${message.type}'`
`No converter available for '${mappedModel.model}' with cid '${cid}', ` +
`type '${message.type}' and data '${JSON.stringify(message.data)}'`
);
} else if (cmdId) {
logger.warn(`No converter available for '${mappedModel.model}' with cmd '${cmdId}'`);
logger.warn(
`No converter available for '${mappedModel.model}' with cmd '${cmdId}' ` +
`and data '${JSON.stringify(message.data)}'`
);
}
logger.warn(`Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices.`);
@@ -400,6 +404,40 @@ class Controller {
} else {
cleanup();
}
} else if (option === 'rename') {
const invalid = `Invalid rename message format expected {old: 'friendly_name', new: 'new_name} ` +
`got ${message.toString()}`;
let json = null;
try {
json = JSON.parse(message.toString());
} catch (e) {
logger.error(invalid);
return;
}
// Validate message
if (!json.new || !json.old) {
logger.error(invalid);
return;
}
if (settings.changeFriendlyName(json.old, json.new)) {
logger.info(`Successfully renamed - ${json.old} to ${json.new} `);
} else {
logger.error(`Failed to renamed - ${json.old} to ${json.new}`);
return;
}
// Homeassistant rediscover
if (settings.get().homeassistant) {
const ID = settings.getIDByFriendlyName(json.new);
const device = this.zigbee.getDevice(ID);
const mappedModel = zigbeeShepherdConverters.findByZigbeeModel(device.modelId);
if (mappedModel) {
homeassistant.discover(device.ieeeAddr, mappedModel.model, this.mqtt, true);
}
}
} else {
logger.warn(`Cannot handle MQTT config option '${option}' with message '${message}'`);
}
+12 -2
View File
@@ -122,9 +122,9 @@ const configurations = {
type: 'sensor',
object_id: 'action',
discovery_payload: {
icon: 'mdi:cube',
icon: 'mdi:gesture-double-tap',
value_template: '{{ value_json.action }}',
json_attributes: ['battery', 'voltage', 'angle', 'side', 'from_side', 'to_side'],
json_attributes: ['battery', 'voltage', 'angle', 'side', 'from_side', 'to_side', 'brightness'],
},
},
'sensor_brightness': {
@@ -240,6 +240,7 @@ const mapping = {
'LED1537R6': [configurations.light_brightness_colortemp],
'LED1650R5': [configurations.light_brightness],
'LED1536G5': [configurations.light_brightness_colortemp],
'7299760PH': [configurations.light_brightness_xy],
'7146060PH': [configurations.light_brightness_colortemp_xy],
'F7C033': [configurations.light_brightness],
'JTYJ-GD-01LM/BW': [configurations.binary_sensor_smoke],
@@ -288,6 +289,15 @@ const mapping = {
'NL08-0800': [configurations.light_brightness],
'915005106701': [configurations.light_brightness_colortemp_xy],
'AB32840': [configurations.light_brightness_colortemp],
'8718696485880': [configurations.light_brightness_colortemp_xy],
'8718696598283': [configurations.light_brightness_colortemp],
'73693': [configurations.light_brightness_colortemp_xy],
'324131092621': [configurations.sensor_action],
'GL-C-008': [configurations.light_brightness_colortemp_xy],
'STSS-MULT-001': [configurations.binary_sensor_contact],
'E11-G23': [configurations.light_brightness],
'AC03845': [configurations.light_brightness_colortemp_xy],
'AC03641': [configurations.light_brightness],
};
// A map of all discoverd devices
+5
View File
@@ -18,6 +18,11 @@ class MQTT {
options.password = mqttSettings.password;
}
if (mqttSettings.client_id) {
logger.debug(`Using MQTT client ID: '${mqttSettings.client_id}'`);
options.clientId = mqttSettings.client_id;
}
this.client = mqtt.connect(mqttSettings.server, options);
// Register callbacks.
+13
View File
@@ -44,6 +44,18 @@ function getIDByFriendlyName(friendlyName) {
);
}
function changeFriendlyName(old, new_) {
const ID = getIDByFriendlyName(old);
if (!ID) {
return false;
}
settings.devices[ID].friendly_name = new_;
writeRead();
return true;
}
module.exports = {
get: () => settings,
write: () => write(),
@@ -51,4 +63,5 @@ module.exports = {
addDevice: (id) => addDevice(id),
removeDevice: (id) => removeDevice(id),
getIDByFriendlyName: (friendlyName) => getIDByFriendlyName(friendlyName),
changeFriendlyName: (old, new_) => changeFriendlyName(old, new_),
};
+12 -2
View File
@@ -47,13 +47,13 @@ class Zigbee {
);
callback(error);
} else {
logger.info('zigbee-shepherd started');
this._logStartupInfo();
callback(null);
}
});
}, 60 * 1000);
} else {
logger.info('zigbee-shepherd started');
this._logStartupInfo();
callback(null);
}
});
@@ -66,6 +66,11 @@ class Zigbee {
this.onMessage = onMessage;
}
_logStartupInfo() {
logger.info('zigbee-shepherd started');
logger.debug(`zigbee-shepherd info: ${JSON.stringify(this.shepherd.info())}`);
}
softReset(callback) {
this.shepherd.reset('soft', callback);
}
@@ -94,6 +99,11 @@ class Zigbee {
}
});
// Check if we have to turn of the led
if (settings.get().serial.disable_led) {
this.shepherd.controller.request('UTIL', 'ledControl', {ledid: 3, mode: 0});
}
logger.info('zigbee-shepherd ready');
}
+39 -34
View File
@@ -1,6 +1,6 @@
{
"name": "zigbee2mqtt",
"version": "0.1.0",
"version": "0.1.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -205,9 +205,7 @@
"dev": true
},
"cc-znp": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/cc-znp/-/cc-znp-0.4.2.tgz",
"integrity": "sha1-nKN8Zm0q5U56FFsWvFbV6t1VVIw=",
"version": "git+https://github.com/Koenkk/cc-znp.git#0445c554344421498c1721b4a7fc84531b222cbf",
"requires": {
"debug": "2.6.9",
"enum": "2.5.0",
@@ -496,7 +494,7 @@
"es-to-primitive": "1.1.1",
"function-bind": "1.1.1",
"has": "1.0.3",
"is-callable": "1.1.3",
"is-callable": "1.1.4",
"is-regex": "1.0.4"
}
},
@@ -506,7 +504,7 @@
"integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=",
"dev": true,
"requires": {
"is-callable": "1.1.3",
"is-callable": "1.1.4",
"is-date-object": "1.0.1",
"is-symbol": "1.0.1"
}
@@ -518,9 +516,9 @@
"dev": true
},
"eslint": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-5.0.1.tgz",
"integrity": "sha512-D5nG2rErquLUstgUaxJlWB5+gu+U/3VDY0fk/Iuq8y9CUFy/7Y6oF4N2cR1tV8knzQvciIbfqfohd359xTLIKQ==",
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-5.2.0.tgz",
"integrity": "sha512-zlggW1qp7/TBjwLfouRoY7eWXrXwJZFqCdIxxh0/LVB/QuuKuIMkzyUZEcDo6LBadsry5JcEMxIqd3H/66CXVg==",
"dev": true,
"requires": {
"ajv": "6.5.2",
@@ -530,6 +528,7 @@
"debug": "3.1.0",
"doctrine": "2.1.0",
"eslint-scope": "4.0.0",
"eslint-utils": "1.3.1",
"eslint-visitor-keys": "1.0.0",
"espree": "4.0.0",
"esquery": "1.0.1",
@@ -538,7 +537,7 @@
"functional-red-black-tree": "1.0.1",
"glob": "7.1.2",
"globals": "11.7.0",
"ignore": "3.3.10",
"ignore": "4.0.2",
"imurmurhash": "0.1.4",
"inquirer": "5.2.0",
"is-resolvable": "1.1.0",
@@ -590,6 +589,12 @@
"estraverse": "4.2.0"
}
},
"eslint-utils": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz",
"integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==",
"dev": true
},
"eslint-visitor-keys": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
@@ -607,9 +612,9 @@
}
},
"esprima": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
"integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw=="
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
},
"esquery": {
"version": "1.0.1",
@@ -642,9 +647,9 @@
"dev": true
},
"extend": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
"integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ="
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
},
"external-editor": {
"version": "2.2.0",
@@ -764,7 +769,7 @@
"resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz",
"integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=",
"requires": {
"extend": "3.0.1",
"extend": "3.0.2",
"glob": "7.1.2",
"glob-parent": "3.1.0",
"is-negated-glob": "1.0.0",
@@ -852,9 +857,9 @@
}
},
"ignore": {
"version": "3.3.10",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz",
"integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==",
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.2.tgz",
"integrity": "sha512-uoxnT7PYpyEnsja+yX+7v49B7LXxmzDJ2JALqHH3oEGzpM2U1IGcbfnOr8Dt57z3B/UWs7/iAgPFbmye8m4I0g==",
"dev": true
},
"immediate": {
@@ -918,9 +923,9 @@
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"is-callable": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz",
"integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=",
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
"integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==",
"dev": true
},
"is-date-object": {
@@ -1053,7 +1058,7 @@
"integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
"requires": {
"argparse": "1.0.10",
"esprima": "4.0.0"
"esprima": "4.0.1"
}
},
"json-schema-traverse": {
@@ -1171,9 +1176,9 @@
}
},
"mqtt": {
"version": "2.18.2",
"resolved": "https://registry.npmjs.org/mqtt/-/mqtt-2.18.2.tgz",
"integrity": "sha512-egP6gbLES2aELu6LNtwOtpC779Hu7LVTYm6HKE5wJdTuX2jZ4JOOtK7HS2JWyW6IfKN5U99u/VU155tLwFAKbQ==",
"version": "2.18.3",
"resolved": "https://registry.npmjs.org/mqtt/-/mqtt-2.18.3.tgz",
"integrity": "sha512-BXCUugFgA6FOWJGxhvUWtVLOdt6hYTmiMGPksEyKuuF1FQ0ji7UJBJ/0kVRMUtUWCAtPGnt4mZZZgJpzNLcuQg==",
"requires": {
"commist": "1.0.0",
"concat-stream": "1.6.2",
@@ -2815,7 +2820,7 @@
}
},
"zcl-packet": {
"version": "git+https://github.com/Koenkk/zcl-packet.git#360b9d2f02dc1bb40def40d03ac10175b93300e5",
"version": "git+https://github.com/Koenkk/zcl-packet.git#3ea8912f9d228b59fad554064d15ed9be7897a7f",
"requires": {
"concentrate": "0.2.3",
"dissolve-chunks": "1.3.0",
@@ -2833,17 +2838,17 @@
}
},
"zigbee-shepherd": {
"version": "git+https://github.com/Koenkk/zigbee-shepherd.git#65101146c480aa8f1ddb58046327e2a9a495cf04",
"version": "git+https://github.com/Koenkk/zigbee-shepherd.git#2078557a485466c032cc26b2cd2b8ac29edeceac",
"requires": {
"areq": "0.2.0",
"busyman": "0.3.0",
"cc-znp": "0.4.2",
"cc-znp": "git+https://github.com/Koenkk/cc-znp.git#0445c554344421498c1721b4a7fc84531b222cbf",
"debug": "2.6.9",
"objectbox": "0.3.0",
"proving": "0.1.0",
"q": "1.5.1",
"zcl-id": "0.3.2",
"zcl-packet": "git+https://github.com/Koenkk/zcl-packet.git#360b9d2f02dc1bb40def40d03ac10175b93300e5",
"zcl-packet": "git+https://github.com/Koenkk/zcl-packet.git#3ea8912f9d228b59fad554064d15ed9be7897a7f",
"ziee": "0.3.0",
"zive": "0.2.2",
"zstack-constants": "0.2.0"
@@ -2861,9 +2866,9 @@
}
},
"zigbee-shepherd-converters": {
"version": "2.0.20",
"resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-2.0.20.tgz",
"integrity": "sha512-L8q7FkLlJluNDfcrmjvdf/CuQTo+2T75uQsznV1v1laDf5dh9x11iSGYSpzh4ou9iHIpTNkk+FQHDuIX/c17mw==",
"version": "2.0.34",
"resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-2.0.34.tgz",
"integrity": "sha512-8q2Lh2kAJG3Lg+Hp+PH/tCSbzDndn3f6XkI+7t0W5zynIHcGvViNNubx9UbGduBCJK7tv0rjEJU4/DCUoH7UPw==",
"requires": {
"debounce": "1.1.0"
},
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "zigbee2mqtt",
"version": "0.1.0",
"version": "0.1.1",
"description": "Zigbee to MQTT bridge using zigbee-shepherd",
"main": "index.js",
"repository": {
@@ -35,7 +35,7 @@
"zigbee-shepherd": "git+https://github.com/Koenkk/zigbee-shepherd.git",
"zigbee-shepherd-converters": "*",
"json2yaml": "*",
"zcl-packet": "git+https://github.com/Koenkk/zcl-packet.git",
"zcl-packet": "git+https://github.com/Koenkk/zcl-packet.git#3ea8912f9d228b59fad554064d15ed9be7897a7f",
"js-yaml": "*",
"git-last-commit": "*"
},