[rachio] Initial contribution - #21081
Conversation
|
I am running your latest binding with the openHAB cloud webhook and it is working as expected. One suggestion for is to add something to the UI for the cloud thing with the url for the webhook. Also, there is a bit of inconsistency with the value of the items for the controller. There is a mix of undefined, empty strings and no value:
|
|
The forecast is completely wrong. Per Google, the forecast for today is high - 88 °F, low - 69 °F, precipitation 35%, wind 14 mph This is what it is returning, notice the date is in the future. It's June 30, 2026: Rachio Weather Forecast
|
For the Cloud Thing UI: I added webhook diagnostic properties to make the active webhook state visible from the Thing page. The Cloud Thing now exposes the webhook mode, registration state, last registration attempt, last the Cloud Thing UI: I added webhook diagnostic properties to make the active webhook state visible from the Thing webhook event timestamp and last webhook event type. In my runtime test this shows the expected cloud mode, registered state, and the latest accepted Rachio webhook event. For the controller channel state inconsistency: I found and fixed the mixed optional-state handling. The controller optional status channels were previously using a mix of UNDEF, NULL and empty strings depending on the code path. I changed those optional controller values so that a normal absence of data now uses NULL consistently. UNDEF is now reserved for invalid nonblank DateTime values. This applies to:
The events.log confirms the change. In idle state the previously inconsistent controller fields now update to NULL. For example, current-schedule-name/type/start/end change from UNDEF to NULL, active-zone fields update to NULL, and last-skip fields also change to NULL. The same log also confirms that when a Zone 7 Quick Run starts, the active-zone fields are populated again and the current schedule fields change from NULL to actual values such as Quick Run, MANUAL, start time, end time, 60 s duration and running=ON. I also kept current-schedule-running as a real ON/OFF state and current-schedule-duration as 0 s while idle. |
|
Unable to build with the latest code changes: |
|
Thanks, I fixed the failing test. The failure was caused by a timezone-dependent test fixture. The test used I made the fixture deterministic by adding an explicit forecast date ( We had also problem with forecasted wind unit handling when it was translated from kpm to kph. I have fixed it in this commit as well. |
|
I'm seeing in |
|
Warning that modern webhook registration failed, but webhook delivery still appears to work. This is possible when webhook is not cleared / renewed. Clear all callbacks option is there for a previously registered matching webhook may still exist on the Rachio side and continue to deliver events. The failed call may have been only a registration/renewal attempt, not the active webhook itself becoming invalid. The Cloud Thing still shows cloud webhook mode and the last webhook event timestamp/type continue to update. Polling also remains active as fallback. I did try on both webhooks function legacy and new on Opehab 5.2 and 5.1.4 and both was working on 5.2 and legacy was working on 5.1.4. I was starting to use with clear webhook function always at the beginning. |
|
Shouldn't the binding first look to see if the binding has a registered webhook and then try to register if there isn't one? The warning message should not be displayed. |
|
Yes, I agree. I updated this. The modern webhook registration path is intended to be idempotent: list existing webhooks first, retain a matching registration if present, and only create a new one if no matching webhook exists. The warning was misleading when a previous matching webhook could still be active and webhook events were still arriving. I adjusted the log/state handling so a failed later verification/renewal attempt after a previous successful registration is treated as non-fatal, with polling still active as fallback. A warning should now be reserved for cases where no known existing registration is available and the binding really fails to establish/verify the webhook. |
|
I'm still getting the error: I figured out what is going on. I have access to a second controller that is controlled by somebody else which is not configured (its ignored in the Things inbox), and it's trying to register a webhook for it, which it shouldn't. I used Atmosphere CLI to check the webhooks and here's what it reported about it: Device: Rachio (ID: xxxxx )• Status: Shared device (Owned by user ID: yyyyyy ). |
|
Thanks a lot, that completely explains the warning you were seeing. The bridge webhook sync was accidentally pulling the entire account device list. This meant it was trying to register shared controllers or devices that weren't even configured as openHAB things yet. Rachio lets you see shared controllers, but throws a 403 permission_denied error if you try to touch their webhooks—exactly what you saw in the Atmosphere CLI. I've tweaked the logic so webhooks only apply to active, configured controllers now. Anything ignored in the inbox or left unconfigured will be completely skipped. If no controllers are ready, the bridge will just say waiting for configured controller things instead of trying to register the whole account. Discovery and polling work exactly the same as before; this just fixes the webhook scope. |
|
Looks good now. My only suggestion is to fix the deprecation warnings during compilation. I'll leave it up to the maintainers to do the code review. |
|
I cleaned up the compile warnings. |
wborn
left a comment
There was a problem hiding this comment.
Thanks for the big PR!
To fix the build error, please add the add-on to: https://github.com/openhab/openhab-addons/blob/main/bom/openhab-addons/pom.xml
Too bad Copilot currently cannot help with reviewing. That would significantly speed up the review process. Maybe temporarily removing the test code brings it below 20000 lines? 🙃
|
Thanks, I pushed two follow-up commits. The first commit addresses the InfluxDB persistence/chart issue reported by Jeff. The second commit adds If necessary for copilot, I can remove test folder, pls let me know. |
e57e3cc to
4029ef6
Compare
Signed-off-by: Kovacs Istvan <kovacs.istvan77@google.com>
|
Addressed in commit 2a94bd6. |
wborn
left a comment
There was a problem hiding this comment.
Thanks for addressing the remaining feedback. AI re-reviewed the current PR head and the previous concerns now look resolved.
Could you also add back the tests that were removed earlier? They provided useful coverage and should remain part of the contribution.
The code still needs a final manual review before this can be considered ready to merge.
Signed-off-by: Kovacs Istvan <kovacs.istvan77@google.com>
|
I’ve restored the Rachio test folder and updated them to match the current implementation in c28e962. This commit only restores and updates files under the Rachio src/test directory; no production code was changed. |
|
Did you see that the tests are falling? |
|
No. I've just realized. Previously both tests were green. I'll check. |
Signed-off-by: Kovacs Istvan <kovacs.istvan77@google.com>
|
Quick follow-up on the failed Ubuntu CI run: I traced it to a timing race in Commit Validation is green locally:
Only the Rachio test file changed; production code is untouched. |
wborn
left a comment
There was a problem hiding this comment.
AI re-reviewed the current PR head after the tests were restored.
The restored test suite is a substantial improvement and now provides useful regression coverage for the concurrency and lifecycle issues raised earlier, including immutable discovery snapshots, webhook request/removal serialization, stale event claims, and zone reconciliation.
I found two remaining implementation concerns and one cleanup issue below. The code still needs a final manual review before it can be considered ready to merge.
Signed-off-by: Kovacs Istvan <kovacs.istvan77@google.com>
Signed-off-by: Kovacs Istvan <kovacs.istvan77@google.com>
wborn
left a comment
There was a problem hiding this comment.
AI re-reviewed the current PR head after the latest fixes.
The previously raised concerns have been addressed:
- Cloud webhook provider changes are now coalesced correctly while reconciliation is already running, including a deterministic regression test covering a provider change during an active reconciliation pass.
- The binding now uses openHAB's shared Jetty
HttpClientthroughHttpClientFactoryfor both the Rachio API and image proxying, with focused transport and error-handling tests. - The restored test sources now use the actual author instead of the
openHAB Contributorsplaceholder.
The restored and newly added tests provide good coverage of the concurrency, lifecycle, webhook, HTTP transport, discovery snapshot, and handler behavior discussed during the earlier reviews. The current CI build is also green.
AI found no further issues in the current changes.
A final human maintainer review is still needed before merging.
Previous AI review concerns have been addressed. Human maintainer review is still required.
|
Great! Now we need to find some humans who want to review ~30k lines of AI generated and reviewed code. 😄 |
|
Just to clarify the size and the AI point: this is a complete new binding covering controllers, zones, schedules, Smart Hose devices, discovery, webhooks, metadata, and extensive regression tests. Contains much more functions then the original Rachio binding. Of the roughly 30k lines, about 11.5k are tests and 1.9k are resources. I wrote the binding itself; I used Copilot later as an additional review tool to surface edge cases and the kinds of issues automated review might flag, then verified and tested the resulting changes. |
robnielsen
left a comment
There was a problem hiding this comment.
Here are a few quick code review recommendations and suggestions for minor polish:
Signed-off-by: Kovacs Istvan <kovacs.istvan77@google.com>
That sounds very comprehensive and also explains why the PR has become so large. Regarding AI, I think we should all be making use of it nowadays where it helps us become more productive. Could you update the PR description with a short summary of what the binding now provides, and add a link to the Rachio community discussion? It would also be nice to provide a JAR with the latest changes so users can easily test all the latest changes. I'll also give it a try myself when I find some time, although I don't have any Rachio devices to test the actual device integration with. |
I have edited the description of the PR added summarized info of binding functionality. |
|
I just noticed this in my There are 34 places where INFO logging is occurring, these all should be changed to DEBUG. |
|
Thanks Rob, |
Signed-off-by: Kovacs Istvan <kovacs.istvan77@gmail.com>
04cd9dd to
77d1795
Compare


This is a clean replacement for #20793 with the same final Rachio binding content.
Racho Binding Functionality Overview:
The Rachio binding integrates Rachio Smart Irrigation Controllers and Smart Hose Timer resources with openHAB through the Rachio Cloud APIs. A cloud bridge represents a Rachio account and automatically discovers controllers, irrigation zones, fixed and Flex schedules, Smart Hose Timer base stations, valves, and valve programs.
For irrigation controllers, the binding exposes controller availability and operating state, rain sensor and rain-delay information, paused and active watering state, current schedule details, recent API events, weather skips, and forecast data. Controllers can be enabled or disabled, stopped, rain-delayed, paused or resumed, and used to run either individual or multiple zones.
Irrigation zones expose their enabled and watering states, runtime information, last-watered time, water-model values, and zone images. Zones can be enabled or disabled, started and stopped, and supplied with runtime or soil-moisture commands.
Fixed and Flex schedules are represented as separate Things. Their state, associated zones, previous and upcoming runs, and seasonal adjustment are available. Supported commands include starting or skipping a schedule, changing its seasonal adjustment, and skipping the currently running zone.
Smart Hose Timer support includes base-station and valve status, valve battery and flow state, manual watering, default runtime configuration, previous and upcoming watering summaries, program metadata, and commands for creating or canceling skips for upcoming runs.
State is synchronized through polling, with optional modern signed webhooks for near-real-time irrigation and Smart Hose Timer updates. Legacy Rachio notifications remain available as an alternative for irrigation controllers.
Potential Future Development:
The current implementation covers the practical automation surface of the Smart Irrigation Controller and Smart Hose Timer APIs. If there is user demand, future development could add Smart Lighting Controller support, optional creation and editing of Smart Hose Timer programs, Property/Home-based resource grouping, and additional telemetry such as dedicated controller flow-volume channels and richer zone metadata.
Community thread link:
https://community.openhab.org/t/rachio-smart-sprinkler-controller/7078
Link for latest JAR:
https://github.com/kovacsi2899/openhab-addons/releases/tag/PR_review_09_08_2026