Merge branch 'mega' into feature/SPI-add-support-for-multiple-buses

This commit is contained in:
Ton Huisman
2026-01-08 11:17:14 +01:00
committed by GitHub
43 changed files with 1357 additions and 115 deletions
+4 -4
View File
@@ -37,7 +37,7 @@ jobs:
make html
cd ..
zip -r -qq ESPEasy_docs.zip docs/build/*
- uses: actions/upload-artifact@v5
- uses: actions/upload-artifact@v6
with:
name: Documentation
path: ESPEasy_docs.zip
@@ -88,7 +88,7 @@ jobs:
uses: Entepotenz/change-string-case-action-min-dependencies@v1
with:
string: ${{ matrix.chip }}
- uses: actions/upload-artifact@v5
- uses: actions/upload-artifact@v6
with:
# FIXME Workaround to (temporarily) not use # in the artifact name, see https://github.com/actions/upload-artifact/issues/473
name: Bin-${{ steps.string.outputs.uppercase }}-${{ matrix.env }}-${{ steps.date.outputs.builddate }}_PR_${{ github.event.number }}_${{ github.run_id }} # Sort by ESP type
@@ -110,7 +110,7 @@ jobs:
run: |
echo "builddate=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v6
uses: actions/download-artifact@v7
with:
path: artifacts/Binaries/bin/
pattern: Bin-*
@@ -119,7 +119,7 @@ jobs:
run: |
cd artifacts/Binaries/
ls -R
- uses: actions/upload-artifact@v5
- uses: actions/upload-artifact@v6
with:
# FIXME Workaround to (temporarily) not use # in the artifact name, see https://github.com/actions/upload-artifact/issues/473
name: ESPEasy-all-Binaries-${{ steps.date.outputs.builddate }}_PR_${{ github.event.number }}_${{ github.run_id }}
+6 -4
View File
@@ -58,7 +58,7 @@ jobs:
uses: Entepotenz/change-string-case-action-min-dependencies@v1
with:
string: ${{ matrix.chip }}
- uses: actions/upload-artifact@v5
- uses: actions/upload-artifact@v6
with:
name: Bin-${{ steps.string.outputs.uppercase }}-${{ matrix.env }}
path: |
@@ -71,6 +71,8 @@ jobs:
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Build documentation
run: |
cd docs
@@ -85,7 +87,7 @@ jobs:
cd dist
zip -r -qq ../ESPEasy_dist.zip *
cd ..
- uses: actions/upload-artifact@v5
- uses: actions/upload-artifact@v6
with:
name: Distribution
path: |
@@ -129,13 +131,13 @@ jobs:
run: |
echo "builddate=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: Download all successfully compiled artifacts
uses: actions/download-artifact@v6
uses: actions/download-artifact@v7
with:
path: artifacts/bin/
pattern: Bin-*
merge-multiple: true
- name: Download dist and docs zip files
uses: actions/download-artifact@v6
uses: actions/download-artifact@v7
with:
path: distribution/
name: Distribution
+554
View File
@@ -1,3 +1,557 @@
-------------------------------------------------
Changes in release mega-20260108 (since mega-20260107)
-------------------------------------------------
Release date: Thu Jan 8 08:33:12 AM CET 2026
TD-er (1):
Add Python version for prepare-dist in release.yml
-------------------------------------------------
Changes in release mega-20260107 (since mega-20250430)
-------------------------------------------------
Release date: Wed Jan 7 11:00:02 PM CET 2026
Bartłomiej Zimoń (4):
Update Flashing.rst
Update Flashing.rst
Update Flashing.rst
Update Flashing.rst
Fabio Ancona (2):
Update LD2410 doc adding info of false positive
Update P159.rst
Jason2866 (8):
remove cache use uv
Update build.yml
Update post_esp32.py
Update post_esp32.py
add forgotten function
missing import os
Update post_esp32.py
remove cache use uv
TD-er (55):
[Favicon] Serve favicon.ico as inline SVG
[settings] Reduce initial default config.dat to 96k on ESP32
[JSON] Tweak generating JSON via web requests
[Favicon] Tweak blue color in SVG ESPEasy favicon
[Time] Speedup printing date/time string
[Build] Remove TAR support from LIMIT_BUILD_SIZE builds (saves 5+ kB)
[OLED display] Reduce build size for P023
[SysVarPage] Fix table layout on builds with excludes features
[SysVarPage] Make more clear separation for "Standard Conversions"
[Sysvar] Enable %c_random% for all builds
[ESP32-S2] Change ADC for ESP32-S2 back to 13 bit
[ESPtool] Prepare use of esptool v5.0.0
[Build] Get rid of all ESP32-SPIFFS builds
[ESPtool] Prepare use of esptool v5.0.0
[ESPEasy p2p] Add node-IDs for new Espressif SoC models
[ADC] Fix not setting attenuation on internal ADC
[Build] Update to latest IDF5.4 build + add C6 builds
[ESP32-S3] Revert changes in board defines for ESP32-S3 with OPI PSRAM
[Build] Speed up ESP32 builds via CompiletimeDefines_generated.h
[WebFlasher] Add missing ESP32-xx MCUs to manifest script
[Build] Speed up ESP32 builds via CompiletimeDefines_generated.h
[WebFlasher] Add missing ESP32-xx MCUs to manifest script
[Rules] Fix processing variables with index > 2^31
[MFRC522] Speed-up detecting cards + make error recovery more stable
[MFRC522] Improve range of reader
[MFRC522] Simplify board reset during init
[MFRC522] Allow to dump card info to debug logs
[MFRC522] Do proper timing for communicating with card
[MFRC522] Speedup reading by acting on interrupt pin
Add HTML_Print and PrintToString helpers
[Log] Add PrintToLog helper
[PWM motor] Speedup acting on limit switch interrupt
[ESP-IDF] Update to latest SDK version
[WebFlasher] Add more info on migrate to LittleFS on web flasher page
[WebFlasher] Update LittleFS migration guide in webflasher page
[PWM motor] Fix limit switch invert (again)
[PubSubClient] Update to new fork PubSubClient3
[PubSubClient3] Speedup publish large messages using buffer
[PubSubClient3] Add check for nullptr in CHECK_STRING_LENGTH
[Controller] Fix crashes on MQTT callback calls
[WebServer] Properly close chunked transfer
[Cleanup] Fix JS issues + correctly end chunked transfer
[Build] Try fixing failing solo1 build
[ESP32-U4WDH] Fix bootloop on non-Solo1 builds
Fix missing #ifdef USES_P056
[Build] Fix missing #ifndef LIMIT_BUILD_SIZE
[SysVars] Fix showing variables with hex number as index
[MQTTDiscovery] Reduce mem alloc MQTT_DiscoveryPublishWithStatusAndSet
Reduce ESP32 Display build size (BUILD_NO_DEBUG)
[CacheReader] Fix continue reading after crash/reboot
[CacheReader] Fix reading cache files from CacheController
[CacheReader] Add support for 64bit ints + output as events
[CacheReader] Fix incorrect settings array index
[Build] Limit package building to use Python 3.13
[Collection] Remove P038 and P095 from ESP32 Collection builds
Ton Huisman (369):
[P073] Add support for 74HC595 displays
[P073] Disable debug log
[P073] Make build fit again (part 1)
[P073] Make build fit again (part 2)
[P094] Remove from Collection D for ESP8266 buildsize
[P073] Move most code to PluginStruct files, explicit compile-time defines
[P073] Make 7-segment font functions publicly available
[P073] Separate 74HC595 multiplexed displays, code improvements
[P073] Update documentation
[P073] Disable 74HC595 displays for now
[P073] Add double-buffering for 74HC595 displays
[P073] Make some functions available externally, fix 74HC595 matrix display (sort-of, still some flickering)
[P073] Fine-tuning and allow to include 74HC595 in ESP8266 Custom builds
[P073] Make P073_revert7bits() available for global use
[P073] Fix copy/paste error
[P073] Use more efficient bit-revert algorithm, as suggested
[P073] Add option for time-blinking the second dot instead of the colon
[P073] Use DIRECT_PIN_IO for TM1637 displays for better timing accuracy
[P073] Update documentation
[P073] Should use the public function
[P165] Fix compiler warning
[MQTT] (Auto)Discovery implementation
[P052] Add MQTT Discovery data for supported Values
[Source] Fix CR/LF vs LF
[MQTT] Add support for more VTypes, implement more VTypes, small improvements
[MQTT] Move TaskValue VType Discovery to each plugin where needed. Some other code improvements
[P105] Fix Uncrustify formatting
[P164] Add fixme for currently unsupported AQI Discovery value
[Discovery] Add VType for Reactive Power
[Discovery] Implement VType for Reactive Power
[P076] Implement Discovery support (for user-selected values)
[P077] Implement Discovery support (for user-selected values)
[P078] Implement Discovery support (for user-selected values)
[P085] Implement Discovery support (for user-selected values)
[P102] Implement Discovery support (for user-selected values)
[P108] Implement Discovery support (for user-selected values)
[P115] Implement Discovery support (for user-selected values)
[P132] Implement Discovery support (for user-selected values)
[P142] Implement Discovery support (for user-selected values)
[Discovery] Refactor getting VType per plugin, add some more plugins for AutoDiscovery
[Discovery] Add support for some more VTypes, add AQI and NOx
[P147] Implement MQTT Discovery support
[P164] Update MQTT Discovery support
[EasyColorCode] Updates April 2025
[P020] Update documentation
[P116] Fix typo in docs
[P180] Add plugin Generic I2C
[P180] Add also to Display, Energy and Neopixel collection builds (ESP32 only)
[P180] No defaults for I2C address or number of values
[P180] Cleanup memory after use, fix ESP8266 compilation
[P180] Cleanup memory after use, fix ESP8266 compilation
[Rules] Fix parsing bracketed expressions from position 0
[P180] Add conditionally cancelling a command sequence (if)
[Rules] Add support for crc8 and crc32 functions
[P180] Optimize hex formatting, add preprocessed calculation to logging
[Rules] Add optional validation of crc to crc8 and crc32 functions
[EasyColorCode] Add more plugin commands
[P180] Correct regular value handling, improved hex formatting
[P180] Add documentation and usage examples
[P180] Add exec subcommand, add valuename support, fix issue updating command-cache
[P180] Add handling 1/sec, 10/sec and 50/sec event processing, add log subcommand
[P180] Update documentation and usage examples
[P180] Update documentation and usage examples
[EasyColorCode] Update commands for P180
[Docs] Add examples for substring for translation of day/month names
[P180] Add let I2C Command, limit delay to max 10ms for 1ps/10ps/50ps
[P180] Add to Custom-sample.h
Bugfix [P075] Typo in check for RxD GPIO pin
[P180] Refactor into BusCmd, phase 1
[P021] Bugfix: Make Invert work without a GPIO pin selected
[P180] Refactor into BusCmd_Handler interface, phase 2, Add String support
[P180] Remove previously added but unused I2C functions
[P061] Resolve I2C related FIXMEs, gaining ~120 bytes
[P180] Update documentation
[P011] Optimize I2C calls, gaining ~110 bytes
[Discovery] Add /config and Retain Discovery settings to MQTT Controller with AutoDiscovery
[Discovery] Fix Switch auto-discovery [Discovery] Add support for Inverted Switch [Discovery] Add support for Switch Device Class configuration
[P001] Implement Switch MQTT Device Class setting and Inverted Switch discovery
[P009] Implement Switch MQTT Device Class setting and Inverted Switch discovery
[P001][P009] Correct typo
[P019] Implement Switch MQTT Device Class setting and Inverted Switch discovery
[P021] Implement Switch MQTT Device Class setting and Inverted Switch discovery
[Discovery] Add support for different Switch device class per value
[Rules] Add support for String type variables
[StringVars] Fix variable typo
[StringVars] Remove unneeded UnaryOperator::IsNum
[StringVars] Fix new introduced template parser bug
[StringVars] Make string comparisons work with `if`
Add new commands and functions for String variables support
[SysVars] Make second argument for 2-argument conversions optional
[StringVars] Add documentation
[StringVars] Add documentation for [length#var]
[Bugfix] String commands parser fix off-by-one issue
[Rules] Add string function Lookup with docs
[Rules] Add conversion function %c_strf%() with docs
[Rules] Fix typo in docs
[StringVars] Add TaskValueSetDerived, TaskValueSetPresentation commands and handling
[StringVars] Add TaskValueSetDerived, TaskValueSetPresentation docs
[Docs] Move Data Acquisition to separate include file
[StringVars] Avoid calculation of formula with presentation prefix ($)
[StringVars] Improved handling of calculated values for Derived values
[SysVars, Conversions] Add %localunixtime%, %systzoffset_s% sysvars and %c_ts2date%() conversion + docs
[SysVars] Exclude %localunixtime% from Limited builds
[SysVars] Rename %localunixtime% to %unixtime_lcl%
[DerivedValues] Add Event & Log option and generate events and logging for Derived values, update docs
[SysVars] Add %c_ts2wday%(timestamp) (dow) conversion and docs
[EasyColorCode] Add more new commands and functions for String variables support
[P180] Add GET_CONFIG_VAR support
[Discovery] Fix typo in BinarySensorInverted helper
[Docs] Update WSL2 USB Serial configuration since Linux 6.x core update
[Feature] Add Unit of Measure for all taskvalues and present on Devices overview page
[UoM] Add Unit of measure value to /json endpoint
[UoM] Add Unit of measure value Devices overview page update script (also uses Presentation if available)
[Build] Reduce size of included Github clipboard script
[Build] Include reboot.js script in readable form
[Build] Reduce size of included Fetch and parse logs script
[UoM] Add Unit of measure value Devices overview page update script (also uses Presentation if available)
[JSON] Add Presentation as separate value instead of replacing Value (using updated .js scrip)
[UoM] Make .js script more fault tolerant when no global UoM enable setting is available
[DerivedValues] Don't determine max decimals for display but use default
[DerivedValues] Add optional Unit of Measure and include in /json output
[UoM] Make .js script more fault tolerant when no global UoM enable setting is available
[UoM] Optional default when fetching Unit of Measure
[Discovery] Implement UoM per taskValue when available
[I2C] Show I2C Bus nr in Not enabled message of i2cscanner
[I2C] Add a few missing I2C device addresses for INA219
[UoM] Add Feature TaskValue-attributes with support for .uom, .decimals, .hasformula and .statsenabled
[DerivedValues] Move parsing derived variables to correct code-location
[DerivedValues] Add TaskValue attribute support for DerivedValues (empty is not valid)
[Discovery] Add default empty option for Device Class selector (all values shift 1 index up!)
[P116] Add support for ST7735/ST7789 170x320 displays
[SysVarPage] Exclude c_random from list for limited builds
[UoM] Add documentation
[UoM] Update documentation
[UoM] Update documentation
[VTypes] Refactor SensorValueType selector so it can be used separately
[VTypes] Refactor SensorValueType selector so it can be used separately (cherry picked)
[ValueTypes] Add Custom VType selection
[Plugins] Add CustomVTypeVar option for plugins that need custom Value Type selection
[DerivedValues] Add support for Value Type argument
[AutoDiscovery] Add support for Derived values, UoM and Value Type, some code optimizations
[C006] Add support for sending derived values
[C014] Add Unit of Measure to AutoDiscovery, add Send Derived values support
[Docs] Updates and improvements, Summer '25
[Docs] Update docs for Value Type setting for selected plugins
[Docs] Move Send derived values as a per controller setting for tasks
[Derived Values] Move enable sending per task-controller, Code optimization
[C014] Docs: Update UoM feature
[P027] Docs: Fix a few typos
[P180] Improvements and fixes in handling of signed values
[Docs] Update/extend the SPIFFS to LittleFS migration procedure
[Docs] Update/extend the SPIFFS to LittleFS migration procedure
[Docs] Extract SPIFFS to LittleFS migration guide for accessability
[Docs] Expand SPIFFS to LittleFS migration guide, add troubleshooting section
[AutoDiscovery] Add support for Wind direction and Wind speed
[Plugins] Minor code improvement
[UoM] Restructure UoM selector into categories, add more uom options
[UoM] Fix UoM selector empty value
[Docs] Update Unit of Measure documentation and screenshots
[AutoDiscovery] Embed setting for `online` message in `/config` setting
[Docs] Update documentation for C005
[AutoDiscovery] Update PluginTemplate
[AutoDiscovery] Embed setting for `online` message in `/config` setting
[Docs] P165 Fix a few typos
[AutoDiscovery] Remove unused code
[AutoDiscovery] Make start delay compiletime configurable, and extend max delay from 10 to 30 sec.
[Docs] Update documentation for C005
[AutoDiscover] Add Duration, Date and Timestamp device classes, fix some irregularities
[AutoDiscover] Add Data rate, Data size, Sound pressure and Signal strength
[AutoDiscover] Refactor discovery message composition to reduce binary size by nearly 4k
[AutoDiscover] Set Unit of Measure and Value Type when adding a device (when possible/available)
[P095] Add ILI9342 display variants
[P095] ILI9342 added configurations, set resolution correctly
[P095] Update documentation
[UoM] Correct a few Value Type UoM defaults
[P026] Set default Value Type and UoM when changing a task value setting
[Converters] Add `%c_ts2isodate%()` Timestamp to ISO date conversion
[Converters] Add `%c_ts2isodate%()` Timestamp to ISO date conversion
[AutoDiscover] Clean names sent to HA by replacing unsupported characters by `_`
[Converters] Include system time-zone in `%c_ts2isodate%()` to have HA accept the `Timestamp` value type
[Converters] Make system time-zone optional in `%c_ts2isodate%()` (second argument != 0)
[Converters] Make system time-zone optional in `%c_ts2isodate%()` (second argument != 0)
[AutoDiscover] Add `Date/Time` (`datetime`) Device class
[AutoDiscover] Fix handling of BARO_ONLY values, and allow multiple BARO_ONLY values
[AutoDiscover] Remove non-working `Date/Time` (`datetime`) Device class :-(
[ValueTypes] Add categorized selector for Value Type per Value
[P176] Set default Value Types when adding the plugin
[ValueTypes] Fix optional None value
[P180] Remove unneeded code
[AutoDiscover] Try to get switch trigger working
[ValueTypes] Reorder value types somewhat, use categorized selector where applicable
[ValueTypes] Update documentation
[P014] Fix MQTT Discovery value types
[Build] Remove "_CDC_" from all env names due to linker issues
[MQTT] Fix command handling for /set and /cmd topic endpoints, add support for P001 in /set
[AutoDiscover] Mark some MQTT Device classes as 2-way to have on/off devices (Light)
[CustomVtype, UoM] Fix compilation for ESP8266 when not all enabled
[AutoDiscover] Better array index checks
[Backup] Add backup without credentials included (security.dat)
[Metrics] Add internal CPU temperature
[Backup] Use term credentials instead of username/password
[Backup] Update documentation
[Metrics] Update documentation
[AutoDiscover] Add support for P009 and P019, only send discovery for plugins that actually send data
[AutoDiscover] Fix flippin bit-flip issue
[AutoDiscover] Fix P021 not to be handled as a Switch
[Backup] Fix typo in variable name for ESP8266
[AutoDiscover] Fix Group configuration
[Backup] Compile error when TAR support disabled
[Libs] MFRC522 remove unused variable
[Libs] PubSubClient signed/unsigned comnparison warning
[AutoDiscover] Set default Auto Discovery topics when adding HA Controller
[P009][P019] Fix logging alignment
[AutoDiscover] Fix a few comments
[AutoDiscover] Docs improvement for Group feature
[TaskValueSetDerived] Improved parsing of Unit of Measure value
[AutoDiscover] Fix conditional compilation issue
[Rules] Enable rules by default on a clean install
[AutoDiscover] Add state_class support and some Value Types
[AutoDiscover] Enable state_class support for plugins and correct a few Value Types
[AutoDiscover] Update documentation
[AutoDiscover] Fix compilation when state_class support not enabled
[AutoDiscover] Small code improvement
[P078] Improved value descriptions and register appended, small code improvements
[Caches] Formatting (minor)
[P056] Add multi-instance use
[P078] Fix docs parser warning
[P056] Update documentation
[P102] Add support for PZEM-017v1
[P102] UI updates and corrections
[P102] Add documentation
[Build] Fix compiler warning for unused variable
[BusCmd I2C] Add support for handling > 128 bytes on I2C read/write (ESP32)
[BusCmd Helper] Add support for variable length string and buffers (Byte/Word), and some bugfixes
[P180] Update documentation
[BusCmd Helper] Send data & event when updating value.N from other than PLUGIN_READ action
[BusCmd Helper] Add LetStr I2C command, analogue to the `LetStr` Rules command, updated documentation
[P102] Small typo in documentation
[AutoDiscover] Use %sysname% instead of group_nr if Controller Group = UnitNr
[AutoDiscover] Update documentation for Group setting
[AutoDiscover] Add 15 more Value types and 7 UoM values, fix some default UoM
[AutoDiscover] Update Value type and UoM documentation
[MQTT] Add Retain option per task
[MQTT] Update documentation for Retained setting per task
[MQTT] Some documentation improvements
[Build] Add [P105] AHT2x to Collection G so it can be used with [P164] ENS160
[P089] Add support for ESP32
[P089] Remove unneeded attribute
[P089] Create separate Ping Service to handle single-instance Ping function sequentially
[P180] Add Tiny Code Reader example to documentation
[P180] Add optional skip argument to IF I2C command, update docs
[P021] Emphasize warning to prevent saving settings too often
[P039] Update SPI and GPIO documentation
[P037] Use configured decimals when generating events
[P037] Update documentation for: use configured decimals when generating events
[P168] Disable blocking Lux Read-Method options
[P168] Update documentation
[P102] Don't check non-available values for NaN
[P102] Correct documentation small typos
[MQTT] Handle connecting to broker as a background process
[Tools] Update documentation for MQTT Connect in background
[MQTT] Move Settings attribute to next available bit
[MQTT] Reconnect on unexpected network interruptions
[P089] Update documentation
[MQTT] Cancel background connection request after 2 minutes when still not connected
[MQTT] Fix reconnect on unexpected network interruptions
[Discovery] Avoid setting the timeout more than once
[MQTT] Use client timeout for delay between connection attempts
[Build] Fix missing include
[MQTT] Refactor background connection process to avoid logging from background task
[AutoDiscover] Fix small typos in default UoM list
[AutoDiscover] Fix spelling error in precipitation
[AutoDiscover] Fix spelling error in precipitation
[MQTT] Fix compilation on ESP8266 (Retain per task)
[P089] Bugfix: Putt include in scope
[P102] Use added setModel() method when needed
[P033] Enable formula field
[P033] Update documentation
[P102] Use defined constants
[P102] Add Submit instruction after use of 'Reset energy' mode
[P102] Update documentation
[Info] Emphasize the number of flash writes count since cold boot #3116
[C011] HTTP Advanced - Don't URL-encode header
[HTTP] Add support for TLS
[HTTP] Enable TLS support for Controllers using HTTP
[P002] Fix docs layout issue
[HTTP] Defensive programming in test for https url
[HTTP] Enable TLS support also for Controller C007 Emoncms
[Devices] Limit displaying of (old) Wiki Help button to P056 and below
[Devices] Limit displaying of (old) Wiki Help button to P079 and below
[MQTT] Reduce work/memory in background task, use xTaskDelay as required
[Docs] Correct some layout inconsistencies
[Docs] Update overview generator, include Notify and Network plugins
[Build] Fix compiler warning
[Tools] Add Plugin list overview page
[Tools] Update documentation for Plugin list
[Build] Split Display into Display A and Display B
[Build] Display A/B split: Update documentation
[Tools] Add documentation-button to Plugin list overview page
[Tools] Add preliminary support for Network plugins
[Docs] Add MQTT Device class documentation for plugins where available
[MQTT] Minor corrections
[TLS] Update TLS to be able to use ECDHE_ECDSA_AES_128_GCM_SHA256 cipher
[Docs] ESP8266 is Feature Complete!
[TLS-MQTT] Automatic switch to ECDSA when error is 296 (TLS handshake)
[MQTT AutoDiscovery] Add support for Switch Device Class
[MQTT AutoDiscovery] Update documentation for Device Class
[P026] Fix Value Type for TXpower to use dBm
[HTTP] Fix build and feature-enable for non-MAX builds
[HTTP] Update documentation for TLS options
[UoM] Refactoring to reduce page-load time and size
[Build] Add Collection H and split Climate into Climate A and Climate B
[Build] Fix build errors for Collection H and Climate B
[Build] Remove obsolete comments
[Build] Move more plugins from Collection G to H to make Collection G fit
[Build] Reduce build-size for all Collection builds using BUILD_NO_DEBUG
[Build] Reduce build-size for Collection C build
[P169] Fix DEBUG log
[Build] Avoid build-reduction for MAX builds
[Build] Avoid build-reduction for MAX builds
[P021] Code optimizations
[Build] Remove _LittleFS and _ETH from build names due to linker issues
[Build] Enable `custom_remove_include` to not build ignored libs
[Build] Limit package building to use Python 3.13
[UI] Update addTaskSelector() to use FormSelectorOptions
[Docs] P180 Add example for reading Sensirion SDP-8xx
[Docs] P180 Small corrections
[Docs] P180 Sensirion SDP-8xx add description for Single-shot measurement
[Bugfix] Don't use Flash-string parameter default as ESP8266 compiler doesn't support that
[Bugfix] PluginList add missing includes needed in some builds
[PluginList] Update for HTTPS TLS support
[Build] Fix SafeBoot build
[Bugfix] Derived values avoid parsing invalid values causing crashes
[Bugfix] Derived values avoid parsing invalid values causing crashes, more global fix
[Bugfix] Revert previous change as that didn't really fix the issue
[AutoDiscovery] Show Auto Discovery for Controllers that have this enabled (Task configuration)
[Bugfix] Calculation missed value when returning from multiple brackets
[Bugfix] MQTT StateClass selector stored wrong index
[P003] Enable MQTT State Class option so pulse-counter can be used for energy measurement (in HA)
[P180] BusCmd_Helper processing I2C commands via cmd subcommand was locked out
[SysVars] Add %latitude% and %longitude% vars and Latitude and Longitude commands
[SysVars] Documentation for %latitude% and %longitude% vars and Latitude and Longitude commands
[P180] Enable CustomVTypeVar and MQTTStateClass device flags
[P180] Fix typo in parameter for log subcommand
[P180] Add documentation for TF-Luna laser distance sensor
[P180] Small updates in documentation of TF-Luna laser distance sensor
[P180] Add documentation for QMC6310 3-axis magnetic sensor, add example-index to docs page
[Bugfix] Calculation of functions discarded the next operator
[Bugfix] Calculation of functions remove unneeded value duplication, small debug-code optimization
[Rules] Add some functions, conversions and constants
[Rules] Add some functions, conversions and constants, fix docs typo
[Docs] Updates and improvements (2025 Q4/2026-01)
[Stats] Add minp/maxp stats values and change min/max stats values for running min/max value, update docs
[Bugfix] Compilation error fix for custom IR build
[Bugfix] Metrix: Export 0 for empty values
[Bugfix] Metrix: Export 0 for empty values, fix for ESP8266
[AdaGFX] Fix `tpm` subcommand argument check
[Docs] Update copyright notice to show 2026
[AdaGFX] Fix space-height issue for some fonts
[P116] Add ST77xx resolutions 240x320 and 240x280
[P116] Allow for > 16 hardware types in selection
[P116] Update documentation with new resolutions
[P087] Add support for receiving binary data, fixed length data, and event as hex string
[P087] Update documentation
[P087] Add to `ENERGY` build (ESP32 only)
[Converters] Bugfix formatToHex_wordarray()
[P087] Use PCONFIG_ULONG to store new config flags
[P004] Change name to include DS18xxx/MAX31xxx for better recognizability
[P057] Add documentation as it wasn't included yet
chromoxdor (63):
Update Networking.cpp
a tiny bit better formatting
changes for OPENMETEO_EVENT and THINGSPEAK_EVENT
Update Networking.cpp
combining two functions
wrong use of concat times two :)
update
Update Networking.cpp
put thingspeak and openmeteo events into extra file
added inverter event
fix for not building on minimal_core_274_esp8266...
#ifdef to #if. m(
more universal json event approach
Update HTTPResponseParser.h
added variable decimals for floating point numbers
some changes to the json-event
made the eventQueue even more complex :P
minor changes
moved variable to cpp file
updates
Update HTTPResponseParser.cpp
Update define_plugin_sets.h
Update HTTPResponseParser.cpp
Update HTTPResponseParser.cpp
documentation and slight reduction of code
Update define_plugin_sets.h
corrected json examples
Docs: Formatting and linking
fixed typo
[P164 ] Adding a sleep mode
Update P164_data_struct.cpp
Update define_plugin_sets.h
Changes as requested
Update HTTPResponseParser.rst
Update HTTPResponseParser.cpp
ColorCode Additions
Update espeasy.js
forgot the "f" and the minified version
some unessecary commas removed
no indentation for comments....
added a format button if on mobile device
format even without colorcode enabled
more robust block checks
jump to line of first error and keep history
make it work for android non color rules again
Readded search bar and enhanced it.
fixed broken replace function
forgot someting to change
find while typing
fix replace
more robust live search handling
removed unnecessary function
scroll to top when found
Update codemirror.min.css
replace: scroll to top too
as good as it gets :)
minor corrections help text
rephrasing of the confirm dialog
fix: jump back to cursor position after formatting
..and remove an old dialog before opening a new one
disable shortcuts
disable shortcut: forgot to add the corresponding function
Update espeasy.min.js
dependabot[bot] (10):
Bump cryptography from 43.0.1 to 44.0.1
Bump actions/download-artifact from 4 to 5
Bump actions/checkout from 4 to 5
Bump actions/setup-python from 5 to 6
Bump actions/github-script from 7 to 8
Bump actions/download-artifact from 5 to 6
Bump actions/upload-artifact from 4 to 5
Bump actions/checkout from 5 to 6
Bump actions/upload-artifact from 5 to 6
Bump actions/download-artifact from 6 to 7
jfmennedy (1):
Fix horizantal vane not working
repa6 (7):
added TAC2100 support to _P078_Eastron plugin
Update _P078_Eastron.ino with changelog info
Update P078_data_struct.h: added comma after TAC2100=7
extended TAC2100 registers list and added TAC2100 to docimentation
fixed redister nature of load
Update P078_data_struct.cpp - added nat:load to SDM_UOMtoString strings
Update P078_data_struct.cpp - updated register addresses for the last 5 registers of TAC2100
-------------------------------------------------
Changes in release mega-20250430 (since mega-20241222)
-------------------------------------------------
+54 -6
View File
@@ -1,4 +1,4 @@
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
.. _P057_page:
|P057_typename|
@@ -26,10 +26,59 @@ Supported hardware
|P057_usedby|
.. Commands available
.. ^^^^^^^^^^^^^^^^^^
Introduction
------------
.. .. include:: P057_commands.repl
The HT16K33 16 port generic I/O chip can be configured to act as a LED driver or as a maxtrix-keyboard input. This plugin describes settings for it to be used as a LED / 7-segment display driver.
Configuration
-------------
.. image:: P057_DeviceConfiguration.png
Task settings
~~~~~~~~~~~~~
* **Name** The name of the task. This should be unique for all devices that are configured. (Initially empty)
* **Enabled** For the device to work it has to be enabled. When checked, the device will be started as soon as the ESP starts. If desired, the device can also be enabled from f.e. a rule by using the ``TaskEnable,<tasknr>`` or ``TaskEnable,<taskname>`` command, or disabled using the corresponding ``TaskDisable,<tasknr>|<taskname>`` commands.
I2C options
^^^^^^^^^^^
* **I2C Address**: Select the address the chip is set for, available options:
.. image:: P057_I2CAddressOptions.png
The available settings here depend on the build and hardware configuration used. At least the **Force Slow I2C speed** option is available, but selections for the I2C Multiplexer can also be shown. For details see the :ref:`Hardware_page`
Device Settings
~~~~~~~~~~~~~~~
7-Seg. Clock
~~~~~~~~~~~~
* **Clock Type**: Select wether the time should be automatically displayed, in either 24h or 12h format, or ``none``, so other information can be shown, using the commands below.
* **Seg. for Xx:xx**: Choose the segment to be used for the 10-hour digit. Usually 0.
* **Seg. for xX:xx**: Choose the segment to be used for the hour digit. Usually 1.
* **Seg. for xx:Xx**: Choose the segment to be used for the 10-minutes digit. Usually 3 (when a colon is included).
* **Seg. for xx:xX**: Choose the segment to be used for the minutes digit. Usually 4 (when a colon is included).
* **Seg. for Colon**: Choose the segment to be used for the colon sign (if any). usually 2. And the value to be used for lighting up the colon. Usually (also) 2.
Commands available
^^^^^^^^^^^^^^^^^^
.. include:: P057_commands.repl
.. Events
.. ~~~~~~
@@ -42,8 +91,7 @@ Change log
.. versionchanged:: 2.0
...
|added|
Major overhaul for 2.0 release.
|added| 2025-12-29 Documentation added.
.. versionadded:: 1.0
...
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

+50
View File
@@ -0,0 +1,50 @@
.. csv-table::
:header: "Command Syntax", "Extra information"
:widths: 20, 30
"
| ``m,<param>[,<param>,<param>...]``
","
| Light up leds on the display, description of params below, all values treated as decimal.
| This is a low-level command, giving exact control over what led/segment is lit.
"
"
| ``mx,<param>[,<param>,<param>...]``
","
| Light up leds on the display, description of params below, all values treated as hexadecimal.
| This is a low-level command, giving exact control over what led/segment is lit.
"
"
| ``mnum,<param>[,<param>,<param>...]``
","
| Light up segments on the display, description of params below, all values to be used as numeric content for a 7-segment display.
"
"
| ``mprint,<text>``
","
| Light up numeric digits on a 7-segment display. If a colon is configured, and another character would land on that segment, then the colon-segment is skipped, a colon would be shown on the colon segment.
| This would be the standard command to display numeric data on the display, when not used in Clock-mode.
"
"
| ``mbr,<0..255>``
","
| Set the brightness of the display in given range, 0 is off, 255 is max. brightness.
"
"
| ``<param>``
","
| A ``<param>`` can be one of these:
| ``<value>`` : A numeric (or hexadecimal, without any prefix, for ``MX`` command) value, that is displayed starting on segment 0, auto-incrementing the segment for multiple values in a single command.
| ``<seg>=<value>`` : Address an explicit segment with a value.
| ``clear`` : Set all values to 0, turning off all leds/segments.
| ``test`` : Fill the leds/segments with a test-pattern.
| ``log`` : Write the current led-buffer values to the log (INFO level).
"
+14
View File
@@ -90,6 +90,18 @@ Statistic data is only visible if the plugin is configured and enabled.
This shows the latest data received and some statistics.
Data options
^^^^^^^^^^^^
(These options are only available if build is without ``LIMIT_BUILD_SIZE`` set)
* **Receive binary data**: When enabled accepts any character for input. Does not terminate on a CR character received, but on end of data (no more bytes available), or when using the **Fixed length input data** setting.
* **Fixed length input data**: When 0 this feature is disabled. When set > 0 (max. length 255 characters), reading is stopped after this number of characters. Best used for reading binary data.
* **Event with hex. data (no prefix)**: When checked will generate the event with the received data converted to hexadecimal data (length is doubled), without a prefix (often hex data is prefixed with ``0x``). Data is still filtered (when enabled) and proxied *without* conversion!
.. include:: DataAcquisition.repl
* **Interval** By default, Interval will be set to 60 sec.
@@ -226,6 +238,8 @@ Change log
.. versionchanged:: 2.0
...
|added| 2025-12-23 Add support for binary data, fixed length input and convert event data to hex.
|added| 2024-02-25 Add support for ``serialproxy_test`` command and retrieving the separate groups from parsed regex.
|added| 2023-03-22 Add support for writing any binary data out via the serial port.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 51 KiB

+4 -1
View File
@@ -28,9 +28,10 @@ The ST7735, ST7789 and ST7796 chip families drive color TFT displays in various
This plugin supports these display models:
* **ST7735** with resolutions 128 x 128, 128 x 160, 80 x 160, 135 x 240, 170 x 320 and 172 x 320 pixels
* **ST7735** with resolutions 128 x 128, 128 x 160, 80 x 160, 135 x 240 and 172 x 320 pixels
* **ST7789** with resolutions 240 x 320, 240 x 240, 240 x 280 and 135 x 240 pixels
* **ST7796** with resolution of 320 x 480 pixels.
* **ST77xx** (unknown if this is ST7735 or ST7789) with resolution of 170 x 320, 240 x 320, 240 x 280 pixels.
The plugin can be configured to show predefined text, a reservation for up to 24 lines is made, but only the lines that can fit on-screen will be shown, or via commands, sent via http or from rules, text or graphical elements like lines, rectangles, circles, pixels, etc., can be shown.
@@ -146,6 +147,8 @@ Available options:
* *ST7735 135 x 240px*: Added to support a revision of the TTGO T-Display 16MB Flash module, that won't work with the ST7789 driver, the seller is claiming to use, but does work with this specially crafted ST7735 driver.
* *ST7735 172 x 320px*: Added to support an ESP32-C6 module having a display with this specific resolution.
* *ST77xx 170 x 320px*: Added to support ST7789v3 / ST7735 displays with this specific resolution.
* *ST77xx 240 x 320px*: Added to support ST7789v3 / ST7735 displays with this specific resolution.
* *ST77xx 240 x 280px*: Added to support ST7789v3 / ST7735 displays with this specific resolution.
* *ST7789 240 x 320px*: Allows 32 lines of text in the smallest font scaling setting. Predefined text only goes to 24, extra lines can be displayed from rules or external commands.
* *ST7789 240 x 240px*: Allows 24 lines of text in the smallest font scaling setting.
* *ST7789 240 x 280px*: Allows 28 lines of text in the smallest font scaling setting. Predefined text only goes to 24, extra lines can be displayed from rules or external commands.
+136
View File
@@ -30,6 +30,17 @@ This enables the implementation of yet unsupported I2C devices or use I2C device
.. warning:: This plugin is in the 'pro' category of plugins (i.o.w. not really *Easy* to use), and requires in-depth studying of the datasheet for the device, extracting the required commands and calculation(s) for implementing correct usage. (Some examples available below)
Example device configurations
-----------------------------
* :ref:`aht2x-temperature-humidity-sensor`
* :ref:`m5stack-ain4-20ma-unit-module`
* :ref:`bosch-bmp58x-temp-baro`
* :ref:`tiny-code-reader-qr-code-reader`
* :ref:`sensirion-sdp-810-differential-pressure-sensor`
* :ref:`tf-luna-lidar-distance-sensor`
* :ref:`qmc6310-3-axis-magnetic-sensor`
Configuration
-------------
@@ -189,6 +200,8 @@ A few warnings though:
Example I2C command sequences
-----------------------------
.. _aht2x-temperature-humidity-sensor:
AHT2x Temperature / Humidity sensor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -231,6 +244,8 @@ Command sequence explanation:
|
.. _m5stack-ain4-20ma-unit-module:
M5Stack AIN4-20mA Unit / Module
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -277,6 +292,8 @@ This device supports adjusting the calibration to the current current that is fl
|
.. _bosch-bmp58x-temp-baro:
Bosch BMP58x Temp/Baro
^^^^^^^^^^^^^^^^^^^^^^
@@ -341,6 +358,8 @@ Command sequence explanation:
|
.. _tiny-code-reader-qr-code-reader:
Tiny Code Reader (QR-code reader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -409,6 +428,8 @@ This device needs a Rule to handle the result, as we can't store string values i
|
.. _sensirion-sdp-810-differential-pressure-sensor:
Sensirion SDP-810 Differential pressure sensor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -472,12 +493,127 @@ This command sequence is nearly the same as with the Continuous measurement, exc
|
.. _tf-luna-lidar-distance-sensor:
TF-Luna Lidar distance sensor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The somewhat popular laser-distance sensor, with a range of 0.2 to 8 meter, TF-Luna, can be configured to use I2C as the communication protocol, instead of the default RS232 serial protocol, by connecting pin 5 of the sensor to GND on startup.
The command sequence is based on documentation from this `WaveShare page <https://www.waveshare.com/wiki/TF-Luna_LiDAR_Range_Sensor>`_
.. note:: The checksum available from the sensor measurements is ignored!
When only retrieving the ``distance`` from the sensor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The plugin should be configured with these settings:
* **I2C Address (Hex)**: ``0x10``
* **Output Data Type**: ``Single``
* **Interval**: can be set to 1 second to retrieve a measurement every second.
* **Values**: the name can be changed to Distance, and the number of decimals 0. Stats can be enabled, as desired. The Unit of Measure should he set to ``cm``, and the Value Type to ``Distance``
* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``distance``, so the I2C Command sequence is cached for much improved execution-performance.
* **I2C Commands 1**:
``put.u8.0;delay.5;get.b.7;eval;calc.0x{substring:4:6:%h%}*256+0x{substring:2:4:%h%}``
Command sequence explanation:
* ``put.u8.0`` : Announce data fetch
* ``delay.5`` : Give the sensor a few msec to prepare
* ``get.b.7`` : Read 7 bytes (entire available buffer)
* ``eval`` : Make data available for processing
* ``calc.0x{substring:4:6:%h%}*256+0x{substring:2:4:%h%}`` : Fetch byte 1 (* 256) + byte 0 to calculate distance in cm, value is set to Values 1 field
When retrieving both ``distance`` and ``signal strength`` from the sensor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The plugin should be configured with these settings:
* **I2C Address (Hex)**: ``0x10``
* **Output Data Type**: ``Dual``
* **Interval**: can be set to 1 second to retrieve a measurement every second.
* **Values**: the first name can be changed to ``Distance``, and the number of decimals 0. Stats can be enabled, as desired. The Unit of Measure should he set to ``cm``, and the Value Type to ``Distance``, the second name can be changed to f.e. ``SignalStrength``, and number of decimals to 0. Stats can be enabled, as desired. No further settings for this value, as it has an undefined unit and value type.
* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``distance``, so the I2C Command sequence is cached for much improved execution-performance.
* **I2C Commands 1**:
``put.u8.0;delay.5;get.b.7;eval;calc.0x{substring:4:6:%h%}*256+0x{substring:2:4:%h%};value.1;calc.0x{substring:8:10:%h%}*256+0x{substring:6:8:%h%};value.2``
NB: The fields for **Cache-Name 2** and **I2C Commands 2** are left empty, the entire command sequence is combined into the first command sequence, as the complete data set is read and the separate values calculated and assigned in a single command sequence. This makes processing more efficient.
Command sequence explanation:
* ``put.u8.0`` : Announce data fetch
* ``delay.5`` : Give the sensor a few msec to prepare
* ``get.b.7`` : Read 7 bytes (entire available buffer)
* ``eval`` : Make data available for processing
* ``calc.0x{substring:4:6:%h%}*256+0x{substring:2:4:%h%}`` : Fetch byte 1 (* 256) + byte 0 to calculate distance in cm
* ``value.1`` : current value, Distance, set to Values 1 field
* ``calc.0x{substring:8:10:%h%}*256+0x{substring:6:8:%h%}`` : Fetch byte 3 (* 256) + byte 2 to calculate signal strength (unknown unit)
* ``value.2`` : current value, Signal strength, set to Values 2 field
|
.. _qmc6310-3-axis-magnetic-sensor:
QMC6310 3-axis magnetic sensor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This sensor provides a 3-axis directional signal, as documented in the QST Corp `QMC6310 Datasheet <https://www.qstcorp.com/upload/pdf/202202/%EF%BC%88%E5%B7%B2%E4%BC%A0%EF%BC%8913-52-17%20QMC6310%20Datasheet%20Rev.C(1).pdf>`_ (url includes some Chinese characters).
The plugin should be configured with these settings:
* **I2C Address (Hex)**: ``0x1C``
* **Output Data Type**: ``Triple`` To activate this setting, the page must be submitted to show the extra input fields.
* **Interval**: Can be set in the seconds range to retrieve a measurement often.
* **Values**: The names can be changed to ``x``, ``y`` and ``z``, and the number of decimals to 0. Stats can be enabled, as desired. The Unit of Measure is undocumented.
* **I2C Init Commands** sequence for initializing the sensor:
``write.u8.0x29.0x06;write.u8.0x0B.0x00;write.u8.0x0A.0xCD``: Initialize the sensor according to the datasheet, Normal mode, field range 8 Gauss, output data rate 200 Hz, over-sample ratio 8, down-sample ratio 8.
* **I2C Exit Commands** sequence for shutting down the sensor:
``write.u8.0x0A.0x00``: Set sensor in Suspend mode.
* **Cache-Name 1 (optional)**: Fill with a useable name, f.e. ``x``, so the I2C Command sequence is cached for much improved execution-performance.
* **I2C Commands 1**: ``read.16le.0x01`` Read 2 bytes starting at register 1, the ``x`` value, and store in first Value field.
* **Cache-Name 2 (optional)**: Fill with a useable name, f.e. ``y``.
* **I2C Commands 2**: ``read.16le.0x03`` Read 2 bytes starting at register 3, the ``y`` value, and store in second Value field.
* **Cache-Name 3 (optional)**: Fill with a useable name, f.e. ``z``.
* **I2C Commands 3**: ``read.16le.0x05`` Read 2 bytes starting at register 5, the ``z`` value, and store in third Value field.
To reduce the logging content, **Single event with all values** can be enabled, to generate a single event ``<task-name>#All`` with all values as argument, and thus reduce the logging from 3 lines per Interval to a single line per Interval.
|
Change log
----------
.. versionchanged:: 2.0
...
|added| 2025-12-08 Add index to example configurations.
|added|
2025-04-19 Initial release version.
+10 -6
View File
@@ -93,15 +93,19 @@ Enabling "Stats" on a task value also extends how task values can be addressed w
For example using just like normal task value data:
* ``[bme#temp.avg]`` Compute the average over the last N samples in the historic buffer (typically: 64 samples on ESP32, 16 on ESP8266)
* ``[bme#temp.avg]`` Compute the average over the last N samples in the historic buffer (typically: 250 samples on ESP32, 16 on ESP8266)
* ``[bme#temp.avgX]`` Compute the average over the last X samples (or less if there are less samples available)
* ``[bme#temp.stddev]`` Compute the standard deviation over the last N samples in the historic buffer (typically: 64 samples on ESP32, 16 on ESP8266)
* ``[bme#temp.stddev]`` Compute the standard deviation over the last N samples in the historic buffer (typically: 250 samples on ESP32, 16 on ESP8266)
* ``[bme#temp.stddevX]`` Compute the standard deviation over the last X samples (or less if there are less samples available)
* ``[bme#temp.max]`` Refer to the maximum recorded sample since the last ``resetpeaks``. N.B. Not all tasks log the min and max peaks.
* ``[bme#temp.min]`` See ``[bme#temp.max]``
* ``[bme#temp.max]`` Refer to the maximum recorded sample in available samples (rolling maximum)
* ``[bme#temp.maxX]`` Refer to the maximum recorded sample in the last X samples (or less if there are less samples available)
* ``[bme#temp.maxp]`` (max-peak) Refer to the maximum recorded sample since the last ``resetpeaks``. N.B. Not all tasks log the min and max peaks.
* ``[bme#temp.min]`` Refer to the minimum recorded sample in available samples (rolling minimum)
* ``[bme#temp.minX]`` Refer to the minimum recorded sample in the last X samples (or less if there are less samples available)
* ``[bme#temp.minp]`` (min-peak) See ``[bme#temp.maxp]``.
* ``[bme#temp.size]`` Return the number of samples in memory.
* ``[bme#temp.sample]`` Access the last sample in memory.
* ``[bme#temp.sampleN]`` Access the N-th last sample in memory.
* ``[bme#temp.sample]`` Return the number of samples in memory. (Doc. reflects the actual code!)
* ``[bme#temp.sampleN]`` Access the N-th last sample in memory, negative value accesses N-th value from the *oldest* available sample.
Commands on "Stats" data:
@@ -56,9 +56,9 @@
.. |P003_compileinfo| replace:: `.`
.. |P003_usedlibraries| replace:: `.`
.. |P004_name| replace:: :cyan:`1-Wire Temperature`
.. |P004_name| replace:: :cyan:`DS18xxx/MAX31xxx/1-Wire Temperature`
.. |P004_type| replace:: :cyan:`Environment`
.. |P004_typename| replace:: :cyan:`Environment - 1-Wire Temperature`
.. |P004_typename| replace:: :cyan:`Environment - DS18xxx/MAX31xxx/1-Wire Temperature`
.. |P004_porttype| replace:: `1-Wire`
.. |P004_status| replace:: :green:`NORMAL` :yellow:`CLIMATE`
.. |P004_github| replace:: P004_Dallas.ino
@@ -93,7 +93,7 @@
.. |P087_type| replace:: :cyan:`Communication`
.. |P087_typename| replace:: :cyan:`Communication - SerialProxy`
.. |P087_porttype| replace:: `Serial`
.. |P087_status| replace:: :yellow:`COLLECTION C`
.. |P087_status| replace:: :yellow:`COLLECTION C` :yellow:`ENERGY`
.. |P087_github| replace:: P087_SerialProxy.ino
.. _P087_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P087_SerialProxy.ino
.. |P087_usedby| replace:: `.`
+6
View File
@@ -365,6 +365,12 @@ The conversion always outputs a string, but not all of these can be converted ba
* - mm to imperial: ``%c_mm2imp%(1900)``
- mm to imperial: ``6'2.8"``
- Millimeter to imperial units
* - Degrees to radians: ``%c_d2r%(22)``
- Degrees to radians: ``0.38``
- Degrees to radians
* - Radians to degrees: ``%c_r2d%(0.357)``
- Radians to degrees: ``20.45``
- Radians to degrees
* - Mins to days: ``%c_m2day%(1900)``
- Mins to days: ``1.32``
- Minutes expressed in days
+5 -1
View File
@@ -1587,9 +1587,11 @@ Basic Math Functions
* ``round(x)`` Rounds to the nearest integer, but rounds halfway cases away from zero (instead of to the nearest even integer).
* ``^`` The caret is used as the exponentiation operator for calculating the value of x to the power of y (x\ :sup:`y`).
* ``map(value:fromLow:fromHigh:toLow:toHigh)`` Maps value x in the fromLow/fromHigh range to toLow/toHigh values. Similar to the Arduino map() function. See examples below. (Using a colon as an argument separator to not interfere with regular argument processing)
* ``map(value:fromLow:fromHigh:toLow:toHigh)`` Maps ``value`` in the fromLow/fromHigh range to toLow/toHigh values. Similar to the Arduino map() function. See examples below. (Using a colon as an argument separator to not interfere with regular argument processing)
* ``mapc(value:fromLow:fromHigh:toLow:toHigh)`` same as map, but constrains the result to the fromLow/fromHigh range.
* ``fmod(x:y)`` Like the modulo operator ``%`` that returns an integer remainder, ``fmod`` returns the floating-point remainder of the division ``x / y``. Added: 2025-12-13 (Not available in limited builds)
Rules example:
@@ -1662,6 +1664,7 @@ Radian Angle:
* ``aSin(x)`` Arc Sine of x (radian)
* ``aCos(x)`` Arc Cosine of x (radian)
* ``aTan(x)`` Arc Tangent of x (radian)
* ``aTan2(x:y)`` Arc Tangent of x / y (radian) Added: 2025-12-13
Degree Angle:
@@ -1671,6 +1674,7 @@ Degree Angle:
* ``aSin_d(x)`` Arc Sine of x (degree)
* ``aCos_d(x)`` Arc Cosine of x (degree)
* ``aTan_d(x)`` Arc Tangent of x (degree)
* ``aTan2_d(x:y)`` Arc Tangent of x / y (degree) Added: 2025-12-13
+1 -1
View File
@@ -21,7 +21,7 @@ import sphinx_bootstrap_theme
# -- Project information -----------------------------------------------------
project = u'ESP Easy'
copyright = u'2018-2025, ESP Easy'
copyright = u'2018-2026, ESP Easy'
author = u'Grovkillen, TD-er & Friends'
# The short X.Y version
+74 -4
View File
@@ -206,6 +206,22 @@ static const uint8_t PROGMEM
ST77XX_RASET, 4, // 2: Row addr set, 4 args, no delay:
0x00, 0x00, // XSTART = 0
320 >> 8, 320 & 0xFF }, // XEND = 320
Rcmd2black240x320[] = { // 7735R init, part 2 (mini 240x320)
2, // 2 commands in list:
ST77XX_CASET, 4, // 1: Column addr set, 4 args, no delay:
0x00, 0x00, // XSTART = 0
0x00, 240, // XEND = 240
ST77XX_RASET, 4, // 2: Row addr set, 4 args, no delay:
0x00, 0x00, // XSTART = 0
320 >> 8, 320 & 0xFF }, // XEND = 320
Rcmd2black240x280[] = { // 7735R init, part 2 (mini 240x280)
2, // 2 commands in list:
ST77XX_CASET, 4, // 1: Column addr set, 4 args, no delay:
0x00, 0x00, // XSTART = 0
0x00, 240, // XEND = 240
ST77XX_RASET, 4, // 2: Row addr set, 4 args, no delay:
0x00, 0x00, // XSTART = 0
280 >> 8, 280 & 0xFF }, // XEND = 240
#endif // if ST7735_EXTRA_INIT
Rcmd3[] = { // 7735R init, part 3 (red or green tab)
@@ -292,6 +308,20 @@ void Adafruit_ST7735::initR(uint8_t options) {
const uint8_t data = 0x00;
sendCommand(ST77XX_INVON, &data, 0);
sendCommand(ST77XX_INVON, &data, 0); // Write twice...
} else if (options == INITR_BLACKTAB240x320) {
_height = ST7735_TFTHEIGHT_320;
_width = ST7735_TFTWIDTH_240;
displayInit(Rcmd2black240x320);
const uint8_t data = 0x00;
sendCommand(ST77XX_INVON, &data, 0);
sendCommand(ST77XX_INVON, &data, 0); // Write twice...
} else if (options == INITR_BLACKTAB240x280) {
_height = ST7735_TFTHEIGHT_280;
_width = ST7735_TFTWIDTH_240;
displayInit(Rcmd2black240x280);
const uint8_t data = 0x00;
sendCommand(ST77XX_INVON, &data, 0);
sendCommand(ST77XX_INVON, &data, 0); // Write twice...
#endif // if ST7735_EXTRA_INIT
} else {
// colstart, rowstart left at default '0' values
@@ -339,7 +369,7 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
if ((tabcolor == INITR_BLACKTAB) || (tabcolor == INITR_MINI160x80)) {
madctl = ST77XX_MADCTL_MX | ST77XX_MADCTL_MY | ST77XX_MADCTL_RGB;
#if ST7735_EXTRA_INIT
} else if ((tabcolor == INITR_BLACKTAB135x240) || (tabcolor == INITR_BLACKTAB172x320) || (tabcolor == INITR_BLACKTAB170x320)) {
} else if ((tabcolor == INITR_BLACKTAB135x240) || (tabcolor == INITR_BLACKTAB172x320) || (tabcolor == INITR_BLACKTAB170x320) || (tabcolor == INITR_BLACKTAB240x320) || (tabcolor == INITR_BLACKTAB240x280)) {
madctl = ST77XX_MADCTL_MY | ST77XX_MADCTL_MV | ST77XX_MADCTL_RGB;
#endif // if ST7735_EXTRA_INIT
} else {
@@ -368,6 +398,16 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
_width = ST7735_TFTWIDTH_170;
_colstart = 35;
_rowstart = 0;
} else if (tabcolor == INITR_BLACKTAB240x320) {
_height = ST7735_TFTHEIGHT_320;
_width = ST7735_TFTWIDTH_240;
_colstart = 0;
_rowstart = 0;
} else if (tabcolor == INITR_BLACKTAB240x280) {
_height = ST7735_TFTHEIGHT_280;
_width = ST7735_TFTWIDTH_240;
_colstart = 0;
_rowstart = 20;
#endif // if ST7735_EXTRA_INIT
} else {
_height = ST7735_TFTHEIGHT_160;
@@ -380,7 +420,7 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
if ((tabcolor == INITR_BLACKTAB) || (tabcolor == INITR_MINI160x80)) {
madctl = ST77XX_MADCTL_MY | ST77XX_MADCTL_MV | ST77XX_MADCTL_RGB;
#if ST7735_EXTRA_INIT
} else if ((tabcolor == INITR_BLACKTAB135x240) || (tabcolor == INITR_BLACKTAB172x320) || (tabcolor == INITR_BLACKTAB170x320)) {
} else if ((tabcolor == INITR_BLACKTAB135x240) || (tabcolor == INITR_BLACKTAB172x320) || (tabcolor == INITR_BLACKTAB170x320) || (tabcolor == INITR_BLACKTAB240x320) || (tabcolor == INITR_BLACKTAB240x280)) {
madctl = ST77XX_MADCTL_MX | ST77XX_MADCTL_MY | ST77XX_MADCTL_RGB;
#endif // if ST7735_EXTRA_INIT
} else {
@@ -409,6 +449,16 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
_height = ST7735_TFTWIDTH_170;
_colstart = 35;
_rowstart = 0;
} else if (tabcolor == INITR_BLACKTAB240x320) {
_width = ST7735_TFTHEIGHT_320;
_height = ST7735_TFTWIDTH_240;
_colstart = 0;
_rowstart = 0;
} else if (tabcolor == INITR_BLACKTAB240x280) {
_width = ST7735_TFTHEIGHT_280;
_height = ST7735_TFTWIDTH_240;
_colstart = 0;
_rowstart = 20;
#endif // if ST7735_EXTRA_INIT
} else {
_width = ST7735_TFTHEIGHT_160;
@@ -421,7 +471,7 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
if ((tabcolor == INITR_BLACKTAB) || (tabcolor == INITR_MINI160x80)) {
madctl = ST77XX_MADCTL_RGB;
#if ST7735_EXTRA_INIT
} else if ((tabcolor == INITR_BLACKTAB135x240) || (tabcolor == INITR_BLACKTAB172x320) || (tabcolor == INITR_BLACKTAB170x320)) {
} else if ((tabcolor == INITR_BLACKTAB135x240) || (tabcolor == INITR_BLACKTAB172x320) || (tabcolor == INITR_BLACKTAB170x320) || (tabcolor == INITR_BLACKTAB240x320) || (tabcolor == INITR_BLACKTAB240x280)) {
madctl = ST77XX_MADCTL_MX | ST77XX_MADCTL_MV | ST77XX_MADCTL_RGB;
#endif // if ST7735_EXTRA_INIT
} else {
@@ -450,6 +500,16 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
_width = ST7735_TFTWIDTH_170;
_colstart = 35;
_rowstart = 0;
} else if (tabcolor == INITR_BLACKTAB240x320) {
_height = ST7735_TFTHEIGHT_320;
_width = ST7735_TFTWIDTH_240;
_colstart = 0;
_rowstart = 0;
} else if (tabcolor == INITR_BLACKTAB240x280) {
_height = ST7735_TFTHEIGHT_280;
_width = ST7735_TFTWIDTH_240;
_colstart = 0;
_rowstart = 20;
#endif // if ST7735_EXTRA_INIT
} else {
_height = ST7735_TFTHEIGHT_160;
@@ -462,7 +522,7 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
if ((tabcolor == INITR_BLACKTAB) || (tabcolor == INITR_MINI160x80)) {
madctl = ST77XX_MADCTL_MX | ST77XX_MADCTL_MV | ST77XX_MADCTL_RGB;
#if ST7735_EXTRA_INIT
} else if ((tabcolor == INITR_BLACKTAB135x240) || (tabcolor == INITR_BLACKTAB172x320) || (tabcolor == INITR_BLACKTAB170x320)) {
} else if ((tabcolor == INITR_BLACKTAB135x240) || (tabcolor == INITR_BLACKTAB172x320) || (tabcolor == INITR_BLACKTAB170x320) || (tabcolor == INITR_BLACKTAB240x320) || (tabcolor == INITR_BLACKTAB240x280)) {
madctl = ST77XX_MADCTL_RGB;
#endif // if ST7735_EXTRA_INIT
} else {
@@ -491,6 +551,16 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
_height = ST7735_TFTWIDTH_170;
_colstart = 35;
_rowstart = 0;
} else if (tabcolor == INITR_BLACKTAB240x320) {
_width = ST7735_TFTHEIGHT_320;
_height = ST7735_TFTWIDTH_240;
_colstart = 0;
_rowstart = 0;
} else if (tabcolor == INITR_BLACKTAB240x280) {
_width = ST7735_TFTHEIGHT_280;
_height = ST7735_TFTWIDTH_240;
_colstart = 0;
_rowstart = 20;
#endif // if ST7735_EXTRA_INIT
} else {
_width = ST7735_TFTHEIGHT_160;
+2
View File
@@ -33,6 +33,8 @@
#define INITR_BLACKTAB135x240 0x07
#define INITR_BLACKTAB172x320 0x08
#define INITR_BLACKTAB170x320 0x09
#define INITR_BLACKTAB240x320 0x0A
#define INITR_BLACKTAB240x280 0x0B
// Some register settings
#define ST7735_MADCTL_BGR 0x08
+2
View File
@@ -36,9 +36,11 @@
#define ST7735_TFTWIDTH_135 135
#define ST7735_TFTWIDTH_172 172
#define ST7735_TFTWIDTH_170 170
#define ST7735_TFTWIDTH_240 240
#define ST7735_TFTHEIGHT_128 128 // for 1.44" display
#define ST7735_TFTHEIGHT_160 160 // for 1.8" and mini display
#define ST7735_TFTHEIGHT_240 240
#define ST7735_TFTHEIGHT_280 280
#define ST7735_TFTHEIGHT_320 320
#define ST_CMD_DELAY 0x80 // special signifier for command lists
+1 -1
View File
@@ -24,7 +24,7 @@
# define PLUGIN_004
# define PLUGIN_ID_004 4
# define PLUGIN_NAME_004 "Environment - 1-Wire Temperature"
# define PLUGIN_NAME_004 "Environment - DS18xxx/MAX31xxx/1-Wire Temperature"
# define PLUGIN_VALUENAME1_004 "Temperature"
# define P004_ERROR_NAN 0
+37 -22
View File
@@ -11,6 +11,8 @@
/**
* Changelog:
* 2025-12-22 tonhuisman: Add support for receiving binary data, fixed length receive and sending events with hex data
* Moved most #define variables to P087_data_struct.h
* 2025-01-12 tonhuisman: Add support for MQTT AutoDiscovery (not supported for Serial Proxy)
* 2024-02-27 tonhuisman: Always process the regular expression like 'Global Match' to enable retrieving the available values
* 2024-02-26 tonhuisman: Apply log-string and other code optimizations
@@ -38,19 +40,6 @@
# define PLUGIN_NAME_087 "Communication - Serial Proxy"
# define P087_BAUDRATE PCONFIG_LONG(0)
# define P087_BAUDRATE_LABEL PCONFIG_LABEL(0)
# define P087_SERIAL_CONFIG PCONFIG_LONG(1)
# define P087_QUERY_VALUE 0 // Temp placement holder until we know what selectors are needed.
# define P087_NR_OUTPUT_OPTIONS 1
# define P087_NR_OUTPUT_VALUES 1
# define P087_QUERY1_CONFIG_POS 3
# define P087_DEFAULT_BAUDRATE 38400
// Plugin settings:
// Validate:
// - [0..9]
@@ -168,6 +157,14 @@ boolean Plugin_087(uint8_t function, struct EventStruct *event, String& string)
addFormSubHeader(F("Statistics"));
P087_html_show_stats(event);
# ifndef LIMIT_BUILD_SIZE
addFormSubHeader(F("Data options"));
addFormCheckBox(F("Receive binary data"), P087_READ_BIN_LABEL, P087_CONFIG_GET_READ_BIN);
addFormNumericBox(F("Fixed length input data"), P087_FIXED_LENGTH_LABEL, P087_CONFIG_GET_FIXED_LENGTH, 0, 255);
addUnit(F("0 = off, max. 255"));
addFormCheckBox(F("Event with hex. data (no prefix)"), P087_EVENT_HEX_LABEL, P087_CONFIG_GET_EVENT_HEX);
# endif // ifndef LIMIT_BUILD_SIZE
success = true;
break;
}
@@ -175,6 +172,11 @@ boolean Plugin_087(uint8_t function, struct EventStruct *event, String& string)
case PLUGIN_WEBFORM_SAVE: {
P087_BAUDRATE = getFormItemInt(P087_BAUDRATE_LABEL);
P087_SERIAL_CONFIG = serialHelper_serialconfig_webformSave();
# ifndef LIMIT_BUILD_SIZE
P087_CONFIG_SET_READ_BIN(isFormItemChecked(P087_READ_BIN_LABEL));
P087_CONFIG_SET_FIXED_LENGTH(getFormItemInt(P087_FIXED_LENGTH_LABEL));
P087_CONFIG_SET_EVENT_HEX(isFormItemChecked(P087_EVENT_HEX_LABEL));
# endif // ifndef LIMIT_BUILD_SIZE
P087_data_struct *P087_data =
static_cast<P087_data_struct *>(getPluginTaskData(event->TaskIndex));
@@ -207,6 +209,15 @@ boolean Plugin_087(uint8_t function, struct EventStruct *event, String& string)
if (P087_data->init(port, serial_rx, serial_tx, P087_BAUDRATE, static_cast<uint8_t>(P087_SERIAL_CONFIG))) {
LoadCustomTaskSettings(event->TaskIndex, P087_data->_lines, P87_Nlines, 0);
P087_data->post_init();
# ifndef LIMIT_BUILD_SIZE
P087_data->setHandleBinary(P087_CONFIG_GET_READ_BIN);
P087_data->setEventAsHex(P087_CONFIG_GET_EVENT_HEX);
if (P087_CONFIG_GET_FIXED_LENGTH > 0) {
P087_data->setMaxLength(P087_CONFIG_GET_FIXED_LENGTH);
}
P087_data->setFixedLength(P087_CONFIG_GET_FIXED_LENGTH);
# endif // ifndef LIMIT_BUILD_SIZE
success = true;
serialHelper_log_GpioDescription(port, serial_rx, serial_tx);
} else {
@@ -216,17 +227,15 @@ boolean Plugin_087(uint8_t function, struct EventStruct *event, String& string)
}
case PLUGIN_FIFTY_PER_SECOND: {
if (Settings.TaskDeviceEnabled[event->TaskIndex]) {
P087_data_struct *P087_data =
static_cast<P087_data_struct *>(getPluginTaskData(event->TaskIndex));
P087_data_struct *P087_data =
static_cast<P087_data_struct *>(getPluginTaskData(event->TaskIndex));
if ((nullptr != P087_data) && P087_data->loop()) {
Scheduler.schedule_task_device_timer(event->TaskIndex, millis() + 10);
delay(0); // Processing a full sentence may take a while, run some
// background tasks.
}
success = true;
if ((nullptr != P087_data) && P087_data->loop()) {
Scheduler.schedule_task_device_timer(event->TaskIndex, millis() + 10);
delay(0); // Processing a full sentence may take a while, run some
// background tasks.
}
success = true;
break;
}
@@ -237,6 +246,12 @@ boolean Plugin_087(uint8_t function, struct EventStruct *event, String& string)
if ((nullptr != P087_data) && P087_data->getSentence(event->String2)) {
if (Plugin_087_match_all(event->TaskIndex, event->String2)) {
// sendData(event);
# ifndef LIMIT_BUILD_SIZE
if (P087_data->isEventAsHex() && !event->String2.isEmpty()) { // Convert to hex without prefix
event->String2 = formatToHex_array(reinterpret_cast<const uint8_t *>(&event->String2[0]), event->String2.length());
}
# endif // ifndef LIMIT_BUILD_SIZE
# ifndef BUILD_NO_DEBUG
addLog(LOG_LEVEL_DEBUG, event->String2);
# endif // ifndef BUILD_NO_DEBUG
+10 -4
View File
@@ -152,6 +152,8 @@ boolean Plugin_116(uint8_t function, struct EventStruct *event, String& string)
ST77xx_type_toString(ST77xx_type_e::ST7735s_135x240),
ST77xx_type_toString(ST77xx_type_e::ST7735s_172x320),
ST77xx_type_toString(ST77xx_type_e::ST77xxs_170x320),
ST77xx_type_toString(ST77xx_type_e::ST77xxs_240x320),
ST77xx_type_toString(ST77xx_type_e::ST77xxs_240x280),
# endif // if P116_EXTRA_ST7735
ST77xx_type_toString(ST77xx_type_e::ST7789vw_240x320),
ST77xx_type_toString(ST77xx_type_e::ST7789vw_240x240),
@@ -173,6 +175,8 @@ boolean Plugin_116(uint8_t function, struct EventStruct *event, String& string)
static_cast<int>(ST77xx_type_e::ST7735s_135x240),
static_cast<int>(ST77xx_type_e::ST7735s_172x320),
static_cast<int>(ST77xx_type_e::ST77xxs_170x320),
static_cast<int>(ST77xx_type_e::ST77xxs_240x320),
static_cast<int>(ST77xx_type_e::ST77xxs_240x280),
# endif // if P116_EXTRA_ST7735
static_cast<int>(ST77xx_type_e::ST7789vw_240x320),
static_cast<int>(ST77xx_type_e::ST7789vw_240x240),
@@ -277,16 +281,18 @@ boolean Plugin_116(uint8_t function, struct EventStruct *event, String& string)
# endif // if ADAGFX_FONTS_INCLUDED
uint32_t lSettings = 0;
uint16_t _type = getFormItemInt(F("type"));
bitWrite(lSettings, P116_CONFIG_FLAG_NO_WAKE, !isFormItemChecked(F("NoDisplay"))); // Bit 0 NoDisplayOnReceivingText,
// reverse logic, default=checked!
bitWrite(lSettings, P116_CONFIG_FLAG_INVERT_BUTTON, isFormItemChecked(F("buttonInverse"))); // Bit 1 buttonInverse
bitWrite(lSettings, P116_CONFIG_FLAG_CLEAR_ON_EXIT, isFormItemChecked(F("clearOnExit"))); // Bit 2 ClearOnExit
bitWrite(lSettings, P116_CONFIG_FLAG_USE_COL_ROW, isFormItemChecked(F("colrow"))); // Bit 3 Col/Row addressing
set4BitToUL(lSettings, P116_CONFIG_FLAG_MODE, getFormItemInt(F("mode"))); // Bit 4..7 Text print mode
set4BitToUL(lSettings, P116_CONFIG_FLAG_ROTATION, getFormItemInt(F("rotate"))); // Bit 8..11 Rotation
set4BitToUL(lSettings, P116_CONFIG_FLAG_FONTSCALE, getFormItemInt(F("fontscale"))); // Bit 12..15 Font scale
set4BitToUL(lSettings, P116_CONFIG_FLAG_TYPE, getFormItemInt(F("type"))); // Bit 16..19 Hardwaretype
set4BitToUL(lSettings, P116_CONFIG_FLAG_MODE, getFormItemInt(F("mode"))); // Bit 4..7 Text print mode
set4BitToUL(lSettings, P116_CONFIG_FLAG_ROTATION, getFormItemInt(F("rotate"))); // Bit 8..11 Rotation
set4BitToUL(lSettings, P116_CONFIG_FLAG_FONTSCALE, getFormItemInt(F("fontscale"))); // Bit 12..15 Font scale
set4BitToUL(lSettings, P116_CONFIG_FLAG_TYPE, _type); // Bit 16..19 Hardwaretype
set2BitToUL(lSettings, P116_CONFIG_FLAG_TYPE2, (_type >> 4)); // Bit 29..30 Hardwaretype extension
set4BitToUL(lSettings, P116_CONFIG_FLAG_CMD_TRIGGER, getFormItemInt(F("commandtrigger"))); // Bit 20..23 Command trigger
bitWrite(lSettings, P116_CONFIG_FLAG_BACK_FILL, !isFormItemChecked(F("backfill"))); // Bit 28 Back fill text (inv)
+3
View File
@@ -6,6 +6,7 @@
// #######################################################################################################
/** Changelog:
* 2025-12-06 tonhuisman: Enable CustomVTypeVar and MQTTStateClass device options, as any type of sensor can be connected
* 2025-06-04 tonhuisman: Add [<taskname>#log] to Get Config to fetch the current Parsing and execution log setting
* 2025-06-03 tonhuisman: Restore PLUGIN_GET_CONFIG_VALUE support, to allow I2C operations to be executed and return a value without
* defining extra I2C Command definitions. Not available for LIMIT_BUILD_SIZE builds
@@ -135,6 +136,8 @@ boolean Plugin_180(uint8_t function, struct EventStruct *event, String& string)
dev.TimerOptional = true;
dev.FormulaOption = true;
dev.PluginStats = true;
dev.CustomVTypeVar = true;
dev.MqttStateClass = true;
break;
}
-2
View File
@@ -244,13 +244,11 @@ String Command_GetORSetFloatMinMax(struct EventStruct *event,
float _min,
float _max)
{
bool hasArgument = false;
{
// Check if command is valid. Leave in separate scope to delete the TmpStr1
String TmpStr1;
if (GetArgv(Line, TmpStr1, arg + 1)) {
hasArgument = true;
TmpStr1.toLowerCase();
float tmp_float{};
+3
View File
@@ -1851,6 +1851,9 @@ To create/register a plugin, you have to :
#ifndef USES_P085
#define USES_P085 // AcuDC24x
#endif
#if !defined(USES_P087) && defined(ESP32)
#define USES_P087 // SerialProxy
#endif
#ifndef USES_P089
#define USES_P089 // Ping
#endif
+11 -5
View File
@@ -369,21 +369,27 @@ bool PluginStats::plugin_get_config_value_base(struct EventStruct *event, String
break;
case 'm':
if (matchedCommand(command, F("min"), nrSamples)) {
if (equals(command, F("minp"))) { // [taskname#valuename.minp] Lowest value seen since value reset
value = getPeakLow();
success = true;
} else if (matchedCommand(command, F("min"), nrSamples)) {
success = nrSamples != 0;
if (nrSamples < 0) { // [taskname#valuename.min] Lowest value seen since value reset
value = getPeakLow();
if (nrSamples < 0) { // [taskname#valuename.min] Lowest value of all recent samples
value = getSampleExtreme(getNrSamples(), false);
} else { // Check for "minN", where N is the number of most recent samples to use.
if (nrSamples > 0) {
value = getSampleExtreme(nrSamples, false);
}
}
} else if (equals(command, F("maxp"))) { // [taskname#valuename.maxp] Highest value seen since value reset
value = getPeakHigh();
success = true;
} else if (matchedCommand(command, F("max"), nrSamples)) {
success = nrSamples != 0;
if (nrSamples < 0) { // [taskname#valuename.max] Highest value seen since value reset
value = getPeakHigh();
if (nrSamples < 0) { // [taskname#valuename.max] Highest value of all recent samples
value = getSampleExtreme(getNrSamples(), true);
} else { // Check for "maxN", where N is the number of most recent samples to use.
if (nrSamples > 0) {
value = getSampleExtreme(nrSamples, true);
+6 -1
View File
@@ -1566,7 +1566,7 @@ bool AdafruitGFX_helper::processCommand(const String& string) {
break;
case adagfx_commands_e::tpm: // tpm: Text Print Mode
if ((argCount == 1) && ((nParams[0] < 0) || (nParams[0] >= static_cast<int>(AdaGFXTextPrintMode::MAX)))) {
if ((argCount == 1) && !((nParams[0] < 0) || (nParams[0] >= static_cast<int>(AdaGFXTextPrintMode::MAX)))) {
_textPrintMode = static_cast<AdaGFXTextPrintMode>(nParams[0]);
_display->setTextWrap(_textPrintMode == AdaGFXTextPrintMode::ContinueToNextLine);
success = true;
@@ -2636,6 +2636,11 @@ void AdafruitGFX_helper::printText(const char *string,
_display->getTextBounds(newString, _x, _y, &xText, &yText, &wText, &hText); // Calculate length
if ((hText < hChar1) && _columnRowMode) { // If the text-height is lower than the default height
yText -= (hChar1 - hText); // Subtract height-difference between A and current height
hText = hChar1; // Use default height
}
if ((maxWidth > 0) && ((_x - xOffset) + maxWidth <= res_x)) {
res_x = (_x - xOffset) + maxWidth;
_w = maxWidth;
+142 -15
View File
@@ -73,6 +73,15 @@ bool RulesCalculate_t::is_unary_operator(char c)
*/
}
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
// binary = 2-argument functions
bool RulesCalculate_t::is_binary_operator(char c)
{
return (c >= static_cast<char>(BinaryOperator::ArcTan2) &&
c <= static_cast<char>(BinaryOperator::FMod));
}
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
// quinary = 5-argument functions
bool RulesCalculate_t::is_quinary_operator(char c)
{
@@ -271,6 +280,33 @@ ESPEASY_RULES_FLOAT_TYPE RulesCalculate_t::apply_unary_operator(char op, ESPEASY
return ret;
}
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
ESPEASY_RULES_FLOAT_TYPE RulesCalculate_t::apply_binary_operator(char op, ESPEASY_RULES_FLOAT_TYPE first, ESPEASY_RULES_FLOAT_TYPE second)
{
ESPEASY_RULES_FLOAT_TYPE ret{};
const BinaryOperator bin_op = static_cast<BinaryOperator>(op);
const bool useDegree = angleDegree(bin_op);
switch (bin_op) {
case BinaryOperator::ArcTan2:
case BinaryOperator::ArcTan2_d:
#if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
ret = atan2(first, second);
#else
ret = atan2f(first, second);
#endif
return useDegree ? degrees(ret) : ret;
case BinaryOperator::FMod:
#if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
return fmod(first, second);
#else // if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
return fmodf(first, second);
#endif // if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
}
return ret;
}
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
ESPEASY_RULES_FLOAT_TYPE RulesCalculate_t::apply_quinary_operator(char op,
ESPEASY_RULES_FLOAT_TYPE first,
ESPEASY_RULES_FLOAT_TYPE second,
@@ -315,7 +351,7 @@ CalculateReturnCode RulesCalculate_t::RPNCalculate(char *token)
ESPEASY_RULES_FLOAT_TYPE first = pop();
ret = push(apply_operator(token[0], first, second));
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate operator %c: 1: %.2f 2: %.2f"), token[0], first, second));
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate operator %c: 1: %.4f 2: %.4f"), token[0], first, second));
// FIXME TD-er: Regardless whether it is an error, all code paths return ret;
// if (isError(ret)) { return ret; }
@@ -324,10 +360,20 @@ CalculateReturnCode RulesCalculate_t::RPNCalculate(char *token)
ESPEASY_RULES_FLOAT_TYPE first = pop();
ret = push(apply_unary_operator(token[0], first));
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate unary %d: 1: %.2f"), token[0], first));
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate unary %d: 1: %.4f"), token[0], first));
// FIXME TD-er: Regardless whether it is an error, all code paths return ret;
// if (isError(ret)) { return ret; }
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
} else if (is_binary_operator(token[0]) && (token[1] == 0))
{
const ESPEASY_RULES_FLOAT_TYPE second = pop();
const ESPEASY_RULES_FLOAT_TYPE first = pop();
ret = push(apply_binary_operator(token[0], first, second));
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate binary %d: 1: %.4f 2: %.4f"), token[0], first, second));
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
} else if (is_quinary_operator(token[0]) && (token[1] == 0))
{
ESPEASY_RULES_FLOAT_TYPE fifth = pop();
@@ -337,14 +383,14 @@ CalculateReturnCode RulesCalculate_t::RPNCalculate(char *token)
ESPEASY_RULES_FLOAT_TYPE first = pop();
ret = push(apply_quinary_operator(token[0], first, second, third, fourth, fifth));
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate quinary %d: 1: %.2f 2: %.2f 3: %.2f 4: %.2f 5: %.2f"), token[0], first, second, third, fourth, fifth));
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate quinary %d: 1: %.4f 2: %.4f 3: %.4f 4: %.4f 5: %.4f"), token[0], first, second, third, fourth, fifth));
} else {
// Fetch next if there is any
ESPEASY_RULES_FLOAT_TYPE value{};
if (validDoubleFromString(token, value)) {
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate push value: %.2f token: %s"), value, token));
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate push value: %.4f token: %s"), value, token));
// } else {
// addLog(LOG_LEVEL_INFO, strformat(F("RPNCalculate unknown token: %s"), token));
}
@@ -464,7 +510,11 @@ CalculateReturnCode RulesCalculate_t::doCalculate(const char *input, ESPEASY_RUL
}
// If the token is any operator, op1, then:
else if (is_operator(c) || is_unary_operator(c) || is_quinary_operator(c))
else if (is_operator(c) || is_unary_operator(c) ||
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
is_binary_operator(c) ||
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
is_quinary_operator(c))
{
*(TokenPos) = 0; // Mark end of token string
error = RPNCalculate(token);
@@ -540,15 +590,14 @@ CalculateReturnCode RulesCalculate_t::doCalculate(const char *input, ESPEASY_RUL
*(TokenPos) = 0; // Mark end of token string
// addLog(LOG_LEVEL_INFO, strformat(F("doCalculate popping stack sl: %u token: %s sc: %d"), sl, token, sc));
if (sc == '(') {
ESPEASY_RULES_FLOAT_TYPE first = pop(); // Get last value from stack
error = push(first); // push back
error = push(first); // Push as a result of ()
// addLog(LOG_LEVEL_INFO, strformat(F("doCalculate pop&push 2x last value: %.2f sl: %u"), first, sl));
// const auto first = pop(); // Get last value from stack
// push(first); // push back
// addLog(LOG_LEVEL_INFO, strformat(F("doCalculate at ( last value: %.4f sl: %u"), first, sl));
} else {
error = RPNCalculate(token);
// ESPEASY_RULES_FLOAT_TYPE first = pop(); // Get last value from stack
// error = push(first); // push back
// addLog(LOG_LEVEL_INFO, strformat(F("doCalculate last value on stack: %.2f sl: %u"), first, sl));
// const auto first = pop(); // Get last value from stack
// push(first); // push back
// addLog(LOG_LEVEL_INFO, strformat(F("doCalculate last value on stack: %.4f sl: %u"), first, sl));
}
TokenPos = token;
@@ -567,8 +616,18 @@ CalculateReturnCode RulesCalculate_t::doCalculate(const char *input, ESPEASY_RUL
pe = true;
if (sl > 1) {
sc = stack[sl - 2];
if (!(is_operator(sc) || is_unary_operator(sc) || is_quinary_operator(sc))) {
sc = '\0';
if (is_operator(sc)) { // Not a function call
// Don't touch
} else if (is_unary_operator(sc) ||
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
is_binary_operator(sc) ||
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
is_quinary_operator(sc)) { // Function call, so process the function too
*TokenPos = sc;
++TokenPos;
stack[sl - 2] = '\0'; // Don't process again on stack wind-down
} else {
sc = '\0'; // Reset
}
}
}
@@ -606,6 +665,7 @@ CalculateReturnCode RulesCalculate_t::doCalculate(const char *input, ESPEASY_RUL
++strpos;
}
// addLog(LOG_LEVEL_INFO, strformat(F("doCalculate final stack content 0x%s"), formatToHex_array(reinterpret_cast<const uint8_t*>(stack), sl + 1).c_str()));
// When there are no more tokens to read:
// While there are still operator tokens in the stack:
while (sl > 0)
@@ -617,8 +677,12 @@ CalculateReturnCode RulesCalculate_t::doCalculate(const char *input, ESPEASY_RUL
}
*(TokenPos) = 0; // Mark end of token string
// addLog(LOG_LEVEL_INFO, strformat(F("doCalculate closing up stack sl: %u token: %s sc: %d"), sl, token, sc));
error = RPNCalculate(token);
TokenPos = token;
// const auto first = pop(); // Get last value from stack
// push(first); // push back
// addLog(LOG_LEVEL_INFO, strformat(F("doCalculate closing, last value on stack: %.4f sl: %u"), first, sl));
if (isError(error)) { return error; }
*TokenPos = sc;
@@ -629,6 +693,9 @@ CalculateReturnCode RulesCalculate_t::doCalculate(const char *input, ESPEASY_RUL
*(TokenPos) = 0; // Mark end of token string
error = RPNCalculate(token);
TokenPos = token;
// const auto first = pop(); // Get last value from stack
// push(first); // push back
// addLog(LOG_LEVEL_INFO, strformat(F("doCalculate final value on stack: %.4f sl: %u"), first, sl));
if (isError(error))
{
@@ -653,6 +720,19 @@ void preProcessReplace(String& input, UnaryOperator op) {
input.replace(find, replace);
}
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
void preProcessReplace(String& input, BinaryOperator op) {
String find = toString(op);
if (find.isEmpty()) { return; }
find += '('; // Add opening parenthesis.
const String replace = String(static_cast<char>(op)) + '(';
input.replace(find, replace);
}
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
bool angleDegree(UnaryOperator op)
{
switch (op) {
@@ -669,6 +749,22 @@ bool angleDegree(UnaryOperator op)
return false;
}
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
bool angleDegree(BinaryOperator op)
{
return BinaryOperator::ArcTan2_d == op;
// switch (op) // Future extension for 4 or more BinaryOperator options and multiple _d options
// {
// case BinaryOperator::ArcTan2_d:
// return true;
// case BinaryOperator::ArcTan2:
// case BinaryOperator::FMod:
// return false;
// }
// return false;
}
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
const __FlashStringHelper* toString(UnaryOperator op)
{
switch (op) {
@@ -720,6 +816,21 @@ const __FlashStringHelper* toString(UnaryOperator op)
return F("");
}
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
const __FlashStringHelper* toString(BinaryOperator op)
{
switch (op) {
case BinaryOperator::ArcTan2:
return F("atan2");
case BinaryOperator::ArcTan2_d:
return F("atan2_d");
case BinaryOperator::FMod:
return F("fmod");
}
return F("");
}
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
String RulesCalculate_t::preProces(const String& input)
{
String preprocessed = input;
@@ -751,7 +862,7 @@ String RulesCalculate_t::preProces(const String& input)
,UnaryOperator::Tan
,UnaryOperator::Tan_d
#endif // if FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
,UnaryOperator::Map
,UnaryOperator::Map // FIXME ?Move to new QuintaryOperator enum?
,UnaryOperator::MapC
};
@@ -770,6 +881,22 @@ String RulesCalculate_t::preProces(const String& input)
preProcessReplace(preprocessed, op);
}
}
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
const BinaryOperator operators2[] = {
BinaryOperator::ArcTan2,
BinaryOperator::ArcTan2_d,
BinaryOperator::FMod,
};
constexpr size_t nrOperators2 = NR_ELEMENTS(operators2);
for (size_t i = 0; i < nrOperators2; ++i) {
const BinaryOperator op = operators2[i];
preProcessReplace(preprocessed, op);
}
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
return preprocessed;
}
+23
View File
@@ -58,10 +58,23 @@ enum class UnaryOperator : uint8_t {
MapC, // Map (value, lowFrom, highFrom, lowTo, highTo) and clamp to lowTo/highTo
};
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
enum class BinaryOperator : uint8_t {
ArcTan2 = 220u, // Arc Tangent 2 (radian)
ArcTan2_d, // Arc Tangent 2 (degrees)
FMod, // Float-modulo
};
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
void preProcessReplace(String & input,
UnaryOperator op);
bool angleDegree(UnaryOperator op);
const __FlashStringHelper* toString(UnaryOperator op);
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
bool angleDegree(BinaryOperator op);
const __FlashStringHelper* toString(BinaryOperator op);
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
class RulesCalculate_t {
private:
@@ -81,6 +94,10 @@ private:
bool is_unary_operator(char c);
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
bool is_binary_operator(char c);
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
bool is_quinary_operator(char c);
CalculateReturnCode push(ESPEASY_RULES_FLOAT_TYPE value);
@@ -94,6 +111,12 @@ private:
ESPEASY_RULES_FLOAT_TYPE apply_unary_operator(char op,
ESPEASY_RULES_FLOAT_TYPE first);
#if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
ESPEASY_RULES_FLOAT_TYPE apply_binary_operator(char op,
ESPEASY_RULES_FLOAT_TYPE first,
ESPEASY_RULES_FLOAT_TYPE second);
#endif // if !defined(LIMIT_BUILD_SIZE) && FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
ESPEASY_RULES_FLOAT_TYPE apply_quinary_operator(char op,
ESPEASY_RULES_FLOAT_TYPE first,
ESPEASY_RULES_FLOAT_TYPE second,
+6 -2
View File
@@ -304,9 +304,9 @@ String formatToHex_array(const uint8_t* data, size_t size)
String formatToHex_wordarray(const uint16_t* data, size_t size)
{
String res;
res.reserve(2 * size);
res.reserve(4 * size);
for (size_t i = 0; i < size; ++i) {
appendHexChar(data[i] << 8, res);
appendHexChar(data[i] >> 8, res);
appendHexChar(data[i] & 0xFF, res);
}
return res;
@@ -1709,6 +1709,10 @@ void parseStandardConversions(String& s, bool useURLencode) {
#if FEATURE_STRING_VARIABLES
SMART_CONV(F("%c_ts2wday%"), get_weekday_from_timestamp(static_cast<uint32_t>(data.arg1)))
#endif // if FEATURE_STRING_VARIABLES
#ifndef LIMIT_BUILD_SIZE
SMART_CONV(F("%c_d2r%"), doubleToString(radians(data.arg1)))
SMART_CONV(F("%c_r2d%"), doubleToString(degrees(data.arg1)))
#endif // ifndef LIMIT_BUILD_SIZE
#undef SMART_CONV
// Conversions with 2 parameters
+35
View File
@@ -31,6 +31,10 @@
#include "../Helpers/StringConverter.h"
#include "../Helpers/StringProvider.h"
#ifndef LIMIT_BUILD_SIZE
#include <math.h>
#include "../Helpers/StringConverter_Numerical.h"
#endif // ifndef LIMIT_BUILD_SIZE
#if defined(ESP8266)
# include <ESP8266WiFi.h>
@@ -199,6 +203,24 @@ String SystemVariables::getSystemVariable(SystemVariables::Enum enumval) {
case LCLTIME_AM: return node_time.getDateTimeString_ampm('-', ':', ' ');
case LF: return String('\n');
case MAC_INT: intvalue = getChipId(); break; // Last 24 bit of MAC address as integer, to be used in rules.
#ifndef LIMIT_BUILD_SIZE
case S_PI: {
constexpr ESPEASY_RULES_FLOAT_TYPE _pi = M_PI;
#if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
return doubleToString(_pi, maxNrDecimals_fpType(_pi));
#else // if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
return toString(_pi, maxNrDecimals_fpType(_pi));
#endif // if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
}
case S_E: {
constexpr ESPEASY_RULES_FLOAT_TYPE _e = M_E;
#if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
return doubleToString(_e, maxNrDecimals_fpType(_e));
#else // if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
return toString(_e, maxNrDecimals_fpType(_e));
#endif // if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
}
#endif // ifndef LIMIT_BUILD_SIZE
case SPACE: return String(' ');
case SSID: return (WiFiEventData.WiFiDisconnected()) ? String(F("--")) : WiFi.SSID();
case SYSBUILD_DATE: return get_build_date();
@@ -540,6 +562,10 @@ SystemVariables::Enum SystemVariables::startIndex_beginWith(const char* begincha
case 'd': return Enum::DNS;
#if FEATURE_ETHERNET
case 'e': return Enum::ETHCONNECTED;
#else // if FEATURE_ETHERNET
#ifndef LIMIT_BUILD_SIZE
case 'e': return Enum::S_E;
#endif // ifndef LIMIT_BUILD_SIZE
#endif // if FEATURE_ETHERNET
case 'f': return Enum::FLASH_CHIP_MODEL;
case 'g': return Enum::GATEWAY;
@@ -551,6 +577,9 @@ SystemVariables::Enum SystemVariables::startIndex_beginWith(const char* begincha
case 'l': return Enum::LCLTIME;
case 'm': return Enum::SUNRISE_M;
case 'n': return Enum::S_LF;
#ifndef LIMIT_BUILD_SIZE
case 'p': return Enum::S_PI;
#endif // ifndef LIMIT_BUILD_SIZE
case 'r': return Enum::S_CR;
case 's': return Enum::SPACE;
case 'u': return Enum::UNIT_sysvar;
@@ -578,6 +607,9 @@ const __FlashStringHelper * SystemVariables::toFlashString(SystemVariables::Enum
case Enum::DNS: return F("dns");
case Enum::DNS_1: return F("dns1");
case Enum::DNS_2: return F("dns2");
#ifndef LIMIT_BUILD_SIZE
case Enum::S_E: return F("e");
#endif // ifndef LIMIT_BUILD_SIZE
#if FEATURE_ETHERNET
case Enum::ETHCONNECTED: return F("ethconnected");
case Enum::ETHDUPLEX: return F("ethduplex");
@@ -621,6 +653,9 @@ const __FlashStringHelper * SystemVariables::toFlashString(SystemVariables::Enum
case Enum::MAC: return F("mac");
case Enum::MAC_INT: return F("mac_int");
case Enum::S_LF: return F("N");
#ifndef LIMIT_BUILD_SIZE
case Enum::S_PI: return F("pi");
#endif // ifndef LIMIT_BUILD_SIZE
case Enum::S_CR: return F("R");
case Enum::RSSI: return F("rssi");
case Enum::SPACE: return F("SP");
+6
View File
@@ -29,6 +29,9 @@ public:
ETHSTATE,
ETHWIFIMODE,
#endif // if FEATURE_ETHERNET
#ifndef LIMIT_BUILD_SIZE
S_E,
#endif // ifndef LIMIT_BUILD_SIZE
FLASH_CHIP_MODEL,
FLASH_CHIP_VENDOR,
@@ -63,6 +66,9 @@ public:
SUNSET_M,
MAC,
MAC_INT,
#ifndef LIMIT_BUILD_SIZE
S_PI,
#endif // ifndef LIMIT_BUILD_SIZE
S_LF,
S_CR,
RSSI,
+47 -26
View File
@@ -106,42 +106,53 @@ bool P087_data_struct::loop() {
while (available > 0 && !fullSentenceReceived) {
// Look for end marker
char c = easySerial->read();
uint8_t c = easySerial->read();
--available;
if (available == 0) {
available = easySerial->available();
delay(0);
}
const size_t length = sentence_part.length();
# ifdef LIMIT_BUILD_SIZE
const bool addCharacter = (10u != c);
const bool finished = (13u == c);
# else // ifdef LIMIT_BUILD_SIZE
const bool addCharacter = (10u != c) || handle_binary; // Skip LF in ascii-mode
bool finished = (13u == c) && !handle_binary; // Done on CR in ascii-mode
switch (c) {
case 13:
{
const size_t length = sentence_part.length();
bool valid = length > 0;
if (0 != fixed_length) {
finished = (length == fixed_length);
for (size_t i = 0; i < length && valid; ++i) {
if ((sentence_part[i] > 127) || (sentence_part[i] < 32)) {
sentence_part = EMPTY_STRING;
++sentences_received_error;
valid = false;
}
}
if (valid) {
fullSentenceReceived = true;
last_sentence = sentence_part;
sentence_part = EMPTY_STRING;
}
break;
if (finished) {
available = 0; // Forced exit
}
case 10:
}
# endif // ifdef LIMIT_BUILD_SIZE
// Ignore LF
break;
default:
sentence_part += c;
break;
if (finished) {
bool valid = length > 0;
for (size_t i = 0; i < length && valid
# ifndef LIMIT_BUILD_SIZE
&& !handle_binary // Skip valid-ascii check
# endif // ifndef LIMIT_BUILD_SIZE
; ++i) {
if ((sentence_part[i] > 127) || (sentence_part[i] < 32)) {
sentence_part = EMPTY_STRING;
++sentences_received_error;
valid = false;
}
}
if (valid) {
fullSentenceReceived = true;
last_sentence = sentence_part;
sentence_part = EMPTY_STRING;
}
}
else if (addCharacter) {
sentence_part += static_cast<char>(c);
}
if (max_length_reached()) { fullSentenceReceived = true; }
@@ -152,6 +163,16 @@ bool P087_data_struct::loop() {
++sentences_received;
length_last_received = last_sentence.length();
}
# ifndef LIMIT_BUILD_SIZE
else if (handle_binary && last_sentence.isEmpty() && !sentence_part.isEmpty()) { // Receive binary data (no end-marker)
fullSentenceReceived = true;
last_sentence = sentence_part;
sentence_part = EMPTY_STRING;
++sentences_received;
length_last_received = last_sentence.length();
}
# endif // ifndef LIMIT_BUILD_SIZE
return fullSentenceReceived;
}
+49
View File
@@ -21,6 +21,31 @@
# define P87_Nchars 128
# define P87_MAX_CAPTURE_INDEX 32
# define P087_BAUDRATE PCONFIG_LONG(0)
# define P087_BAUDRATE_LABEL PCONFIG_LABEL(0)
# define P087_SERIAL_CONFIG PCONFIG_LONG(1)
# define P087_QUERY_VALUE 0 // Temp placement holder until we know what selectors are needed.
# define P087_NR_OUTPUT_OPTIONS 1
# define P087_NR_OUTPUT_VALUES 1
# define P087_QUERY1_CONFIG_POS 3
# define P087_DEFAULT_BAUDRATE 38400
# define P087_READ_BIN_LABEL PCONFIG_LABEL(1)
# define P087_EVENT_HEX_LABEL PCONFIG_LABEL(2)
# define P087_FIXED_LENGTH_LABEL PCONFIG_LABEL(3)
# define P087_CONFIG_FLAGS PCONFIG_ULONG(2)
# define P087_FLAG_READ_BIN 0
# define P087_FLAG_EVENT_HEX 1
# define P087_FLAG_FIXED_LENGTH 2 // 8 bit
# define P087_CONFIG_SET_READ_BIN(S) (bitWrite(P087_CONFIG_FLAGS, P087_FLAG_READ_BIN, (S)))
# define P087_CONFIG_GET_READ_BIN (bitRead(P087_CONFIG_FLAGS, P087_FLAG_READ_BIN))
# define P087_CONFIG_SET_EVENT_HEX(S) (bitWrite(P087_CONFIG_FLAGS, P087_FLAG_EVENT_HEX, (S)))
# define P087_CONFIG_GET_EVENT_HEX (bitRead(P087_CONFIG_FLAGS, P087_FLAG_EVENT_HEX))
# define P087_CONFIG_SET_FIXED_LENGTH(S) (set8BitToUL(P087_CONFIG_FLAGS, P087_FLAG_FIXED_LENGTH, (S)))
# define P087_CONFIG_GET_FIXED_LENGTH (get8BitFromUL(P087_CONFIG_FLAGS, P087_FLAG_FIXED_LENGTH))
enum P087_Filter_Comp {
Equal = 0,
@@ -115,6 +140,25 @@ public:
bool plugin_get_config_value(struct EventStruct *event,
String & string);
# ifndef LIMIT_BUILD_SIZE
void setHandleBinary(bool state) {
handle_binary = state;
}
void setEventAsHex(bool state) {
event_hex = state;
}
bool isEventAsHex() const {
return event_hex;
}
void setFixedLength(uint8_t value) {
fixed_length = value;
}
# endif // ifndef LIMIT_BUILD_SIZE
private:
bool max_length_reached() const;
@@ -133,6 +177,11 @@ private:
bool capture_index_used[P87_MAX_CAPTURE_INDEX] = { 0 };
bool capture_index_must_not_match[P87_MAX_CAPTURE_INDEX] = { 0 };
bool regex_empty = false;
# ifndef LIMIT_BUILD_SIZE
bool handle_binary = false;
bool event_hex = false;
uint8_t fixed_length{};
# endif // ifndef LIMIT_BUILD_SIZE
};
@@ -15,6 +15,8 @@ const __FlashStringHelper* ST77xx_type_toString(const ST77xx_type_e& device) {
case ST77xx_type_e::ST7735s_135x240: return F("ST7735 135 x 240px");
case ST77xx_type_e::ST7735s_172x320: return F("ST7735 172 x 320px");
case ST77xx_type_e::ST77xxs_170x320: return F("ST77xx 170 x 320px");
case ST77xx_type_e::ST77xxs_240x320: return F("ST77xx 240 x 320px");
case ST77xx_type_e::ST77xxs_240x280: return F("ST77xx 240 x 280px");
# endif // if P116_EXTRA_ST7735
case ST77xx_type_e::ST7789vw_240x320: return F("ST7789 240 x 320px");
case ST77xx_type_e::ST7789vw_240x240: return F("ST7789 240 x 240px");
@@ -83,6 +85,14 @@ void ST77xx_type_toResolution(const ST77xx_type_e& device,
x = 170;
y = 320;
break;
case ST77xx_type_e::ST77xxs_240x320:
x = 240;
y = 320;
break;
case ST77xx_type_e::ST77xxs_240x280:
x = 240;
y = 280;
break;
# endif // if P116_EXTRA_ST7735
case ST77xx_type_e::ST7796s_320x480:
x = 320;
@@ -202,6 +212,20 @@ bool P116_data_struct::plugin_init(struct EventStruct *event) {
initRoptions = INITR_BLACKTAB170x320; // 170x320px
}
// fall through
case ST77xx_type_e::ST77xxs_240x320:
if (initRoptions == 0xFF) {
initRoptions = INITR_BLACKTAB240x320; // 240x320px
}
// fall through
case ST77xx_type_e::ST77xxs_240x280:
if (initRoptions == 0xFF) {
initRoptions = INITR_BLACKTAB240x280; // 240x280px
}
// fall through
# endif // if P116_EXTRA_ST7735
case ST77xx_type_e::ST7735s_80x160:
+5 -1
View File
@@ -59,12 +59,14 @@
# define P116_CONFIG_FLAG_TYPE 16 // Flag-offset to store 4 bits for Hardwaretype, uses bits 16, 17, 18 and 19
# define P116_CONFIG_FLAG_CMD_TRIGGER 20 // Flag-offset to store 4 bits for Command trigger, uses bits 20, 21, 22 and 23
# define P116_CONFIG_FLAG_BACK_FILL 28 // Flag: Background fill when printing text
# define P116_CONFIG_FLAG_TYPE2 29 // Flag-offset to store 2 more bits for Hardwaretype, uses bits 29 and 30
// Getters
# define P116_CONFIG_FLAG_GET_MODE (get4BitFromUL(P116_CONFIG_FLAGS, P116_CONFIG_FLAG_MODE))
# define P116_CONFIG_FLAG_GET_ROTATION (get4BitFromUL(P116_CONFIG_FLAGS, P116_CONFIG_FLAG_ROTATION))
# define P116_CONFIG_FLAG_GET_FONTSCALE (get4BitFromUL(P116_CONFIG_FLAGS, P116_CONFIG_FLAG_FONTSCALE))
# define P116_CONFIG_FLAG_GET_TYPE (get4BitFromUL(P116_CONFIG_FLAGS, P116_CONFIG_FLAG_TYPE))
# define P116_CONFIG_FLAG_GET_TYPE (get4BitFromUL(P116_CONFIG_FLAGS, P116_CONFIG_FLAG_TYPE) \
+ (get2BitFromUL(P116_CONFIG_FLAGS, P116_CONFIG_FLAG_TYPE2) << 4))
# define P116_CONFIG_FLAG_GET_CMD_TRIGGER (get4BitFromUL(P116_CONFIG_FLAGS, P116_CONFIG_FLAG_CMD_TRIGGER))
# define P116_CONFIG_GET_COLOR_FOREGROUND (P116_CONFIG_COLORS & 0xFFFF)
# define P116_CONFIG_GET_COLOR_BACKGROUND ((P116_CONFIG_COLORS >> 16) & 0xFFFF)
@@ -105,6 +107,8 @@ enum class ST77xx_type_e : uint8_t {
ST7735s_135x240 = 12u,
ST7735s_172x320 = 13u,
ST77xxs_170x320 = 14u,
ST77xxs_240x320 = 15u,
ST77xxs_240x280 = 16u,
# endif // if P116_EXTRA_ST7735
};
+1 -1
View File
@@ -152,7 +152,7 @@ bool P180_data_struct::plugin_write(struct EventStruct *event,
} else if (equals(sub, F("exec")) && hasPar3 && hasBusCmd) { // genI2c,exec,<cache_name>[,<TaskValueIndex>]
cmds = busCmd_Helper->parseBusCmdCommands(par3, EMPTY_STRING); // Fetch commands from cache by name
} else if (equals(sub, F("log")) && hasPar3) { // genI2c,log,<1|0>
_showLog = event->Par3 != 0;
_showLog = event->Par2 != 0;
P180_LOG_DEBUG = _showLog ? 1 : 0;
if (hasBusCmd) {
+7 -1
View File
@@ -137,7 +137,13 @@ void handle_metrics_devices() {
addHtml(F("{valueName=\""));
addHtml(Cache.getTaskDeviceValueName(x, varNr));
addHtml(F("\"} "));
addHtml(formatUserVarNoCheck(&TempEvent, varNr));
const String value(formatUserVarNoCheck(&TempEvent, varNr));
if (value.isEmpty()) {
addHtml('0'); // Return 0 for not-set values
} else {
addHtml(value);
}
addHtml('\n');
}
}
+11 -1
View File
@@ -92,7 +92,11 @@ void handle_sysvars() {
SystemVariables::LF,
SystemVariables::SPACE,
SystemVariables::S_CR,
SystemVariables::S_LF
SystemVariables::S_LF,
#ifndef LIMIT_BUILD_SIZE
SystemVariables::S_E,
SystemVariables::S_PI,
#endif // ifndef LIMIT_BUILD_SIZE
};
addSysVar_enum_html(vars, NR_ELEMENTS(vars));
}
@@ -402,6 +406,12 @@ void handle_sysvars() {
F("cm to imperial: %c_cm2imp%(190)"),
F("mm to imperial: %c_mm2imp%(1900)"),
#ifndef LIMIT_BUILD_SIZE
F(""), // addFormSeparator(3,
F("Degrees to radians: %c_d2r%(22)"),
F("Radians to degrees: %c_r2d%(0.357)"),
#endif // ifndef LIMIT_BUILD_SIZE
F(""), // addFormSeparator(3,
F("Mins to days: %c_m2day%(1900)"),
F("Mins to dh: %c_m2dh%(1900)"),
+4 -2
View File
@@ -154,7 +154,7 @@ var pluginDispCmd = [
];
var commonTag = ["On", "Do", "Endon"];
var commonNumber = ["toBin", "toHex", "Constrain", "XOR", "AND:", "OR:", "Ord", "bitRead", "bitSet", "bitClear", "bitWrite", "urlencode"];
var commonMath = ["Log", "Ln", "Abs", "Exp", "Sqrt", "Sq", "Round", "Sin", "Cos", "Tan", "aSin", "aCos", "aTan", "Sin_d", "Cos_d", "Tan_d", "aSin_d", "aCos_d", "aTan_d", "map", "mapc"];
var commonMath = ["Log", "Ln", "Abs", "Exp", "Sqrt", "Sq", "Round", "Sin", "Cos", "Tan", "aSin", "aCos", "aTan", "aTan2", "Sin_d", "Cos_d", "Tan_d", "aSin_d", "aCos_d", "aTan_d", "aTan2_d", "map", "mapc", "fmod"];
var commonWarning = ["delay", "Delay", "ResetFlashWriteCounter"];
var taskSpecifics = [
//Task settings
@@ -180,7 +180,9 @@ var AnythingElse = [
//Standard Conversions
"%c_w_dir%", "%c_c2f%", "%c_ms2Bft%", "%c_dew_th%", "%c_alt_pres_sea%", "%c_sea_pres_alt%", "%c_cm2imp%", "%c_isnum%", "%c_mm2imp%",
"%c_m2day%", "%c_m2dh%", "%c_m2dhm%", "%c_s2dhms%", "%c_ts2date%", "%c_ts2isodate%", "%c_ts2wday%", "%c_random%", "%c_2hex%", "%c_u2ip%", "%c_uname%", "%c_uage%", "%c_ubuild%", "%c_ubuildstr%",
"%c_uload%", "%c_utype%", "%c_utypestr%", "%c_strf%",
"%c_uload%", "%c_utype%", "%c_utypestr%", "%c_strf%", "%c_d2r%", "%c_r2d%",
//Constants
"%SP%", "%CR%", "%LF%", "%N%", "%R%", "%e%", "%pi%",
//Variables
"var", "int", "str", "length"
];
+1 -1
View File
File diff suppressed because one or more lines are too long