Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
sieren committed Oct 7, 2021
1 parent 8753d21 commit 505bc1a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions air_quality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ void DeRestPluginPrivate::handleAirQualityClusterIndication(const deCONZ::ApsDat
}
break;

case 0x0055: // Presented value
{
if (ind.clusterId() == ANALOG_INPUT_CLUSTER_ID && sensor->modelId() == QLatin1String("lumi.airmonitor.acn01")) // Develco air quality sensor
{
levelPpb = static_cast<quint32>(attr.numericValue().real);
}
}
break;

case 0x4004:
{
// Bosch air quality sensor
Expand Down
18 changes: 18 additions & 0 deletions bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,18 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
return sendConfigureReportingRequest(bt, {rq});
}
}
else if (bt.binding.clusterId == ANALOG_INPUT_CLUSTER_ID)
{
if (modelId == QLatin1String("lumi.airmonitor.acn01"))
{
rq.dataType = deCONZ::Zcl16BitUint;
rq.attributeId = 0x0055; // Present Value
rq.minInterval = 60;
rq.maxInterval = 3600;
rq.reportableChange16bit = 5; // According to technical manual
return sendConfigureReportingRequest(bt, {rq});
}
}
return false;
}

Expand Down Expand Up @@ -3348,6 +3360,11 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
continue;
}
}
else if (*i == ANALOG_INPUT_CLUSTER_ID && sensor->modelId() == QLatin1String("lumi.airmonitor.acn01"))
{
val = sensor->getZclValue(*i, 0x0055); // Presented Value

}
else if (*i == METERING_CLUSTER_ID)
{
val = sensor->getZclValue(*i, 0x0000); // Curent Summation Delivered
Expand Down Expand Up @@ -3455,6 +3472,7 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
case DOOR_LOCK_CLUSTER_ID:
case BOSCH_AIR_QUALITY_CLUSTER_ID:
case DEVELCO_AIR_QUALITY_CLUSTER_ID:
case ANALOG_INPUT_CLUSTER_ID:
{
// For the moment reserved to doorlock device
if (*i == DOOR_LOCK_CLUSTER_ID && sensor->type() != QLatin1String("ZHADoorLock"))
Expand Down
1 change: 1 addition & 0 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,7 @@ void DeRestPluginPrivate::apsdeDataIndication(const deCONZ::ApsDataIndication &i

case DEVELCO_AIR_QUALITY_CLUSTER_ID: // Develco specific -> VOC Management
case BOSCH_AIR_QUALITY_CLUSTER_ID: // Bosch Air quality sensor
case ANALOG_INPUT_CLUSTER_ID: // Aqara Air Monitor TVOC
handleAirQualityClusterIndication(ind, zclFrame);
break;

Expand Down

0 comments on commit 505bc1a

Please sign in to comment.