Skip to content

Release 2026.3 - #6936

Merged
gizmocuz merged 150 commits into
masterfrom
development
Aug 2, 2026
Merged

gizmocuz merged 150 commits into
masterfrom
development

Conversation

@gizmocuz

@gizmocuz gizmocuz commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Merges all changes from development into master for the 2026.3 release.

This release contains important security fixes in the web server and API; upgrading is strongly recommended:

  • OAuth2 authorize endpoint hardened: HTTP response splitting blocked, open redirect for unknown clients refused, state parameter URL-encoded (reported privately, CWE-113)
  • libwebem hardening: authentication, request parsing, PHP execution, proxy trust, HTTP framing, sessions and resource limits
  • udevices endpoint now requires authorization and rejects path traversal
  • WebSocket connections are authenticated when website protection is enabled

Highlights beyond security:

  • API/JSON: 'week' graph range for all sensor types; counter custom date ranges fixed; failed graph requests now return a descriptive error message
  • EvoHome: RAMSES-II HVAC ventilation decoding with fan mode control
  • Netatmo: battery reporting and additional device scopes (re-authorization required)
  • Dashboard Dynamic: new widget features (Custom Chart sensor types, Barometer/Stat Counter trend graphs, thunderstorm scene, blinds stop/position controls) and many fixes
  • Automation Wizard: selector level, alert device and user variable conditions, plus dropdown fixes
  • Many fixes across dzVents, MQTT Auto Discovery, Python plugins, reports and charts

See History.txt for the full changelog.

JurgenLB and others added 30 commits May 3, 2026 18:21
The condition/action device pickers used track by dev.idx. getdevices?filter=all returns devices and scenes/groups, which live in separate id sequences, so a device and a scene/group can share an idx. The duplicate key made AngularJS throw [ngRepeat:dupes] and render an empty dropdown. Use a composite key (dev.Type + dev.idx).

Select devices by idx instead of name so duplicate device names are unambiguous. Device options now show 'Name (Type/SubType)'. Generated dzVents prefers the readable name and falls back to the idx only when the name is not unique.

The 'only if a device is in a specific state' condition now references the selected device instead of the trigger device parameter, which was ignored before and errored for non-device triggers such as Security.

Fix a flexbox overflow that pushed the action dropdown out of the dialog (min-width: 0) and widen the device field.
Text sensors only updated when their value changed, so HA-discovered
devices that repeatedly send the same string status (e.g. a Kerui panic
button reporting "Panic" on every press) were dropped after the first
update. Parse the force_update / frc_upd field from the discovery config
and bypass the unchanged-value guard when it is set.
Fix for API/JSON counters with date range #6845
The classic mobile dashboard rendered Text/Alert device data through
ng-bind-html with only an nl2br() transform, the last device-data sink
not routed through the shared DOMPurify sanitizer. Device values are
attacker-influenceable (any user >= URIGHTS_USER, MQTT publishers and
reporting hardware can set them), so route them through sanitizeHTML()
like the dynamic dashboard text widgets. Legitimate formatting tags are
preserved while scripts and event-handler attributes are stripped.
)

Text devices with newlines showed double commas in floorplan tooltips and
flattened multi-line values onto a single comma-separated line.

- Text/Alert nl2br no longer preserves the raw newline alongside the
  inserted <br />, fixing the double-comma output and a lineCount
  over-count for the popup size
- The floorplan tile now renders the <br />-preserving value via the new
  htmlToBrLines() helper instead of the comma-flattened smallStatus, so
  each line is shown on its own row
CustomChart widget - Add support for Voltage and Current sensor types
CustomChart widget - time range fix
Fix for API/JSON counters with date range #6845
Add support for Percentag sensor types
CustomChart widget: add support for Percentage sensor types
…m chart

Month/year graph ranges return v_min/v_max/v_avg rather than v, so the
custom chart Percentage series fell back to a non-existent v1 field and
rendered blank for those ranges. Read v_avg as the fallback so all ranges
render, mirroring how temp (te) and counter/voltage (v) reuse a single
key across ranges. Also narrow the match to sub === 'Percentage' since
these devices are always Type=General, SubType=Percentage.
gauge widget - color display fix
P1 gas devices (Type 'P1 Smart Meter', SubType 'Gas') matched the
electricity-only branch in updateBar() first, which reads Usage/UsageDeliv.
Those fields are empty for gas, so barNumVal stayed undefined and no bar
rendered. Guard the P1 branch with SubType != 'Gas' so gas falls through
to the Gas branch using CounterToday.
WindChart - time range fix
The Gauge widget had no Alert-sensor branch, so it fell through to the
generic numeric path and parsed the leading number out of the Value/Text
string. Alert text that starts with a word yielded no usable value, so the
arc and range colors never reflected the alert level.

Use the numeric alert Level (0-4) for Alert sensors, and seed Min/Max 0-4
plus the standard alert-level color palette when a fresh gauge is wired to
an Alert sensor. Adds a --dz-accent-orange token for level 3.
The range editor uses <input type="color">, which only renders hex values
and showed black for the var(--dz-*) strings the alert gauge seeded. Use
hex values matching the alert-level palette instead, and drop the now
unused --dz-accent-orange token.
For Alert sensors the gauge now hides the numeric level and renders the
descriptive alert text (d.Data) centered in the dial, wrapped to fit. The
text is sanitized through the shared DOMPurify helper (allow-list + scoped
<style>), matching ddTextSensor, so embedded HTML renders without XSS risk.
gizmocuz and others added 28 commits July 10, 2026 00:59
…d weather scenes

Add a dedicated thunderstorm scene to the CSS weather scene library: a
darker storm cloud (fcw-cloud-thunder), falling rain and a flashing
lightning bolt (fcw-bolt). The Thunderstorm forecast now maps to this
scene instead of reusing the heavy rain scene (baro, weather and energy
dashboard widgets).

Rework scene element positioning: raindrops, snowdots, moon and stars
were relative/in-flow and landed below the 200px scene box, so they
were clipped away in the small barometer card and rain/snow/night
scenes rendered as clouds only. All animated elements are now
absolutely positioned within the scene, keeping every animation
visible in the clipped top-pinned scene background.
…bstring

Weather widget style 2 and the energy dashboard weather card matched the
forecast string exactly in ng-switch, so BMP-style barometers reporting
'Cloudy/Rain' fell through to the plain cloudy scene and never showed the
rain animation (style 1 already used the substring-based getWeatherScene
mapper and worked).

Both templates now switch on the computed scene instead of the raw
forecast string, keeping the day/night variants. The mapper also learned
Stable (sunny), Unstable (cloudy) and Some Clouds (partly cloudy) so
those forecasts keep their previous scenes.
…cards

The full-size sun (100px disc plus rotating rays sweeping a 141px
circle) spans nearly the whole 200px scene box, so in the barometer and
compact weather cards it filled the entire card height with the ray tips
touching the edges. Within .dd-weather-scene-bg the main sun now uses
the mini-sun geometry, matching the footprint of the cloud scenes.
…ule cannot stall the worker

A wedged IntesisHome wifi module accepts the TCP connection but never
answers, blocking the worker thread inside HTTPClient::POST for the
process-wide 90s default. That starved the hardware heartbeat (>60s)
and produced misleading 'thread seems to have ended unexpectedly'
watchdog errors. Use POSTBinary with an explicit 10 second timeout so
polls fail fast; worst-case login-retry path now blocks ~20s, well
under the watchdog threshold.
…dget

An ICS feed stores a recurring event as a single VEVENT with the original
DTSTART plus an RRULE; the calendar widget ignored RRULE, so recurring
series carried a start date far in the past and were filtered out as
expired. Calendars dominated by recurring events appeared frozen even
though the feed was re-fetched correctly (forum topic 45056).

parseICS now expands recurring series into concrete occurrences within a
60-day lookahead window, supporting FREQ=DAILY/WEEKLY/MONTHLY/YEARLY with
INTERVAL, COUNT, UNTIL, BYDAY (weekly) and BYMONTHDAY (incl. negative
values), honoring EXDATE exclusions, RECURRENCE-ID overrides and
cancelled events, with an iteration cap against malformed rules.
Use the existing translation mechanism for the buttons and title of the camera add/edit dialogs. Closes #5453
…s in Automation Wizard (#6904)

* Initial plan

* Add selector level LOV support in AutomationWizard for conditions and actions

* Address code review: rename vars, add error logging, extract LOV helpers

* Extract defaultLevelValue helper, make fallback consistent across all usages

* Clarify LevelOffHidden check and simplify defaultLevelValue control flow

* AutomationWizard: add alert device support for conditions and actions

* AutomationWizard: address code review comments (clarify comments)

* Enhance AutomationWizard to support variable conditions

Added handling for variable conditions in the Automation Wizard.

* Add variable condition section to AutomationWizard

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…ropdowns

When switching the trigger or condition device between devices with
different level sets (selector/alert vs dimmer/sensor), the previously
entered value was kept even when it no longer matched the new device's
level options, rendering a blank dropdown while the stale value was
still emitted into the generated dzVents code.

Condition values are now re-defaulted whenever they are not valid for
the current level options, and cleared when the selected state takes no
value. Also trim the user-variable condition value so a whitespace-only
input no longer generates a numeric comparison against 0.
…eam dialog (#6913)

The camera feed widget read cam.CameraAspect from the getcameras
response, but that endpoint returns the field as AspectRatio, so the
live stream dialog always opened in 4:3. Also fetch the aspect ratio
even when 'Show camera name' is disabled, and default to 16:9 when the
setting cannot be determined.
…ter mode

When electricity price calculation uses the internal meter tariffs, the
logged MultiMeter Price column holds the usage tariff (T1/T2) active at
log time. CalcMultiMeterPrice() multiplied the return counters
(Value2/Value6) by that same price, so returned energy was credited at
the usage tariff instead of the configured R1/R2 return tariffs. Price
the return deltas with CostEnergyR1/CostEnergyR2 in internal mode;
dynamic price device behavior is unchanged since there a single market
price legitimately applies to usage and return alike.

Also recalculate historic P1 day prices in MultiMeter_Calendar via a DB
migration (version 178). Each day counter accrues only while its own
tariff channel is active, so the corrected price follows directly from
the per-channel day totals and the static tariffs, no short log needed.
The migration only runs when the price source is the internal meter
tariffs and replicates the day-rollover spike protection.

Fixes #6915
The graph API (param=graph&range=week) only implemented rain and
Meter_Calendar-backed counters (plus P1 Power); temperature, humidity,
percentage, fan, UV, wind and all MultiMeter_Calendar counter devices
(Air Quality, Lux, Weight, Usage, Voltage, Current, Soil/Leaf Wetness,
Visibility, Distance, Solar Radiation, Pressure, Sound Level, RFXSensor)
returned an empty response, and the generic counter query even failed
against MultiMeter_Calendar (no Value column).

Add week branches mirroring the month/year handlers: 7-day calendar
aggregates plus a computed today record, using the same JSON field
names and value conversions, so any frontend can parse week responses
the same way as month/year.
…gate series (#6916)

The 'Last 7 days' range rendered an empty chart for most sensor types
because the backend did not serve range=week for them. Now that the
backend supports week for all mapped sensors, request it natively;
range=day remains only as a safety net for unmapped device types.

Also:
- add Air Quality (CO2, ppm) sensor support with co2/co2_avg parsing
- fix Lux devices showing an empty chart on every range (sensor=lux
  does not exist in the backend; route via sensor=counter with
  lux/lux_avg parsing)
- fix empty month/year charts for Voltage, Current and Usage devices
  by parsing the v_avg and u_avg/u_max aggregate fields

Thanks to @fleinze for the report and the initial patch in #6916.
…omevent loops (#6921)

The hardware and customevent loops in ProcessNotification() iterated the
full event batch gated only by precomputed flags, without re-checking
item.reason. Since _tEventQueue::nValue holds a raw device value for
REASON_DEVICE items and a notification type for REASON_NOTIFICATION ones,
a device update whose nValue happened to equal Notification::DZ_CUSTOM was
misrouted into ProcessNotificationItem, which then tried to parse its
sValue as JSON.

Filter on item.reason in both loops, matching the domoticz loop, and
include item.sValue in the parse-error log.

Closes #6912
Selector switches on the mobile dashboard used btn-selected for the active
level and btn-default for the inactive ones. In the default theme
btn-default paints a blue button texture while btn-selected is a hardcoded
purple gradient, so the selected level looked unhighlighted and the
unselected levels looked active, the inverse of the on/off convention.

Use btn-info for the active level and leave the others as plain buttons,
matching every other button in the mobile dashboard.
Select entities that map a raw wire value to a human readable label via
value_template (the hm2mqtt convention) never matched their options list
and logged "doesn't have the option for received STATE" on every update.
CleanValueTemplate strips the mapping half of the template and leaves only
value_json.<field>, so the raw value was compared against the labels.

parseMapTemplate no longer hardcodes the "values" dictionary name and now
resolves an intermediate alias assignment such as
{% set stringifiedValue = value_json.x | string %}. It is applied to the
select value_template before the template is cleaned, and the resulting
raw to label pairs are used when matching the received state.

The command direction is fixed as well: selecting an option published the
label instead of the raw value, so the bridge silently ignored it. The
label is now translated back through command_template, falling back to
inverting the value_template mapping.

Also adds entity_category parsing, used to detect whether a sensor with
device_class battery belongs to a battery powered node (entity_category
diagnostic) and should only update the node battery level, instead of a
mains powered system reporting its state of charge.
Decode 22F1, 31D9 and 31DA, which were previously logged as unknown
commands. Ventilation units now expose fan mode, fan speeds, CO2, air
quality, humidity, supply/exhaust/indoor/outdoor temperatures, bypass
position, pre/post heaters, air flow rates and filter/fault status.

The fan mode is a selector switch. Setting it transmits a 22F1 packet as
the remote bound to the unit, learned by watching remote traffic, using
the vendor mode numbering inferred from the mode_max byte.

CEvohomeMsg::Encode() now allows id[0] to override the hardcoded 18:730
source address, which is needed to transmit as a bound remote. Every
existing sender leaves id[0] at zero, so the heating path is unchanged.

Field layouts ported from the MIT licensed ramses_rf project.
…sessions and resource limits)

The tracked remote clients map moved from one process-wide map to a per-cWebem-instance map, so the rclientslog command now aggregates the snapshot across all running servers (plain and secure) via CWebServerHelper::GetRemoteClients().
…itting and open redirect

Reported privately 2026-07-30 (CWE-113). The state parameter was written into the Location header verbatim, so a %0d%0a in it could terminate the header and inject arbitrary headers or a fabricated second response on a keep-alive socket. state is now URL-encoded like code and error.

Per RFC 6749 section 4.1.2.1 the user-agent must not be redirected when the client identifier is missing or invalid; the endpoint now answers 400 with a JSON error instead of bouncing any unauthenticated caller to an arbitrary redirect_uri.

Adds a raw-socket regression test covering both defences.
…eject malformed idx

BuildGraphContext() gains an optional reason output that Cmd_HandleGraph() returns as a JSON message, so a failed graph request no longer produces a bare {"status":"ERR"} with nothing to say whether a parameter was missing or the device no longer exists.

A non-numeric idx previously escaped as an uncaught std::stoull exception; it is now rejected with a clean error.
Walks the entire registered command surface (extracted from WebServer.cpp at run time) against a throwaway Domoticz instance and reports transport-level failures, which are libwebem regressions, while ignoring application-level error responses. Also probes request-size limits, keep-alive behaviour and the authenticated WebSocket API.
algoritnl/sqlite-cmake force-pushed its history, making the pinned commit 82e4a53 unfetchable and failing every CI checkout since July 28. Pin the new upstream head (sqlite 3.53.4 plus a fix for the generated sqlite3cfg.h include dir).

The rewritten project renames the exported target from SQLite3::SQLite3 to sqlite::sqlite and defaults SQLITE_ENABLE_MATH_FUNCTIONS to OFF; link the new target and keep the math functions enabled as before.
@gizmocuz
gizmocuz merged commit f734fde into master Aug 2, 2026
4 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.

10 participants