Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rainmachine - anyone else using this?
#1
I Really like the rainmachine touch HD irrigation controller. Been using about 2 years and it works great. App is great and lots of regular software updates/enhancements. Great piece of technology and seems to have a good api

rainmachine touch HD

Rainmachine api
https://support.rainmachine.com/hc/en-us...mation-API

Any chance anyone else using this controller May look to integrate into CQC.

Kevin
_______________
Denon 3808ci, 2112ci ,Sonos, NoVo Grand Concerto, Z-Wave(Lights,Locks), Hue, SmartThings,
iPads,Tivo,Hikvision,Elk-M1,TED5000,Somfy RTS blinds+ZRTSI, Amazon Echos+Dots, Polk XRT12,
Honeywell Wi-Fi 9000, Caleo Wi-Fi Thermostats, Rainmachine
Reply
#2
Dean,
Is there any driver that is close in functionality?(rest api). Maybe I can hack up a quick status screen at least.
https://support.rainmachine.com/hc/en-us...Developers

Also Postman looks interesting... a GUI api development environment for api's.

Kevin
_______________
Denon 3808ci, 2112ci ,Sonos, NoVo Grand Concerto, Z-Wave(Lights,Locks), Hue, SmartThings,
iPads,Tivo,Hikvision,Elk-M1,TED5000,Somfy RTS blinds+ZRTSI, Amazon Echos+Dots, Polk XRT12,
Honeywell Wi-Fi 9000, Caleo Wi-Fi Thermostats, Rainmachine
Reply
#3
The are plenty of REST type drivers. If you go to the driver manifests directory and grep for 80 you'll get the ones that use port 80 which means HTTP. But the Dune and Hue and PurpleAir and VenStar ones come immediately to mind.
Dean Roddey
Explorans limites defectum
Reply
#4
Maybe even the Irrigation Caddy Driver as well, which will do most of the same things from what I could tell looking quickly at the API.  I would be interested in seeing something like this as an alternative to Rain8 and Irrigation Scheduler, which work well, but very susceptible to going offline due to weather, comms, etc.
Reply
#5
(11-26-2019, 06:41 PM)Dean Roddey Wrote: The are plenty of REST type drivers. If you go to the driver manifests directory and grep for 80 you'll get the ones that use port 80 which means HTTP. But the Dune and Hue and PurpleAir and VenStar ones come immediately to mind.

Dune was a little over my head Smile.

Is there a current simple driver that does a post with password to get an access_token like the below?
---------------------

https://support.rainmachine.com/hc/en-us/articles/228022248-Controlling-RainMachine-through-REST-API


[b]For local network access on port 8080 HTTPS or 8081 HTTP:[/b]
[b]- (1) [/b][b]POST[/b] https://rainmachine_ip:8080/api/4/auth/login with body:
{ "pwd": "xxxx", "remember":true}
[b]- [/b][b](2)  [/b]You can now call the RainMachine API with the access_token obtained from above call:
 [b]GET[/b] https://rainmachine_ip:8080/api/4/provision?access_token=....
[b]Important[/b]: When doing POST requests make sure you include "Content-type: application/json" header and POST call has a body. If you are performing a POST without a body make sure you sent "Content-length: 0" header.
 

_______________
Denon 3808ci, 2112ci ,Sonos, NoVo Grand Concerto, Z-Wave(Lights,Locks), Hue, SmartThings,
iPads,Tivo,Hikvision,Elk-M1,TED5000,Somfy RTS blinds+ZRTSI, Amazon Echos+Dots, Polk XRT12,
Honeywell Wi-Fi 9000, Caleo Wi-Fi Thermostats, Rainmachine
Reply
#6
The PurpleAir one is probably of that sort. HTTP is a bit complicated because it's so generalized, but it's not too bad.
Dean Roddey
Explorans limites defectum
Reply
#7
I just checked on their website, and it looks like for my water district, I would be eligible for a 50% rebate.  Guess I know what I am putting on my Christmas list now.  I would also be willing to help with any of the driver development.  I wrote a google calendar driver that uses the OATH authorization, but didn't do it as one driver - I set up the authorization via a python script that authorized it and then generated a JSON file that I parsed and displayed.  I would love to eliminate the python script portion, as I have to run that one as a scheduled task on the master server once per hour, then the calendar driver will update.
Reply
#8
OAuth is pretty horrible for automation systems. It's designed with a 'the world is a phone' view. It works with web applications mostly, which have a UI to do this stuff. For a driver, it has to all happen behind the scenes, which is hard to do, because OAuth wants to send you to a new web page with the results which the user can then do whatever with.
Dean Roddey
Explorans limites defectum
Reply
#9
(11-26-2019, 09:53 PM)kblagron Wrote: Maybe even the Irrigation Caddy Driver as well, which will do most of the same things from what I could tell looking quickly at the API.  I would be interested in seeing something like this as an alternative to Rain8 and Irrigation Scheduler, which work well, but very susceptible to going offline due to weather, comms, etc.

Dean,
Took a quick look at the Irrigation Caddy driver and I can get it to poll the RainMachine. Having an issue with getting the data into a format the driver can parse.
I assume this is my issue in the CML IDE.
If I set a breakpoint below here I don't see any data in the class members tab for m_InStrm or M_JSON. ( assume I need to break out the data items in m_JSON)

(from the irrigation caddy driver code)
Try
            m_InStrm.SetText(m_BodyText);
            m_JSON.ParseResponse(m_InStrm);


Below is what's in (m_BodyText) that is returned by the RainMachine. How do I get the below data into m_JSON so I can parse it with m_JSON.FindValue().


{"system": {"httpEnabled": true, "rainSensorSnoozeDuration": 0, "selfTest": false, "uiUnitsMetric": false, "programZonesShowInactive": false, "localValveCount": 12, "programSingleSchedule": false, "standaloneMode": false, "masterValveAfter": 0, "touchAdvanced": false, "useFlowSensor": false, "useSoftwareRainSensor": false, "defaultZoneWateringDuration": 300, "maxLEDBrightness": 40, "simulatorHistorySize": 0, "vibration": false, "useCorrectionForPast": true, "spk5LockBrightness": 10, "masterValveBefore": 0, "touchProgramToRun": null, "useRainSensor": true, "wizardHasRun": true, "waterLogHistorySize": 365, "netName": "RainMachine", "automaticUpdates": true, "flowSensorLeakClicks": 0, "softwareRainSensorMinQPF": 5, "useBonjourService": true, "hardwareVersion": 3, "touchLongPressTimeout": 3, "showRestrictionsOnLed": false, "parserDataSizeInDays": 6, "programListShowInactive": true, "parserHistorySize": 365, "flowSensorStartIndex": 0, "allowAlexaDiscovery": false, "maxZoneDuration": 86400, "minLEDBrightness": 0, "minWateringDurationThreshold": 30, "simulatorSkipRunSoonDynamic": 43200, "touchSleepTimeout": 10, "lastLeakDetected": null, "touchAuthAPSeconds": 60, "carryOverInRestriction": false, "useCommandLineArguments": false, "flowSensorClicksPerCubicMeter": 2640, "databasePath": "/rainmachine-app/DB/Default", "touchCyclePrograms": true, "dedicatedMasterValve": false, "flowSensorWateringClicks": 0, "zoneListShowInactive": true, "rainSensorRainStart": 1574266098, "zoneDuration": [300, 1200, 1200, 1200, 1200, 1200, 1200, 300, 300, 300, 300, 300], "spk5TouchSleepTimeoutNight": 0, "rainSensorIsNormallyClosed": true, "spk5LCDBrightness": 50, "useMasterValve": true, "runParsersBeforePrograms": true, "spk5LEDBrightness": 15, "maxWateringCoef": 1.5, "mixerHistorySize": 365}, "location": {"elevation": 71.508148193400004, "doyDownloaded": true, "zip": null, "windSensitivity": 0.5, "krs": 0.17999999999999999, "stationID": 4679, "stationSource": "station", "et0Average": 5.742, "latitude": 40.845680000000002, "state": "Default", "stationName": "LITTLE FALLS", "wsDays": 2, "stationDownloaded": true, "address": "Default", "rainSensitivity": 0.80000000000000004, "timezone": "America/New_York", "longitude": -74.190562999999997, "name": "111 Heller Way, Montclair, NJ 07043, USA"}}
_______________
Denon 3808ci, 2112ci ,Sonos, NoVo Grand Concerto, Z-Wave(Lights,Locks), Hue, SmartThings,
iPads,Tivo,Hikvision,Elk-M1,TED5000,Somfy RTS blinds+ZRTSI, Amazon Echos+Dots, Polk XRT12,
Honeywell Wi-Fi 9000, Caleo Wi-Fi Thermostats, Rainmachine
Reply
#10
Not sure if you have ever used this, but I use it to make sure the json is properly formatted ->  https://jsoneditoronline.org/.  It also allows you to see the objects, names, etc. easily, and build the data using an easier to read layout.

As far as your question, the driver I built does not show any data either on those fields when you set a break point and then click on them.  I get a message "Information could not be obtained for this object", but the data is there, even with that message on both of those.  

Once you get to the point you are at, then assign the root anchor:

m_JSON.GetRootAnchor(m_MsgRoot);

Then go searching for the data you need.  Below I assigned a local variable "SystemJSON" as a JSONAnchor type, and then in the body execute this to get the first object in your JSON parse (The "0" reads the first one listed):

m_JSON.GetChildAt(m_MsgRoot, 0, SystemJSON);

Use the JSON Editor to see the fields loaded into SystemJSON easily.  So for yours, if you want to know the number of valves in your system, add a Local Vaiable named NumValves as a Card4 Type, then execute this:

NumValves := m_JSON.FindCardValue(SystemJSON,"localValveCount",False,0);

If you break it after that one, you can then check your Method Locals and see if "NumValves" is showing a value of 12.  If it is, you know the JSON is being parsed properly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)