Device Config
Onesense config can be used to configure the device remotely through config tab in device details.
Onesense device config now supports nested config value which allows multiple parameters to be set in one config value thus eliminating the need for using a different config value for every configuration.
For example :
Config name | Values |
---|---|
weather_station
|
{"weather_flag":0, "weather_slave_id":48, "weather_baud_rate":19200, "weather_delay":5}
|
Here for the config Name “weather_station” the values that can be set are




Once testing is done and the Config names and Values fixed these can be added as check boxes or drop-down lists In the UI making the process easier for users.
Sl.N | Config Name | Values |
---|---|---|
1 |
Include GPS |
Check Box |
2 |
Include Firmware Details |
Check Box |
3 |
Config OTA |
0 or 1 |
4 |
LogLevel |
1 or 2 or 3 |
5 |
Weather_Station |
{"weather_flag":0, "weather_slave_id":48, "weather_baud_rate":19200, "weather_delay":5} |
6 |
Solar_control |
{"solar_flag":0, "solar_slave_id":1, "solar_baud_rate":19200, "solar_delay":5} |
7 |
ORP |
{"orp_flag":0, "orp_slave_id":3, "orp_baud_rate":19200, "orp_delay":5} |
8 |
ph |
{"ph_flag":0, "ph_slave_id":2, "ph_baud_rate":9600, "ph_delay":5} |
9 |
Turbidity |
{"turbidity_flag":0, "turbidity_slave_id":7, "turbidity_baud_rate":9600, "turbidity_delay":5} |
10 |
Conductivity |
{"conductivity_flag":0, "conductivity_slave_id":5, "conductivity_baud_rate":9600, "conductivity_delay":5} |
11 |
Vibration |
{"vibration_flag":0, "vibration_slave_id":23, "vibration_baud_rate":9600, "limit_x":2, "limit_y":-2, "limit_z":4.4} |
12 |
Pump_L921 |
{"L921_flag":0, "L921_slave_id":1, "L921_baud_rate":9600, "L921_cut_off_value":48, "L921_A_cut_in_value":160, "L921_B_cut_in_value":0, "L921_over_flow_value":170, "L921_delay":5} |
13 |
Pump_L922 |
{"L922_flag":0, "L922_slave_id":1, "L922_baud_rate":9600, "L922_cut_off_value":48, "L922_A_cut_in_value":160, "L922_B_cut_in_value":0, "L922_over_flow_value":170, "L922_delay":5} |
14 |
Tank |
{"tank_flag":0, "tank_R1":1, "tank_R2":2.2, "tank_volume":40000, "tank_vmin":0.5, "tank_vmax":4.5, "tank_delay":5} |
15 |
Silent_mode |
0 or 1 |
16 |
Flowmeter |
{"flowmeter_flag":0, "flowmeter_baud_rate":115200, "flowmeter_delay":5} |
17 |
Pump_SK_002 |
{"SK_002Flag":1, "SK_002SlaveId":1, "SK_002BaudRate":9600, "SK_002Delay":5} |
18 |
Msg_delay |
Integer |
19 |
SEM1000 |
{"SEM1000_flag":0, "SEM1000_slave_id":1, "SEM1000_baud_rate":4800, "SEM1000_delay":5} |
20 |
SEM227 |
{"SEM227_flag":1, "SEM227_slave_id":1, "SEM227_baud_rate":4800, "SEM227_delay":0, "SEM227_parameter_select":"00011000000010000000"} |
21 |
qsd_flow |
{"qsd_flag":1, "qsd_slave_id":2, "qsd_baud_rate":9600, "qsd_delay":5} |
These configs can be divided into 4 groups depending on their functionality:
Configure Device parameters
Configure Modbus sensors.
Configure ADC sensors calibration
Configure pump controller parameters
Configure Device parameters
The various device parameters currently supported are:
Config Name |
Values |
---|---|
Include GPS |
Check Box |
Include Firmware Details |
Check Box |
Config OTA |
0 or 1 |
LogLevel |
1 or 2 or 3 |
Silent_mode |
0 or 1 |
Msg_delay |
Integer |

The device sends GPS co-ordinates to Onesense if GPS module is connected to Device and the “include GPS” check mark is checked. If the check mark is unchecked, then the device doesn't poll for its GPS location and no data is sent to Onesense.

The device will send its current Firmware version and other details (like Firmware build date/time, Device type etc.) regarding firmware to onesense if the checkbox “Include Firmware Details” is checked.
This feature needs to be developed and integrated into the device Firmware. Currently No firmware info is sent to Onesense even if the checkbox is checked.

This config is used to switch between the OLD device update process (the OTA URL configured using BLE App) and New Device Update feature where no BLE config is needed. The OTA URL is sent to the device directly as payload when the OTA is invoked from Onesense.
The supported values are:
- 0 – Device is configured to OLD device update process where OTA URL needs to be set using BLE App
- 1 – Device is configured to NEW device update process where device receives OTA URL dynamically when OTA is invoked from Onesense.
This config was added so that the OTA process can be dynamic, and user can choose which OTA process the device will follow as the NEW process is still under testing and it can run into issues. As the NEW process is stabilized, we will phase out of the old process.

This config enables user to set the level of HTTPs logging level. Based on the logging level set the device will send minimal logs with only Errors/Warnings or Detailed logs with all the info, warnings and Errors to Onesense via HTTPS.
The supported values for Log level config are:
Log level set to errors and device published messages only
Log level set to Errors, Warnings and published messages.
Log level set to Errors, Warnings, Information and published messages.

This config enables user to set the buzzer on or off. The supported values for silent_mode config are:
0 : Enables the buzzer
1: Disables the buzzer and enters silent mode

This config enables to set the delay between each polling cycle. Its value should be an integer.
For example, if it is set as 5, there is a 5 second delay between each polling cycle
Configure Modbus sensors
Different MODBUS configurations implemented are:
Config Name |
Values |
---|---|
Weather_station |
{"weather_flag":0, "weather_slave_id":48, "weather_baud_rate":19200, "weather_delay":5} |
Solar_control |
{"solar_flag":0, "solar_slave_id":1, "solar_baud_rate":19200, "solar_delay":5} |
ORP |
{"orp_flag":0, "orp_slave_id":3, "orp_baud_rate":19200, "orp_delay":5} |
Ph |
{"ph_flag":0, "ph_slave_id":2, "ph_baud_rate":9600, "ph_delay":5} |
Turbidity |
{"turbidity_flag":0, "turbidity_slave_id":7, "turbidity_baud_rate":9600, "turbidity_delay":5} |
Conductivity |
{"conductivity_flag":0, "conductivity_slave_id":5, "conductivity_baud_rate":9600, "conductivity_delay":5} |
Vibration |
{"vibration_flag":0, "vibration_slave_id":23, "vibration_baud_rate":9600, "limit_x":2, "limit_y":-2, "limit_z":4.4} |
SEM227 |
{"SEM227_flag":1, "SEM227_slave_id":1, "SEM227_baud_rate":4800, "SEM227_delay":0, "SEM227_parameter_select":"000110000000100000"} |
qsd_flow |
{"qsd_flag":1, "qsd_slave_id":2, "qsd_baud_rate":9600, "qsd_delay":5} |
These will allow user to


_This breaks the dependency of each sensor slave-ID to be set to predetermined slave-ID. The user just has to know what the current slave-ID of the sensor is and can set the value in Onesense and the device starts polling the sensor with that slave-ID._




Bit Position |
Parameter to be Polled |
---|---|
0 |
Due Point Temperature |
1 |
Odour |
2 |
Civil Gas |
3 |
Ammonia |
4 |
Chlorine |
5 |
Nitrogen Dioxide |
6 |
Air Quality |
7 |
Hydrogen Sulphide |
8 |
Ozone |
9 |
Formaldehyde |
10 |
TVOC |
11 |
Sulphur Dioxide |
12 |
Carbon Monoxide |
13 |
Oxygen |
14 |
Dust10 |
15 |
Dust2.5 |
16 |
Carbon Dioxide |
17 |
Air Pressure |
18 |
Humidity |
19 |
Temperature |
This breaks the dependency of every Modbus sensor needing to be set to same Baudrate.
Configure ADC sensors calibration
These configs allow user to set various ADC sensor caliberation parameters.
The ADC configuration implemented is:
Config Name |
Values |
---|---|
Tank |
{"tank_flag":0, "tank_R1":1, "tank_R2":2.2, "tank_volume":40000, "tank_vmin":0.5, "tank_vmax":4.5, "tank_delay":5} |
Tank_flag: Enable/disable tank level sensor ADC measurement
Tank_R1: Value of resistor R1 of the Voltage dividing circuit
Tank_R2: Value of resistor R2 of the Voltage dividing circuit
Tank_volume: Total Tank volume in Litres
Tank_vmin: Minimum Voltage output of the Analog sensor at Tank empty.
Tank_vmax: Maximum Voltage output of the Analog sensor at Tank Full.
Tank_delay: Delay between each published message in minutes
Configure pump controller parameters
Config Name |
Values |
---|---|
pump_L921 |
{"L921_flag":0, "L921_slave_id":1, "L921_baud_rate":9600, "L921_cut_off_value":48, "L921_A_cut_in_value":160, "L921_B_cut_in_value":0, "L921_over_flow_value":170} |
pump_L922 |
{"L922_flag":0, "L922_slave_id":1, "L922_baud_rate":9600, "L922_cut_off_value":48, "L922_A_cut_in_value":160, "L922_B_cut_in_value":0, "L922_over_flow_value":170} |
L921 and L922 have similar configurations.
pump_flag: Enable/disable L992/L991 Pump controller polling.
Pump_ slave_id: set slave Id of pump controller
pump_baud_rate: set baudrate of pump controller
pump_cut_off_value: Set the pump cut off value
pump_A_cut_in_value: Set the Pump A cutin value
pump_B_cut_in_value: Set the Pump B cutin value
over_flow_value: Set the overflow alarm threshold value.
The Pump controller Slave_ID and BaudRate have not been made dynamic. It is not yet implemented as the pump controller working involves polling of parameters and Actions to remotely start or stop the pumps. The Slave-ID and baudrate will have to be dynamically changed when Actions are invoked, and this implementation will be done after testing of all other configs are done.
The Action command is case sensitive. Here is the list of all supported action commands. Methods :
RLY1-Close
RLY1-Open
RLY2-Close
RLY2-Open
RLY3-Close
RLY3-Open
RLY4-Close
RLY4-Open