Closed shbatm closed 1 year ago
@sirmeili At first glance this appears to be something on the ISY side since the request (the first bold lines) are sent within 100ms each time. Once sent, there's nothing it can do but wait for the ISY to respond.
The only thing I can think of is if the ISY is busy processing something else when the button is pushed. But this looks like an eisy or polisy, and no other traffic in between. Can you check the ISY logs in the Admin Console and see if there's some other errors or messages?
I have tried to check but they don't seem to have any logs related to the rest interface. I can see logs of the devices turning on/off, but that's no helpful if I can't see the logs of the incoming rest requests.
I wasn't sure it was pyisy, I was more thinking HA, but if this won't work I'll have to find another solution outside the isy.
This biggest mystery is why the delay is only ever present in HA automations. Again this might be due to an incoming request when an outgoing is immediately behind it (so could still be on the ISY side).
Thanks for at least checking into it. I'll continue my search.
Have you tried a complete restart of the ISY (Polisy eisy, whatever you're using)? The only thing I can think of is still that the ISY is backlogged on something, usually checking it's own programs' conditions or something.
You can also try using the HACS integration which uses the Alpha-version successor to this module, pyisyox.
I don't see any delays when firing events like this, so I'm not sure what may be causing the delay.
I have tried restarting,updating, etc. Like I said it's only in the automation in ha. I'm going to disable the automation action and open the door and turn on the light manually to see if I still get the delay. Try and limit it to the automation.
Again I can flip lights on/off all day and it's fine but in any automation that includes an isy trigger it exhibits this behavior.
I've run quite a few tests today and I think it is in fact the ISY. I don't know why but any first request can finish in mere MS (like 8-10ms), but if you fire them off in quick succession any subsequent ones take as long as 1.5s (1500ms). I can only assume that it is in fact processing and it just limits it. I never had this problem in HomeSeer when talking to the PLM directly. I may have to see if I can control the PLM directly from HA instead of using the ISY or try the other integration that uses the hub (I think I have a hub or 2 in storage).
I don't get why UD thinks that this is acceptable. the Polisy should be more than powerful enough to handle these requests in quick succession.
I don't think it's this integration, just a limitation of the ISY (at least on the Polisy, I never remember this on my isy994 when I had HomeSeer controlling it, but that was many years ago)
I've run quite a few tests today and I think it is in fact the ISY. I don't know why but any first request can finish in mere MS (like 8-10ms), but if you fire them off in quick succession any subsequent ones take as long as 1.5s (1500ms).
This has always been an issue with Insteon. If your issue command in quick succession the Insteon network is flooded and command are either not delivered, or retries which causes delays and more traffic. You can solve some of these issues by placing the device in a scene and issuing a single command.
I've run quite a few tests today and I think it is in fact the ISY. I don't know why but any first request can finish in mere MS (like 8-10ms), but if you fire them off in quick succession any subsequent ones take as long as 1.5s (1500ms).
This has always been an issue with Insteon. If your issue command in quick succession the Insteon network is flooded and command are either not delivered, or retries which causes delays and more traffic. You can solve some of these issues by placing the device in a scene and issuing a single command.
But this shouldn't be the case in my scenario.
I open a door - the insteon signal is sent to the ISY.... ISy sends it to HA. HS sends a command back to the ISY to send to the device, it takes 1.5s. That's 2 commands. I can do this in the house with no one else home and reproduce it ever time. Even if I don't use an automation.
I've done more testing and I'm more confused than ever. I can send rapid requests and they work, but if I trigger a sensor first, I get delays. So maybe it's the ISY. I'm not sure. Based on the logs from HA it appears it is sending a request and it doesn't get a response for 1.5 seconds.
I've been able to reproduce my issue on the ISY with an ISY program. It appears that at least on my ISY, when a command comes in from a device, it basically is tied up for 1-1.5s until it will accept and process a any other command. This makes little sense to me as the command has already been sent out to HA, so I would think that the ISY is done with any processing.
I have a thread over on the UD forums to see if I can get help over there, but I'm about 99.999999% sure this is on the ISY.
Sorry for the noise.
Just in case you're curious. I also was able to reproduce this in the normal Insteon integration using an insteon hub instead of the ISY/PLM. I get the same 1.5 delay from receiving a signal and sending it.
@sirmeili Thanks for the update. I'm going to close this here since this appears to be an issue on UDI's end.
Discussed in https://github.com/automicus/PyISY/discussions/389