Update lumi.router device specification.

This commit is contained in:
Koenkk 2018-05-17 18:03:54 +02:00
parent 0fdec7c225
commit 7f5865aaf9
3 changed files with 39 additions and 26 deletions

View File

@ -376,6 +376,27 @@ const parsers = [
return {smoke: msg.data.zoneStatus === 1};
},
},
{
devices: ['CC2530.ROUTER'],
cid: 'genOnOff',
type: 'attReport',
convert: (msg) => {
return {state: msg.data.data['onOff'] === 1};
},
},
{
devices: ['CC2530.ROUTER'],
cid: 'genBinaryValue',
type: 'attReport',
convert: (msg) => {
const data = msg.data.data;
return {
description: data['description'],
type: data['inactiveText'],
rssi: data['presentValue'],
};
},
},
// Ignore parsers (these message dont need parsing).
{
@ -444,26 +465,6 @@ const parsers = [
type: 'devChange',
convert: () => null,
},
{
devices: ['LUMI.ROUTER'],
cid: 'genOnOff',
type: 'attReport',
convert: (msg) => {return {state: msg.data.data['onOff'] === 1 ? "ON" : "OFF"}}
},
{
devices: ['LUMI.ROUTER'],
cid: 'genBinaryValue',
type: 'attReport',
convert: (msg) => {
const data = msg.data.data;
const result = {
description: data['description'],
type: data['inactiveText'],
rssi: data['presentValue']
};
return result;
}
},
];
module.exports = parsers;

View File

@ -157,12 +157,12 @@ const devices = {
supports: 'on/off, brightness',
},
// Zigbee router: http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/
// Texax Instruments
'lumi.router': {
model: 'LUMI.ROUTER',
vendor: 'TexasInstruments',
description: 'Router',
supports: 'on/off'
model: 'CC2530.ROUTER',
vendor: 'Texas Instruments',
description: 'CC2530 router [link](http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/)',
supports: 'state, description, type, rssi',
},
};

View File

@ -46,6 +46,17 @@ const configurations = {
json_attributes: ['battery'],
},
},
'binary_sensor_router': {
type: 'binary_sensor',
object_id: 'router',
discovery_payload: {
payload_on: true,
payload_off: false,
value_template: '{{ value_json.state }}',
device_class: 'connectivity',
json_attributes: ['description', 'type', 'rssi'],
},
},
// Sensor
'sensor_illuminance': {
@ -209,6 +220,7 @@ const mapping = {
'7146060PH': [configurations.light_brightness_colortemp_xy],
'F7C033': [configurations.light_brightness],
'JTYJ-GD-01LM/BW': [configurations.binary_sensor_smoke],
'CC2530.ROUTER': [configurations.binary_sensor_router],
};
// A map of all discoverd devices