Skip to content

Release v2.3.0: wood moisture, zones, alarm window and new Settings forms - #45

Merged
CervezaStallone merged 19 commits into
mainfrom
feat/wood-moisture
Nov 2, 2026
Merged

CervezaStallone merged 19 commits into
mainfrom
feat/wood-moisture

Conversation

@CervezaStallone

Copy link
Copy Markdown
Owner

Summary

Release v2.3.0: wood moisture, warning/alarm levels, zones, an alarm window and a reworked Settings form.

Added

  • Wood moisture (equilibrium moisture content, USDA Wood Handbook) per sensor with its own diagram, a correction for the wood species and a response time
  • Warning and alarm level per limit (e.g. 18 % warning, 20 % alarm)
  • Zones in the Mollier and wood diagram: from min/max or drawn freely, with a notification when a sensor leaves a desired zone or enters a danger zone
  • Alarm window from the top bar with muting per alarm
  • Dark/light toggle in the top bar (per browser) and a logo/favicon
  • Per sensor data type, byte order and calibration correction; scanning a bus for responding sensors

Changed

  • Buses, sensors, limits and zones use normal form fields instead of a DataTable (arrow keys, dropdowns and checkboxes work reliably)
  • Dew point uses the Magnus formula; the comfort score uses the same dew point
  • ?tab=settings disappears when going back to the dashboard

Fixed

  • Saving settings no longer repeats notifications for active alarms
  • An impossible raw humidity is rejected instead of shown as 0 %
  • Meter card text overflow

Upgrading

The database is upgraded automatically: existing sensors become int16 / ABCD without correction (same readings), existing limits get the level Alarm. Run pip install -r requirements.txt (or the service install script) as usual.

Test plan

  • python test_app.py: 84/84 tests pass
  • Checked in the browser: forms and arrow keys, saving with invalid fields, drawing and saving a zone, alarm window, theme toggle, phone layout, light theme
  • Real XY-MD02 on an FTDI RS-485 adapter: readings with function code 4

… calibration

- Wood equilibrium moisture per sensor (USDA Wood Handbook, Hailwood-Horrobin), on/off in Settings > Display like the Mollier diagram
- Diagram of temperature x humidity with lines of equal wood moisture, sensor points and zones from the alarm rules
- Response time of the wood (default 24 h): board and alarms use a slow average, seeded from the database after a restart
- Correction setting for wood species instead of a species table (the handbook formula applies to all species)
- Alarm rules get a level (warning / alarm), so 18 % can warn and 20 % can alarm
- Temperature and humidity correction per sensor for calibration
- Dew point now uses the Magnus formula instead of the T - (100 - RH) / 5 rule of thumb
- Wood moisture in MQTT when enabled
…b=settings when leaving Settings

- Buses, sensors and limits are now rows of normal inputs, dropdowns and checkboxes instead of a DataTable: arrow keys move the cursor, dropdowns and the enabled switch work reliably
- Port field suggests detected adapters, stable /dev/serial/by-id names first; empty legacy ports (ttyS*) are no longer listed
- Invalid fields are marked in red after saving; forms reload only after the save has finished
- The address bar follows the tab: ?tab=settings disappears on the dashboard, F5 keeps the current tab
- Save bar stays above the form fields
…vel hint, reject invalid humidity

- Wood moisture column stays visible on phones; board uses short headers there (Temp. / RH / Wood)
- Wood moisture warning/alarm is coloured in the meters view
- Comfort score uses the same Magnus dew point as the measurements
- Limits hint explains the warning and alarm levels
- An impossible raw humidity (e.g. -5 %) is rejected again instead of being clamped to 0 %; only the calibration correction is clamped
- Data type per sensor: int16 (default, XY-MD02), uint16, int32, uint32, float32; 32-bit types read two registers
- Byte order per sensor: ABCD (big endian), DCBA (little endian), BADC (byte swap), CDAB (word swap)
- Existing sensors are migrated to int16 / ABCD, so current setups keep reading the same values
…fix meter card text overflow

- Zones are areas of temperature x humidity (rectangle from min/max or a free shape) with a colour, for all sensors or one sensor
- Per zone a notification when a sensor leaves it (desired zone) or enters it (danger zone), at warning or alarm level, using the alarm delay
- Recovery only once the sensor is the temperature/humidity hysteresis away from the zone edge, so a sensor on the edge does not flap
- Zones are drawn in both diagrams; zone alarms show as 'Zone' in the sensor status
- Meter cards: long status text wraps, values below the display no longer break inside a unit
- Zones section under notifications: name, sensor, desired/danger zone, level, colour and temperature/humidity range
- Drawn zones keep their shape and show as 'Free shape' instead of min/max fields
- Zones are validated and saved together with the other settings; invalid fields are marked
- Zones are drawn beneath the sensor points in the Mollier diagram
- 'Draw zone' button switches the Mollier diagram to drawing a closed shape; live updates pause meanwhile
- The drawn shape (°C, g/kg) is converted to temperature and humidity points and saved as a free-shape zone
- Saving requires being logged in, because the dashboard can be public
- Colour, notification and sensor of a drawn zone are set afterwards in Settings > Zones
Saving zones (also after drawing one) gives them new ids; the alarm state of zones that no longer exist, are disabled or are display-only is now cleaned up on the next measurement.
- Clicking the sensor/alarm summary in the header opens a window with all active alarms and warnings per sensor, with the time they started
- Each alarm can be muted for 15 minutes, 1, 8 or 24 hours, or unmuted; muted alarms stay visible but send no alarm or recovery notifications
- Muting requires being logged in, because the dashboard can be public; mutes last until a restart
- Toggle next to Board/Meters switches the theme instantly, charts included
- The choice is remembered per browser (cookie); browsers without a choice use the default from Settings
- Alarm state is only reset for rules whose limits changed
- Zones keep their id when saved again, so their alarm state survives as well
…its settings change

- 'Scan' in Settings > Modbus finds which slave addresses 1-30 answer on a saved bus, with their values
- Scan and polling take turns on the same serial port, so answers never mix; the port stays open for a running poller
- Scanning requires being logged in
- Changing the wood correction or response time restarts the averaged wood moisture from the history instead of drifting for days
Drawn zones no longer default to display-only: the draw bar has a desired/danger/display-only choice (default danger zone) and a colour.
- Features, dashboard usage, notifications, project and code structure cover wood moisture, zones, alarm window, theme toggle, data types and scanning
- Test count 45 -> 84
- Troubleshooting entry for an outdated virtual environment after updating
- Unreleased changelog entry with upgrade notes (automatic database upgrade, same readings for existing sensors)
@CervezaStallone
CervezaStallone merged commit be5239d into main Nov 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant