Rachio Smart Sprinkler Controller

I entered that RANDOMNUMBER myself. Not sure if it was wise to put the real number so I just masked it. I did the same here but made it look similar to what is really there. again one can never be too safe …

2018-04-20 23:07:00.761 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand ON for rachio:zone:1:0C3B70193560-1:run
2018-04-20 23:07:00.762 [INFO ] [ing.rachio.handler.RachioZoneHandler] - RachioZone: Starting zone 'Pool Zone [1]' for 0 secs
2018-04-20 23:07:00.763 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone: No specific runtime selected, using default (120 secs);

==> events.log <==
2018-04-20 23:07:00.763 [ome.event.ItemCommandEvent] - Item 'IRO1PoolZone_RunZone' received command ON

==> openhab.log <==
2018-04-20 23:07:00.763 [DEBUG] [inding.rachio.internal.api.RachioApi] - RachioApi: Start zone '7d2dcc70-f11c-42bc-92b2-6df87684a971' for 120 sec.

==> events.log <==
2018-04-20 23:07:00.765 [vent.ItemStateChangedEvent] - IRO1PoolZone_RunZone changed from OFF to ON

==> openhab.log <==

2018-04-20 23:07:01.287 [ERROR] [inding.rachio.internal.api.RachioApi] - RachioApi: Running zone '7d2dcc70-f11c-42bc-92b2-6df87684a971' for 120sec failed: can't parse argument number: 

you need to update the binding

where did you pit the RANDOMNUMBER?

you just need to click Run on the zone level

Markus,

I used that last binding and this is the outcome. Still no update to the switch when finished but it does look like all the errors are gone.

Also Markus for the rachio debug, I am assuming I should use this below correct?

openhab> log:set debug org.openhab.binding.rachio

Here are my logs…

==> events.log <==
2018-04-21 07:12:49.702 [ome.event.ItemCommandEvent] - Item 'IRO1PoolZone_RunZone' received command ON

==> openhab.log <==
2018-04-21 07:12:49.703 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand ON for rachio:zone:1:0C3B70193560-1:run
2018-04-21 07:12:49.704 [INFO ] [ing.rachio.handler.RachioZoneHandler] - RachioZone: Starting zone 'Pool Zone [1]' for 60 secs

==> events.log <==
2018-04-21 07:12:49.707 [vent.ItemStateChangedEvent] - IROGongora1PoolZone_RunZone changed from OFF to ON

==> openhab.log <==
2018-04-21 07:12:49.708 [DEBUG] [inding.rachio.internal.api.RachioApi] - RachioApi: Start zone '7d2dcc70-f11c-42bc-92b2-6df87684a971' for 60 sec.


I updated the binding to fix the run multiple zones (having 0, 1 or multiple zones listed).
https://github.com/markus7017/org.openhab.binding.rachio/blob/master/target/org.openhab.binding.rachio-2.3.0-SNAPSHOT.jar

you should see messages like:

2018-04-21 08:17:27.984 [vent.ItemStateChangedEvent] - RachioTurtlePineHouse1Zone1FrontYard_RunZone changed from OFF to ON
2018-04-21 08:17:27.988 [vent.ItemStateChangedEvent] - RachioTurtlePineHouse1Zone1FrontYard_LastZoneEvent changed from {"timetstamp":"2018-04-21T12:14:04Z","summary":"Zone 1 - Front Yard stopped watering at 08:14 AM (EDT) for 26 seconds.","topic":"","type":"ZONE_STATUS","subType":"ZONE_STOPPED"} to {"timetstamp":"2018-04-21T12:16:05Z","summary":"Zone 1 - Front Yard began watering at 08:16 AM (EDT).","topic":"","type":"ZONE_STATUS","subType":"ZONE_STARTED"}
2018-04-21 08:19:00.776 [INFO ] [ing.rachio.handler.RachioZoneHandler] - RachioZone: Event for zone[2] 'Zone 2 - Pool Front': Zone 2 - Pool Front began watering at 08:18 AM (EDT). (status=STARTED, duration = 120sec)
2018-04-21 08:19:00.779 [INFO ] [ing.rachio.handler.RachioZoneHandler] - RachioZone[2]: 'Zone 2 - Pool Front' STARTED watering (2018-04-21T12:18:05Z).
2018-04-21 08:19:00.805 [INFO ] [ing.rachio.handler.RachioZoneHandler] - RachioZone: Event for zone[1] 'Zone 1 - Front Yard': Zone 1 - Front Yard completed watering at 08:18 AM (EDT) for 2 minutes. (status=COMPLETED, duration = 120sec)
2018-04-21 08:19:00.813 [INFO ] [ing.rachio.handler.RachioZoneHandler] - RachioZone[1]: 'Zone 1 - Front Yard' STOPPED watering (2018-04-21T12:18:04Z).
2018-04-21 08:19:00.814 [vent.ItemStateChangedEvent] - RachioTurtlePineHouse2Zone2PoolFront_RunZone changed from NULL to ON
2018-04-21 08:19:00.823 [vent.ItemStateChangedEvent] - RachioTurtlePineHouse2Zone2PoolFront_LastZoneEvent changed from NULL to {"timetstamp":"2018-04-21T12:18:05Z","summary":"Zone 2 - Pool Front began watering at 08:18 AM (EDT).","topic":"","type":"ZONE_STATUS","subType":"ZONE_STARTED"}
2018-04-21 08:19:00.847 [vent.ItemStateChangedEvent] - RachioTurtlePineHouse1Zone1FrontYard_RunZone changed from ON to OFF
2018-04-21 08:19:00.856 [vent.ItemStateChangedEvent] - RachioTurtlePineHouse1Zone1FrontYard_LastZoneEvent changed from {"timetstamp":"2018-04-21T12:16:05Z","summary":"Zone 1 - Front Yard began watering at 08:16 AM (EDT).","topic":"","type":"ZONE_STATUS","subType":"ZONE_STARTED"} to {"timetstamp":"2018-04-21T12:18:04Z","summary":"Zone 1 - Front Yard completed watering at 08:18 AM (EDT) for 2 minutes.","topic":"","type":"ZONE_STATUS","subType":"ZONE_COMPLETED"}
2018-04-21 08:20:20.919 [INFO ] [ing.rachio.handler.RachioZoneHandler] - RachioZone: Event for zone[2] 'Zone 2 - Pool Front': Zone 2 - Pool Front completed watering at 08:20 AM (EDT) for 2 minutes. (status=COMPLETED, duration = 120sec)

Do you see the last zone/device event in PaperUI->Control?
If those are empty after a zone action you are defiantly not receiving the events. In this case check again your router setup.

You should see way more messages when debug is turned on
open the openHAB console (ssh openhab@ip_address -p 8108) and enter:

log:set DEBUG org.openhab.binding.rachio  

Markus I just entered that RANDOMNUMBER stuff here on the forum not on my setup. I do have real information on the logs… I just don’t know if anyone can do anything malicious with that info so it was my attempt at covering it up… Sorry for the confusion.

ok new binding updated.

openhab> bundle:list | grep Rachio                                                                                                                                                                      
249 │ Active   │  80 │ 2.3.0.201804211217     │ Rachio Binding

I made sure I had the debug command in karaf . I am not sure if it took last time as I noticed I put DEBUG in lower case. ( not sure if that makes a difference)

In paper UI I changed the ZoneRuntime for Pool Zone to 68 and then I clicked on Run Zone. Here is the output of that. I am still not getting the switch to update when it is done.

==> events.log <==
2018-04-21 09:25:47.835 [vent.ItemStateChangedEvent] - IRO1PoolZone_ZoneRuntime changed from 0 to 68

==> openhab.log <==
2018-04-21 09:25:54.726 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand ON for rachio:zone:1:0C3B70193560-1:run
2018-04-21 09:25:54.727 [INFO ] [ing.rachio.handler.RachioZoneHandler] - RachioZone: Starting zone 'Pool Zone [1]' for 68 secs

==> events.log <==
2018-04-21 09:25:54.727 [ome.event.ItemCommandEvent] - Item 'IRO1PoolZone_RunZone' received command ON

==> openhab.log <==
2018-04-21 09:25:54.727 [DEBUG] [inding.rachio.internal.api.RachioApi] - RachioApi: Start zone '7d2dcc70-f11c-42bc-92b2-6df87684a971' for 68 sec.

==> events.log <==
2018-04-21 09:25:54.730 [vent.ItemStateChangedEvent] - IRO1PoolZone_RunZone changed from OFF to ON

And this is what I see when I visit the webhook from within my network and outside as well. I changed my domain to redacted.com just for this forum post that’s not the real domain name…

And no I do not see the Last Zone Event update at all.

do you see other messages in the log?

fyi: if you leave the runtime empt or set to 0, it will autom. take the defaultRuntime

did you chechked with the above curl command?

I do not see anything in the log.

Im not sure if I did this right but see below.

$ curl -IS https://mqtt.rach.io
curl: (51) SSL: certificate subject name (*.iot.us-west-2.amazonaws.com) does not match target host name 
'mqtt.rach.io'

looks to me like a cert issue but on the rachio side?

I’m referring to the following section of the README:

you could verify the proper registration of the callback after the binding is initialized

get the deviceId for the controller from the Rachio log entries
open a terminal window and run
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxx-xxxx-xxxx-xxxx-dc8d5c90350d" https://api.rach.io/1/public/notification/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyy/webhook
replace xxxxxxxx-... with the apikey and yyyyyyyy... with the device id found in the OH log

you should see the configured url

all I get as a response is []. Weird because when I initialize it shows the webhook url and it is correct. Quick question, when I stated working with I remember reading about a rachio service file. I still don’t have that set up. Could that be the issue or would the things file take care of that?

nope, the rachio.cfg will supply global defaults, so you don’t need to set it for every thing.

please do the curl stuff mentioned above, we need to male sure that the webhook registration works fine. I could provide you the exact command if you send me your apikey and domain by email.

and we need the debug log - anything changed since you entered the log:set command?

I’m sure this is a tiny thing, which breaks the events coming through :wink:

ok, I am pretty sure that I have the URL call correct because I tried putting in a fake number just to see what happened and it returned an error. When I put my apikey and deviceid, it just returns"[]".

Here is my log after I make a small change to the things file just to make it restart. All I changed was the location that makes it appear on a different tab in my paper ui control page.


2018-04-21 20:37:07.151 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'rachio.things'
2018-04-21 20:37:07.167 [DEBUG] [rachio.internal.RachioHandlerFactory] - RachioHandlerFactory: Registering Rachio discovery service
2018-04-21 20:37:07.168 [DEBUG] [nal.discovery.RachioDiscoveryService] - Rachio: thing types: [rachio:device, rachio:zone, rachio:cloud] registered.
2018-04-21 20:37:07.169 [DEBUG] [org.openhab.binding.rachio          ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=468, service.bundleid=249, service.scope=singleton} - org.openhab.binding.rachio
2018-04-21 20:37:07.171 [DEBUG] [org.openhab.binding.rachio          ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.core.status.ConfigStatusProvider}={service.id=469, service.bundleid=249, service.scope=singleton} - org.openhab.binding.rachio
2018-04-21 20:37:07.175 [DEBUG] [.rachio.internal.RachioConfiguration] -   pollingInterval=180
2018-04-21 20:37:07.175 [DEBUG] [.rachio.internal.RachioConfiguration] -   defaultRuntime=120
2018-04-21 20:37:07.176 [DEBUG] [.rachio.internal.RachioConfiguration] -   callbackUrl=https://my.domain.com:64227/rachio/webhook
2018-04-21 20:37:07.176 [DEBUG] [.rachio.internal.RachioConfiguration] -   clearAllCallbacks=true
2018-04-21 20:37:07.176 [DEBUG] [.rachio.internal.RachioConfiguration] -   apikey=xxxxxx-xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx
2018-04-21 20:37:07.176 [DEBUG] [g.rachio.handler.RachioBridgeHandler] - RachioBridge: Connecting to Rachio cloud
2018-04-21 20:37:07.491 [DEBUG] [inding.rachio.internal.api.RachioApi] - Using personId 'yyyyyy-yyyyyyy-yyyyyyy-yyyyyyy-yyyyyyy'
2018-04-21 20:37:07.779 [INFO ] [g.rachio.handler.RachioBridgeHandler] - RachioCloud: Cloud connector initialized.
2018-04-21 20:37:07.793 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone: Initializing zone 'rachio:zone:1:zzzzzzzzzzzz-2'
2018-04-21 20:37:07.793 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone: Initializing zone 'rachio:zone:1:zzzzzzzzzzzz-1'
2018-04-21 20:37:07.797 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-2:name
2018-04-21 20:37:07.797 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-2:number
2018-04-21 20:37:07.799 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-2:enabled
2018-04-21 20:37:07.800 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-2:run
2018-04-21 20:37:07.801 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-2:runTime
2018-04-21 20:37:07.801 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-2:runTotal
2018-04-21 20:37:07.802 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-2:imageUrl
2018-04-21 20:37:07.802 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-2:zoneEvent
2018-04-21 20:37:07.803 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-1:name
2018-04-21 20:37:07.807 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-1:number
2018-04-21 20:37:07.809 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-1:runTime
2018-04-21 20:37:07.809 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-1:runTotal
2018-04-21 20:37:07.809 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-1:imageUrl
2018-04-21 20:37:07.809 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-1:zoneEvent
2018-04-21 20:37:07.808 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-1:enabled
2018-04-21 20:37:07.809 [DEBUG] [ing.rachio.handler.RachioZoneHandler] - RachioZone.handleCommand REFRESH for rachio:zone:1:zzzzzzz-1:run
2018-04-21 20:37:08.792 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'rachio.things'

from one of the logs …

2018-04-17 21:31:17.869 [DEBUG] [nal.discovery.RachioDiscoveryService] - RachioDiscovery: Check Rachio device with ID ‘wwwwwww-wwwwwww-wwwwwww-wwwwwww-wwwwwww’

This is what I am using where Xxxx-xxx… is the api key and wwwwwww-wwwwwww… is the deviceID

curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxx-xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx" https://api.rach.io/1/public/notification/wwwwwww-wwwwwww-wwwwwww-wwwwwww-wwwwwww/webhook

Hi, running the following commmand (after editing the ids)

curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 8e600a4c-0027-4a9a-9bda-dc8d5c90350d" https://api.rach.io/1/public/notification/2a5e7d3c-c140-4e2e-91a1-a212a518adc5/webhook

replace '8e600a4c-0027-4a9a-9bda-dc8d5c90350d' by your appkey and
'2a5e7d3c-c140-4e2e-91a1-a212a518adc5' by your device id.

should bring up something similar to

[{"id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx","url":"http://mydomain.com:55555/rachio/webhook","eventTypes":[{"name":"ZONE_DELTA","type":"WEBHOOK"},{"name":"RAIN_DELAY","type":"WEBHOOK"},{"name":"ZONE_STATUS","type":"WEBHOOK"},{"name":"WEATHER_INTELLIGENCE","type":"WEBHOOK"},{"name":"DEVICE_STATUS","type":"WEBHOOK"},{"name":"SCHEDULE_STATUS","type":"WEBHOOK"},{"name":"DELTA","type":"WEBHOOK"}],"externalId":"347f20a6c7877b1047c8c25843d09bcd"}

Check the url if you just see ‘[]’ (use ‘https://api.rach.io/1/public/notification/xxxxxxxx-xxxx-xxxx-xxxxxxxx/webhook’, not your webhook url). The command queries the currently registered webhooks directly from the cloud.

I am using a secure server on my end. Do you think that could be it? My address is https://mydomain.com/rachio/webhook

yep, https is not yet supported (see Security section in README)
I’m working on this, but for know jetty rejects the certificate (which means the inbound https requests gets dropped).
I did a lot of security functions inside the bundle. All Ids are useless if you don’t have the apikey. The communication is filtered by various network level thins (AWS ip address range - ip filter list gets loaded dynamically, http, right URI) and the externalId, which is a hash code generated by the binding. So appkey gets transmitted via https, but will not be visible in the http inbound webhook call.

I don’t like this status, but I think it’s safe to use. I’m still in discussion with Rachio, because of the inbound certificate.

Try to set a call back without https.

I updated the README to reflect the current status - sorry for confusion.

I tried without the https but still get the empty brackets. []

what is the output of the curl command?

same thing … just []

$ curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxx-xxxxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx" https://api.rach.io/1/public/notification/yyyyyyy-yyyyyyy-yyyyyyy-yyyyyyy/webhook
[]

please turn debugging to TRACE, we need to find out why the hook is not registered

ok its done… Hmm based on the below I am thinking it may have something to do with my reverse proxy setup.

2018-04-22 21:20:57.862 [TRACE] [io.internal.api.RachioWebHookServlet] - RachioWebHook: Reqeust from 192.168.1.2:45696/rachio/webhook (192.168.1.2, HTTP/1.1)
2018-04-22 21:20:57.864 [TRACE] [io.internal.api.RachioWebHookServlet] - RachioWebHook: Data=''
2018-04-22 21:20:57.865 [DEBUG] [io.internal.api.RachioWebHookServlet] - RachioWebHook: Unable to process inbound request, data=''

I am not sure where that port number is coming from. The IP denoted there is for the machine I use that performs a reverse proxy and not the actual openhab machine.

My nat goes to the machine that has the reverse proxy and that redirects it to my openhab box if it hits the desired port. Its looking like I may need to nat that port as well but where is that port number coming from?