API Reference
Sen5xI2cDevice
Sen5xMeasuredValues
Response Data Types
Sen5xMassConcentration
- class sensirion_i2c_sen5x.response_types.Sen5xMassConcentration(ticks)[source]
Represents a SEN5x measurement response for the particulate matter mass concentration.
With the
ticks
attribute you can access the raw data as received from the device. For the converted physical value thephysical
attribute is available. The attributeavailable
can be used to check whether the value is available or not.
Sen5xHumidity
- class sensirion_i2c_sen5x.response_types.Sen5xHumidity(ticks)[source]
Represents a SEN5x measurement response for the humidity.
With the
ticks
attribute you can access the raw data as received from the device. For the converted value thepercent_rh
attribute is available. The attributeavailable
can be used to check whether the value is available or not.
Sen5xTemperature
- class sensirion_i2c_sen5x.response_types.Sen5xTemperature(ticks)[source]
Represents a SEN5x measurement response for the temperature.
With the
ticks
attribute you can access the raw data as received from the device. For the converted values you can choose betweendegrees_celsius
anddegrees_fahrenheit
. The attributeavailable
can be used to check whether the value is available or not.
Sen5xAirQualityIndex
- class sensirion_i2c_sen5x.response_types.Sen5xAirQualityIndex(ticks)[source]
Represents a SEN5x measurement response for the air quality index.
With the
ticks
attribute you can access the raw data as received from the device. For the converted value thescaled
attribute is available. The attributeavailable
can be used to check whether the value is available or not.
Sen5xDeviceStatus
- class sensirion_i2c_sen5x.response_types.Sen5xDeviceStatus(value)[source]
Represents a SEN5x device status response.
With the
value
attribute you can access the raw value as received from the device. The convenience attributeflags
allows you to get all set flags as strings. In addition, each flag is provided as separate bool attribute.
Sen5xVersion
- class sensirion_i2c_sen5x.response_types.Sen5xVersion(firmware, hardware, protocol)[source]
Class representing all version numbers of an I2C device. This is used for the “Get Version” command.
- class sensirion_i2c_sen5x.response_types.Sen5xFirmwareVersion(major, minor, debug)[source]
Class representing the firmware version of a device.
Commands
CmdStartMeasurement
- class sensirion_i2c_sen5x.commands.generated.Sen5xI2cCmdStartMeasurement[source]
Start Measurement I²C Command
Starts a continuous measurement.
After starting the measurement, it takes some time (~1s) until the first measurement results are available. You could poll with the command 0x0202 “Read Data Ready” to check when the results are ready to read.
If the device is in measure mode without PM and the firmware version is higher than 1.0, this command enables PM measurement without affecting the already running RH/T/VOC/NOx measurements (except that the “data ready”-flag will be cleared). If the device is in idle mode, this command starts the normal measurement. In any other case (e.g. normal measure mode already running), this command has no effect.
CmdStartMeasurementWithoutPm
- class sensirion_i2c_sen5x.commands.generated.Sen5xI2cCmdStartMeasurementWithoutPm[source]
Start Measurement Without PM I²C Command
Starts a continuous measurement without PM. Only humidity, temperature, VOC and NOx are available in this mode. Laser and fan are switched off to keep power consumption low.
After starting the measurement, it takes some time (~1s) until the first measurement results are available. You could poll with the command 0x0202 “Read Data Ready” to check when the results are ready to read.
If the device is in the normal measure mode and the firmware version is higher than 1.0, this command disables PM measurement without affecting the already running RH/T/VOC/NOx measurements (except that the “data ready”-flag will be cleared). If the device is in idle mode, this command starts the measurement without PM. In any other case (e.g. measure mode without PM already running), this command has no effect.
CmdStopMeasurement
CmdReadDataReady
- class sensirion_i2c_sen5x.commands.wrapped.Sen5xI2cCmdReadDataReady[source]
Read Data Ready I²C Command
This command can be used to check if new measurement results are ready to read. The data ready flag is automatically reset after reading the measurement values with the 0x03.. “Read Measured Values” commands.
Note
During fan (auto-)cleaning, no measurement data is available for several seconds and thus this flag will not be set until cleaning has finished. So please expect gaps of several seconds at any time if fan auto-cleaning is enabled.
CmdReadMeasuredValues
- class sensirion_i2c_sen5x.commands.wrapped.Sen5xI2cCmdReadMeasuredValues[source]
Read Measured Values I²C Command
Returns the measured values.
The command 0x0202 “Read Data Ready” can be used to check if new data is available since the last read operation. If no new data is available, the previous values will be returned again.
CmdGetTemperatureOffsetParameters
CmdSetTemperatureOffsetParameters
- class sensirion_i2c_sen5x.commands.wrapped.Sen5xI2cCmdSetTemperatureOffsetParameters(offset, slope, time_constant, raw=False)[source]
Set Temperature Offset Parameters I²C Command
Sets the temperature offset parameters for the device.
Note
This configuration is volatile, i.e. the parameters will be reverted to their default value of zero after a device reset.
CmdGetWarmStartParameter
CmdSetWarmStartParameter
- class sensirion_i2c_sen5x.commands.wrapped.Sen5xI2cCmdSetWarmStartParameter(warm_start, raw=False)[source]
Set Warm Start Parameter I²C Command
Sets the warm start parameter for the device.
Note
This parameter can be changed in any state of the device (and the getter immediately returns the new value), but it is applied only the next time starting a measurement, i.e. when sending a “Start Measurement” command! So the parameter needs to be set before a warm-start measurement is started.
Note
This configuration is volatile, i.e. the parameter will be reverted to its default value of zero after a device reset.
CmdGetRhtAccelerationMode
CmdSetRhtAccelerationMode
- class sensirion_i2c_sen5x.commands.generated.Sen5xI2cCmdSetRhtAccelerationMode(mode)[source]
Set RH/T Acceleration Mode I²C Command
Sets the RH/T acceleration mode.
Note
This parameter can be changed in any state of the device (and the getter immediately returns the new value), but it is applied only the next time starting a measurement, i.e. when sending a “Start Measurement” command. So the parameter needs to be set before a new measurement is started.
CmdGetVocAlgorithmTuningParameters
CmdSetVocAlgorithmTuningParameters
- class sensirion_i2c_sen5x.commands.generated.Sen5xI2cCmdSetVocAlgorithmTuningParameters(index_offset, learning_time_offset_hours, learning_time_gain_hours, gating_max_duration_minutes, std_initial, gain_factor)[source]
Set VOC Algorithm Tuning Parameters I²C Command
Sets the tuning parameters of the VOC algorithm.
Note
This command is available only in idle mode. In measure mode, this command has no effect. In addition, it has no effect if at least one parameter is outside the specified range.
CmdGetNoxAlgorithmTuningParameters
CmdSetNoxAlgorithmTuningParameters
- class sensirion_i2c_sen5x.commands.generated.Sen5xI2cCmdSetNoxAlgorithmTuningParameters(index_offset, learning_time_offset_hours, learning_time_gain_hours, gating_max_duration_minutes, std_initial, gain_factor)[source]
Set NOx Algorithm Tuning Parameters I²C Command
Sets the tuning parameters of the NOx algorithm.
Note
This command is available only in idle mode. In measure mode, this command has no effect. In addition, it has no effect if at least one parameter is outside the specified range.
CmdGetVocAlgorithmState
- class sensirion_i2c_sen5x.commands.generated.Sen5xI2cCmdGetVocAlgorithmState[source]
Get VOC Algorithm State I²C Command
Gets the current VOC algorithm state. This data can be used to restore the state with the “Set VOC Algorithm State” command after a short power cycle or device reset.
This command can be used either in measure mode or in idle mode (which will then return the state at the time when the measurement was stopped). In measure mode, the state can be read each measure interval to always have the latest state available, even in case of a sudden power loss.
CmdSetVocAlgorithmState
- class sensirion_i2c_sen5x.commands.generated.Sen5xI2cCmdSetVocAlgorithmState(state)[source]
Set VOC Algorithm State I²C Command
Sets the VOC algorithm state previously received with the “Get VOC Algorithm State” command.
Note
This command is only available in idle mode and the state will be applied only once when starting the next measurement. Any further measurements (i.e. when stopping and restarting the measure mode) will reset the state to initial values. In measure mode, this command has no effect.
CmdStartFanCleaning
- class sensirion_i2c_sen5x.commands.generated.Sen5xI2cCmdStartFanCleaning[source]
Start Fan Cleaning I²C Command
Starts the fan cleaning manually. The “data ready”-flag will be cleared immediately and during the next few seconds, no new measurement results will be available (old values will be returned). Once the cleaning is finished, the “data ready”-flag will be set and new measurement results will be available.
When executing this command while cleaning is already active, the command does nothing.
If you stop the measurement while fan cleaning is active, the cleaning will be aborted immediately.
Note
This command is only available in measure mode with PM measurement enabled, i.e. only if the fan is already running. In any other state, this command does nothing.
CmdGetFanAutoCleaningInterval
CmdSetFanAutoCleaningInterval
CmdGetProductName
CmdGetSerialNumber
CmdGetVersion
CmdReadDeviceStatus
- class sensirion_i2c_sen5x.commands.wrapped.Sen5xI2cCmdReadDeviceStatus[source]
Read Device Status I²C Command
Reads the current device status flags.
Note
The status flags of type “Error” are sticky, i.e. they are not cleared automatically even if the error condition no longer exists. So they can only be cleared manually with the command 0xD210 “Read And Clear Device Status” or with a device reset. All other flags are not sticky, i.e. they are cleared automatically if the trigger condition disappears.