Skip to content

Add pressure sensor- #420 - #300

Open
olesz wants to merge 3 commits into
OpenSprinkler:masterfrom
olesz:master
Open

Add pressure sensor- #420#300
olesz wants to merge 3 commits into
OpenSprinkler:masterfrom
olesz:master

Conversation

@olesz

@olesz olesz commented Aug 8, 2026

Copy link
Copy Markdown

Changes Proposed

Adding pressure sensor related changes. See OpenSprinkler-Firmware related pull request: OpenSprinkler/OpenSprinkler-Firmware#420

Demo Video or Screenshots

pressure_sensor_status_footer pressure_sensor_configure

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b107bc36b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread www/js/modules/options.js
{ id: "sensor3", bit: 11, label: OSApp.Language._( "Sensor 3 Update" ), option: "sn3t" },
{ id: "sensor4", bit: 12, label: OSApp.Language._( "Sensor 4 Update" ), option: "sn4t" }
{ id: "sensor4", bit: 12, label: OSApp.Language._( "Sensor 4 Update" ), option: "sn4t" },
{ id: "pressure", bit: 13, label: OSApp.Language._( "Pressure Sensor Update" ) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Split pressure notification into ife2

When a user enables this new bit-13 event, the popup stores a single combined value on #o49. The generic submit path later transforms o49 to ife only, while this same screen reads extended bits from options.ife2; no code writes the upper byte back to ife2. As a result /co receives ife=8192 instead of ife=<low>&ife2=32, so the pressure notification cannot be saved and may cause the settings save to fail on firmware that bounds ife to one byte. Please split high bits into ife2 before submitting.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the split is already handled. See options.js line ~254: the case "o49" handler does:

opt.o49 = data & 0xff; // → ife (low byte, bits 0-7)
opt.o65 = (data >> 8) & 0xff; // → ife2 (high byte, bits 8-15)

Bit 13 ends up as bit 5 in o65, which transformKeys() then converts to the firmware key ife2. This is the same mechanism used by sensor3 (bit 11) and sensor4 (bit 12), which are already working.

Comment thread www/js/modules/options.js Outdated
if ( OSApp.Firmware.checkOSVersion( 219 ) ) {
html += "<option value='3'" + ( current === 3 ? " selected" : "" ) + ">" + OSApp.Language._( "Soil" ) + "</option>";
}
html += "<option value='4'" + ( current === 4 ? " selected" : "" ) + ">" + OSApp.Language._( "Pressure" ) + "</option>";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate pressure type to supporting firmware

For controllers that expose built-in sensor options but run firmware without the new type-4 handler, this unconditional option now appears in the sensor popup; selecting it sends sn?t=4, but those firmwares only treat known rain/soil types as stop sensors, so the sensor becomes inert while the UI reports it as Pressure. The other non-legacy sensor types in this helper are guarded by version checks; add an equivalent pressure-support gate before exposing this option.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected in a new commit.

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