Hi - I have the following 2 webhooks setup (retrieved using listWebhooks api). The latter one for the controller works well and I receive the notification, however, for the valve, I don’t receive any notification when the valve is turned on / off. The URL for both is the same, so not sure what could be wrong?
Also, the notifications for the controller do not seem to match the “newer” event data format and does not contain a “payload” item. I verified I am using “https://cloud-rest.rach.io/” to setup the webhooks.
Hey @jsjames — thanks for sharing your setup! I had a look at your webhook configuration and I think I see what’s going on.
It looks like you might still have an older webhook registered for your irrigation controller. Does that sound possible? That would explain why you’re seeing the older event format — those events are likely being sent from the legacy webhook rather than the newly configured one.
Regarding the new webhook setup:
I noticed your target URLs are using basic auth. Our new webhook system doesn’t support basic authentication, but it does include HMAC signatures for the payload to help securely validate incoming data.
It looks like you’re using the openHAB cloud connector via myopenHAB. If that system only supports basic auth, you’ll likely need some kind of adapter or intermediary layer that can handle HMAC validation and then forward with basic auth as needed.
Also, are you using a Rachio openHAB binding kind of like this one? If so, it’s possible the binding was written for the older webhook format and might need updates to support the new data.
There might also be other community-created webhook bindings within the openHAB ecosystem that support more configurable webhook integrations which could be worth checking out
I was working on updating the openHAB binding you referenced to support the new webhook api and add support for the smart hose valve. My production setup is still running the existing binding and so what you discovered makes perfect sense.
Not having basic authentication will be a problem for using a generic proxy server like myopenHAB since there won’t be a mechanism to determine where the webhook should be routed. I also know people won’t want to open up ports on their home networks to support webhooks given the security vulnerabilities it creates.
I’ll continue to research options here, but adding the new webhook support might not be possible within the openHAB framework.
I have been working on updating the openHAB Rachio binding to use the new WebhookService API, including the newer controller webhook flow and Smart Hose Timer support.
We have now implemented and tested the new webhook registration method. The binding sends the callback URL to createWebhook in the documented Basic Auth URL format, for example:
https://user:password@host/path
To remove openHAB and myopenHAB from the test path, I tested this with webhook.site. Rachio successfully delivered real webhook events to the public webhook.site URL. The received requests look correct in several ways:
HTTP POST
valid JSON body
expected resourceId
expected externalId
expected resourceType=IRRIGATION_CONTROLLER
events such as DEVICE_ZONE_RUN_STARTED_EVENT, DEVICE_ZONE_RUN_STOPPED_EVENT, and DEVICE_ZONE_RUN_COMPLETED_EVENT
x-signature header is present
However, even when the webhook is registered with a callback URL containing user:password@host, the webhook request sent back by Rachio does not contain an:
Authorization: Basic ...
header.
This is the part that breaks the myopenHAB use case. An unauthenticated POST to home.myopenhab.org/rachio/webhook is rejected by myopenHAB before it reaches openHAB. A manual curl request with Basic Auth does reach the openHAB RachioWebHookServlet, but the real Rachio webhook request does not appear to include the Basic Auth header, so it never reaches the binding servlet.
Could you please confirm what the expected behavior is for the current WebhookService API?
Specifically:
Is Basic Auth via https://user:password@host/path still supported by the new WebhookService API?
If yes, should the delivered webhook request include an Authorization: Basic ... header?
If Basicrachio/webhookis rejected by myopenHAB before it reaches openHAB. A manual curl request with Basic Auth does reach the openHABRach Auth is no longer supported for the new WebhookService API, could the documentation please be updated to clarify that?
Is there any other supported way to provide Basic Auth credentials for webhook callbacks?
At this point, the binding appears to send the webhook registration request in the documented format, and Rachio does deliver the signed webhook event, but the Basic Auth header is missing from the delivered webhook request.