haomnilogic icon indicating copy to clipboard operation
haomnilogic copied to clipboard

Implement Local API

Open MHillyer opened this issue 2 years ago • 15 comments

Two days in a row the Hayward API has been offline, affecting both this integration and the Hayward app.

IIRC there was mention of a local API, opening this as a request to implement it.

It could also help with all the API latency issues Hayward has.

MHillyer avatar Jun 17 '22 19:06 MHillyer

Definitely on my list of improvements to come... but will be a while - this is a much bigger build. Thanks for opening so I can track!

djtimca avatar Jun 17 '22 19:06 djtimca

Initial thought is to extend the existing API to support both local and cloud integrations and return identical data in either case which will allow optional local/cloud configuration in the Home Assistant integration.

Should be a smaller change on the HA side once the API side work is done. API development to be tracked under issue: https://github.com/djtimca/omnilogic-api/issues/27

djtimca avatar Jun 23 '22 14:06 djtimca

Their servers were down again this morning and I found myself running the pool from the control panel. I'm happy either way if it results in less dependency on Hayward. They already discontinued Google Assistant integration, but thanks to you I have it via HASS, so I appreciate your work!

MHillyer avatar Jun 23 '22 14:06 MHillyer

@MHillyer it seems your connection goes down a lot more than mine. I had a couple outages at the beginning of the summer, and there is a firmware update to solve that. I haven't had any issues on the cloud over the past few weeks though. Could it be either a firmware update you need to run or a network connection issue that is preventing access from OmniLogic to the cloud? (Not sure if anyone else has similar challenges, but I'm not seeing it).

Just want to make sure it's not a network issue which the local API won't solve.

djtimca avatar Jun 23 '22 14:06 djtimca

Just adding that I haven't noticed any frequent connection issues either. Just like djtimca, just a few at the beginning of the season, though it's been solid over the last few weeks. I've also kept up to date with firmware updates.

N3rdP1um23 avatar Jun 23 '22 14:06 N3rdP1um23

I can't see a firmware update helping, because it's my Hayward app even saying "server is unavailable" which to me means the backend service. It's a problem with getting to the cloud, not getting the omni panel to talk to the cloud. And yeah, odd that it's affecting me more than others, when there's an outage I even turn off wifi to connect via cellular and still have the issue.

MHillyer avatar Jun 23 '22 15:06 MHillyer

I’ve had several timeouts in the last day.

sddgit avatar Jun 24 '22 01:06 sddgit

The cloud connection from the controller to the cloud seems to be very slow at some times. Even trying to change speeds or water features from the Hayward website exhibits this behavior,. Even after the firmware updates. Just yesterday it took so long to operate the valves from home assistant the slider button turned on and then turned off... After a couple tries it finally opened.. Ive went so far to install a direct connection to ensure it wasn't a wifi connectivity issue. I would like to support local control,. But I don't have coding skills... I could buy a drink. I know it's all about finding time. Good luck.

Paulbhyo avatar Jul 23 '22 12:07 Paulbhyo

Agree that the cloud is very slow sometimes. This will likely take a long time to implement but I am trying to find cycles to figure it out. Very early stages still (still no success even manually getting responses from my OmniLogic controller) but I will keep at it!

djtimca avatar Jul 23 '22 12:07 djtimca

I would bet that there need to be a sign in or trust relationship with the MSP prior to it accepting random commands from Ethernet. The wifi accessory remote,. It shows up in the device list on the MSP based on the description in the manual.( I don't have one, but maybe someone does that can use Wireshark to find out what it does?) Reading through the wifi remote manual, it seems to autodiscover.. there isn't any mention of a login.

Paulbhyo avatar Jul 23 '22 13:07 Paulbhyo

Yes - I have the full documentation but the challenge so far is the UDP protocol which isn't easily done (or at least I can't find great examples) in Python. Will keep trying though (and Hayward is providing some support as well)

djtimca avatar Jul 23 '22 13:07 djtimca

@djtimca You have local API documentation? I can help writing UDP stuff. If you can share API docs, that would be great. If not, tell me what you need, and I'll try to code up some examples. (I have a Omnilogic controller, but not the Wifi Controller).

garionphx avatar Jul 30 '22 21:07 garionphx

@garionphx would love some help on the UDP part - main challenge right now is constructing the header/payload I think. If you can join the Slack group where we've been collaborating on development I'd be happy to share progress etc there. (Can't publish the docs here).

https://join.slack.com/t/hersh-group/shared_invite/zt-1dnpni65e-yelZlNc2jbI3KG2iYq_vEA

djtimca avatar Aug 03 '22 17:08 djtimca

@djtimca I can help with the UDP side, any updates on this initiative?

apizzi69 avatar Dec 22 '22 03:12 apizzi69

@djtimca Did you make any movement on the UDP for Python?

apizzi69 avatar Jan 10 '23 22:01 apizzi69