Skip to content

Commit

Permalink
Temperature usermod rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek committed May 11, 2023
1 parent bf6a18a commit cdfc0f6
Show file tree
Hide file tree
Showing 4 changed files with 354 additions and 352 deletions.
9 changes: 4 additions & 5 deletions usermods/Temperature/platformio_override.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
; Options
; -------
; USERMOD_DALLASTEMPERATURE - define this to have this user mod included wled00\usermods_list.cpp
; USERMOD_DALLASTEMPERATURE_CELSIUS - define this to report temperatures in degrees celsius, otherwise fahrenheit will be reported
; USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL - the number of milliseconds between measurements, defaults to 60 seconds
; USERMOD_DALLASTEMPERATURE_FIRST_MEASUREMENT_AT - the number of milliseconds after boot to take first measurement, defaults to 20 seconds
;
[env:d1_mini_usermod_dallas_temperature_C]
extends = env:d1_mini
build_flags = ${common.build_flags_esp8266} -D USERMOD_DALLASTEMPERATURE -D USERMOD_DALLASTEMPERATURE_CELSIUS
build_flags = ${common.build_flags_esp8266} -D USERMOD_DALLASTEMPERATURE
lib_deps = ${env.lib_deps}
milesburton/DallasTemperature@^3.9.0
OneWire@~2.3.5
paulstoffregen/OneWire@~2.3.7
# you may want to use following with ESP32
; https://github.com/blazoncek/OneWire.git # fixes Sensor error on ESP32
13 changes: 9 additions & 4 deletions usermods/Temperature/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ May be expanded with support for different sensor types in the future.

If temperature sensor is not detected during boot, this usermod will be disabled.

Maintained by @blazoncek

## Installation

Copy the example `platformio_override.ini` to the root directory. This file should be placed in the same directory as `platformio.ini`.

### Define Your Options

* `USERMOD_DALLASTEMPERATURE` - enables this user mod wled00/usermods_list.cpp
* `USERMOD_DALLASTEMPERATURE_FIRST_MEASUREMENT_AT` - number of milliseconds after boot to take first measurement, defaults to 20000 ms
* `USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL` - number of milliseconds between measurements, defaults to 60000 ms (60s)

All parameters can be configured at runtime via the Usermods settings page, including pin, temperature in degrees Celsius or Farenheit and measurement interval.

Expand All @@ -27,7 +29,6 @@ All parameters can be configured at runtime via the Usermods settings page, incl

If you are using `platformio_override.ini`, you should be able to refresh the task list and see your custom task, for example `env:d1_mini_usermod_dallas_temperature_C`.


If you are not using `platformio_override.ini`, you might have to uncomment `OneWire@~2.3.5 under` `[common]` section in `platformio.ini`:

```ini
Expand All @@ -43,8 +44,9 @@ default_envs = d1_mini
lib_deps =
...
#For Dallas sensor uncomment following line
OneWire@~2.3.5
...
OneWire@~2.3.7
# ... or you may want to use following with ESP32
; https://github.com/blazoncek/OneWire.git # fixes Sensor error on ESP32...
```

## Change Log
Expand All @@ -56,3 +58,6 @@ lib_deps =
* Report the number of seconds until the first read in the info screen instead of sensor error
2021-04
* Adaptation for runtime configuration.
2023-05
* Rewrite to conform to newer recommendations.
* Recommended @blazoncek fork of OneWire for ESP32 to avoid Sensor error
Loading

0 comments on commit cdfc0f6

Please sign in to comment.