A Berry application for DS18B20 temperature sensors
I attach great importance to stable error detection.
Unfortunately, the power-on-reset value of the sensor with the value 85 is not clear.
The application tries to eliminate this disadvantage.
If a sensor is used in an application, its status must be signaled even if it is not connected.
The registration method takes this requirement into account.
After start of application without connected sensors
- sensores are connected but no bus-scan has done
After bus-scan has performed
After sensor's device-0 data-pin is yanked
Default GPIO 16 is used. You can adjust this setting in file 'DallasTemp01.be' Do not configure the used GPIO in menu 'Configuration/Configure Module'.
-
upload following files to to the tasmota-controller
- DallasTemp.app
- DallasTemp01.be
- DallasTemp02.be
-
Restart the controller
After that the "After start of application" scene should be visible.
A sensor is registered via its address. - the application is constantly trying to read values from this sensor - it cannot be deleted from the list of sensors to be detected.
Initiates the Bus-Scanning process, that collects the available devices.
All temporary sensors will be cleared in the task list, but never those sensors, which are registered.
device = dallasTemp.register("28C9229E2022089E")
device.name = "myDevice.02"
device.offset = 1
The berry-variable 'dallasTemp' is global.
Use following statement in the Berry-Console to obtain more log-information.
dallasTemp.infoEnable=true
dallasTemp.enableSensorMsg=true
If 'enableSensorMsg' is activated then the sensor messages will be extended like
{
"Time": "2024-01-16T18:42:21",
"ANALOG": {
"Illuminance1": 0
},
"OneWire.Group.01": {
"gpio": 16,
"devices": [
{
"address": "28C9229E2022089E",
"name": "Boiler Temperature",
"value": 33.0,
"hasError": false
}
]
},
"TempUnit": "C"
}
The sensor value is calculated depending on 'SetOption8'.
- The application detects the error when the GND/power/data pin is faulty. In this case, the status “hasError” is set to “true”.
- After an error detection, 2 consecutive valid values are required to reset the hasError flag.
If the freezeOnError property is enabled (default setting), the last captured value will not be changed as long as the capture is in error.
device = dallasTemp.register("28C9229E2022089E")
device.freezeOnError = true # default value is true