Skip to content

Commit

Permalink
EQ assist: proper naming brightness instead of level if lighting device
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharp38 committed Jun 14, 2024
1 parent 0bbd2db commit 410051e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
22 changes: 15 additions & 7 deletions core/php/AbeilleZigbeeConst.php
Original file line number Diff line number Diff line change
Expand Up @@ -1081,17 +1081,28 @@ function zbGetDevice($profId, $devId) {
'0053'=>'Meter Interface',

// Lighting
// List from ZigBee Lighting & Occupancy, Device Specification, Version 1.0
'0100'=>'On/Off Light',
'0101'=>'Dimmable Light',
'0102'=>'Color Dimmable Light',
'0103'=>'On/Off Light Switch',
'0104'=>'Dimmer Switch',
'0105'=>'Color Dimmer Switch',
'0106'=>'Light Sensor',
'0107'=>'Occupency Sensor',

// Legrand
'010A'=>'Legrand xxxx',
'0107'=>'Occupancy sensor',
'0108'=>'On/off ballast',
'0109'=>'Dimmable ballast',
'010A'=>'On/off plug-in unit',
'010B'=>'Dimmable plug-in unit',
'010C'=>'Color temperature light',
'010D'=>'Extended color light',
'010E'=>'Light level sensor',
'0800'=>'Color controller',
'0810'=>'Color scene controller',
'0820'=>'Non-color controller',
'0830'=>'Non-color scene controller',
'0840'=>'Control bridge',
'0850'=>'On/off sensor',

// Closures
'0200'=>'Shade',
Expand All @@ -1118,9 +1129,6 @@ function zbGetDevice($profId, $devId) {
// From Xiaomi
'5F01'=>'Xiaomi Temperature',

// From OSRAM investigation
'0810'=>'OSRAM Switch',

// From Legrand investigation
'0B04'=>'Electrical Measurement', // Attribut Id: 0x50B - Active Power
),
Expand Down
23 changes: 14 additions & 9 deletions desktop/php/AbeilleEqAssist.php
Original file line number Diff line number Diff line change
Expand Up @@ -1005,20 +1005,25 @@ function zigbeeToModel() {
if (!isset(ep.servClusters))
continue;

// If device ID is defined let's check if lighting device (see devicesTable in Zigbee consts)
if ((typeof ep.devId !== "undefined") && (ep.devId >= 0x0100) && (ep.devId <= 0x0850))
name = "Brightness";
else
name = "Level";

if (multipleCluster) // If multiple clusters adding index in name
clustIdx = " "+levelIdx;
if (isset(ep.servClusters["0008"]) && isset(ep.servClusters["0008"]['attributes'])) {
attributes = ep.servClusters["0008"]['attributes'];
// Note: If device is a light bulb, need to use 'act_setLevel-Light'
// TODO: 'level' should be renamed to 'brightness' is device is a light control one (bulb or controler)
cmds["Set Level"+clustIdx] = newCmd("act_setLevel-Light", "ep="+epId);
cmds["Set Level"+clustIdx]["isVisible"] = 1;
cmds["Set Level"+clustIdx]["value"] = "Level"+clustIdx; // Slider default value
cmds["Get Level"+clustIdx] = newCmd("act_zbReadAttribute", "ep="+epId+"&clustId=0008&attrId=0000");

cmds["Level"+clustIdx] = newCmd("inf_zbAttr-0008-CurrentLevel", "ep="+epId);
cmds["Level"+clustIdx]["isVisible"] = 1;
cmds["Level"+clustIdx]["nextLine"] = "after";
cmds["Set "+name+clustIdx] = newCmd("act_setLevel-Light", "ep="+epId);
cmds["Set "+name+clustIdx]["isVisible"] = 1;
cmds["Set "+name+clustIdx]["value"] = name+clustIdx; // Slider default value
cmds["Get "+name+clustIdx] = newCmd("act_zbReadAttribute", "ep="+epId+"&clustId=0008&attrId=0000");

cmds[name+clustIdx] = newCmd("inf_zbAttr-0008-CurrentLevel", "ep="+epId);
cmds[name+clustIdx]["isVisible"] = 1;
cmds[name+clustIdx]["nextLine"] = "after";
cmds["Bind "+epId+"-0008-ToZigate"] = newCmd("act_zbBindToZigate", "ep="+epId+"&clustId=0008", "yes");
cmds["SetReporting "+epId+"-0008-0000"] = newCmd("act_zbConfigureReporting2", "ep="+epId+"&clustId=0008&attrType=20&attrId=0000", "yes");
}
Expand Down
5 changes: 4 additions & 1 deletion docs/fr_FR/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# ChangeLog

- GL-C-007P, GLEDOPTO: Ajout controle blanc chaud/froid (2710).
- Assistant modèles: Amélioration cluster 0008.
- Assistant modèles:
- Amélioration cluster 0008.
- Amélioration nommage 'level' ou 'brightness' en fonction du type 'device ID'
- Modèles d'équipement: Suppression des commands 'SWBuildID' & 'Get-SWBuildID' (dispo sur onglet 'avancé').
- Modèles TRAFRIbulbxxx: Mises-à-jour.
- Assistant de découverte: Ajout 'profile ID' + 'device ID'.
- Réparation: Améliorations pour support 'profile ID' + 'device ID'.
- Interne: 'AbeilleLQI-AbeilleX.json.lock' => 'AbeilleLQI.lock'
- Interne: Zigbee const: Ajout 'device ID' pour lighting.

## 240610-BETA-1

Expand Down

0 comments on commit 410051e

Please sign in to comment.