djtimca / haomnilogic

Hayward Omnilogic integration for Home Assistant available through HACS
Apache License 2.0
18 stars 6 forks source link

Switches should assume the new state until next refresh #32

Closed cryptk closed 5 months ago

cryptk commented 1 year ago

Currently, when I toggle a switch for a water feature (Jets/Waterfalls/etc) the switch stays at the previous state until the next time the integration polls the omnilogic API. Could these switches assume the new state until the next poll?

This appears to be related to #18 , which was closed saying that the feature was already there, but it does not appear to be working for me. Is there something I need to do in order to have the integration opportunistically assume the new switch position until the next poll?

djtimca commented 1 year ago

Is there a way to share a video / screen capture of what's happening on your switches? The switch entity defined in the integration should optimistically store the state set when you call the turn_on or turn_off command for 30 seconds to compensate for the delay from Hayward's API.

pinsonlawrimore commented 1 year ago

I am also having this issue. When I switch my waterfall on, the state on the dashboard (and when requested via HA API) will show it is off until the next refresh. Of note, I am using the HA API to change the state (with api/services/switch/turn_on, or turn_off).

I've thought about updating my script to also POST to api/states/ to update the state to whichever command I sent while it waits for the next poll interval, but figured I would check in here as well.

joesilva101 commented 1 year ago

Today I added this integration and have been testing it and notice the issue on this thread. I made a short video to help understand what happens A quick sequence of events:

  1. Have split screen on phone with HA and Hayward App (see video)
  2. Turn on one of the relays in HA and the slider shows "ON" for a few seconds and goes off
  3. The actual panel relay remains energized
  4. Hayward App will show "ON" status within a couple of seconds
  5. HA will take about 50-55 seconds to update the "ON" status
  6. For the "OFF" signal HA is immediate, panel relay goes off within a second or two
  7. Hayward App takes about 5-6 seconds to update

https://user-images.githubusercontent.com/77591188/230738591-9c5c99cb-003f-4c84-beea-2ecdead4e47c.mp4

djtimca commented 5 months ago

This is related to the latency of the cloud and the way the Omnilogic API reports status. Nothing I can do on the cloud integration to change this behaviour unfortunately (I've tried).