Unfortunately, the RainMachine API doesn’t give endpoints that show consolidated run durations/times for zones (either in the past or the future), nor does it give an endpoint to enable/disable the programs. Bummer.
I’ll keep an eye out and should the API be updated, I’ll happily add to the HASS integration.
UPDATE 1: Well, I might be incorrect. Too early to tell for sure, but there may be a way to do both. Stand by.
UPDATE 2: Turns out that there’s no such concept as a “next run time” for a zone; those belong to programs. My forthcoming PR will add that as an attribute to each program switch. Unfortunately, there’s no obvious place to get a last run time in a way that makes sense.
UPDATE 3: Confirmed that there’s no great way to get last run time/duration… Can’t believe it, but the RainMachine API is weak there.
UPDATE 4: Confirmed that we can enable/disable programs/zones programmatically!
I will keep my eyes on the RainMachine API; as soon as additional functionality comes along that makes your other requests possible, I will implement it.
I’m implementing sw since 20 years in ansi c for microcontrollers and various protocols, unfortunately it would take a quite big effort to dig inside of all those things and be familiar… and the problem of our days… we have not so much time and we have to put priorities…
I have below errors in my log (from the start I have been using this component). Do you have any idea how to resolve? Just to make sure: Rainmachine is available via web interface and app and component seems to be working fine in Hassio (90.2) beside the errors in log
19-03-28 16:02:27 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/regenmaschine/client.py", line 85, in _request
ssl=self._ssl) as resp:
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 1005, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 497, in _request
await resp.start(conn)
File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 844, in start
message, payload = await self._protocol.read() # type: ignore # noqa
File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 588, in read
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/rainmachine/__init__.py", line 191, in refresh
await rainmachine.async_update()
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/rainmachine/__init__.py", line 307, in async_update
'current': await self.client.restrictions.current(),
File "/usr/local/lib/python3.7/site-packages/regenmaschine/restriction.py", line 14, in current
return await self._request('get', 'restrictions/currently')
File "/usr/local/lib/python3.7/site-packages/regenmaschine/client.py", line 90, in _request
'Error requesting data from {0}: {1}'.format(self.host, err))
regenmaschine.errors.RequestError: Error requesting data from 192.168.1.183: None
Unfortunately, no. I, too, have been using the component for a long time and haven’t see this error. I know you can reach the device over your local network; is it possible there was a momentary blip? How frequently do these occur?
They happen every few hours. I have quite a stable network environment (Unifi with several AC Pro’s incl one few meters from the rainmachine). Also never have errors/issues when reaching web interface.
HI,
I saw that they enabled the flow sensor feature for the Touch version and on the API they added those info answering to {{HOST}}/provision?{{ACCESS_TOKEN}}:
“useFlowSensor”: true
“flowSensorStartIndex”: 22
“flowSensorWateringClicks”: 0
“flowSensorClicksPerCubicMeter”: 53000
It would be very nice to have those info available and even better the calculation in of consumed liters.
Following up; I’m seeing these on my side now, but no clue why. Doesn’t seem to affect actual usage. I, too, have Unifi; I wonder if that’s causing something?