Weird questions - Use case for additional programming in place to increase reliability

Given:

  • I have Yolink Motion sensors and a variety of devices they end up activating via Home Assistant and the Yolink integration.

  • I had actually started buying and using Yolink devices befroe their integration was even available for Home Assistant. For the motion sensors to reach home assistant at that time I had utilized IFTT to listen to the Yolink server with any update about the motion detected and then utilize a webhook to send the information into HA. It was sluggishh and slow but did work.

  • That poor solution was replaced by the native yolink HA integration (although still cloud based), which was at first a little buggy as all software is in the first stages.

Question:

The Yolink integration has improved but is not perfect (what is?). While it was improving in order to increase reliability short term, I am using both methods of listening to the motion sensors - which call the same logic in my home automations. In most cases that is stil no issue when they both come in. However, there are specific use cases where I want to ignore a subsequent incoming piece of data from IFTTT if it was already received by the Yolink Integration - but not ignored if there was no such previous message from Yolink due to a network hiccup or the like. I can code around that of course but what would you suggest I do in this scenario below?

  1. Motion detected (re)starts a timer with a dashboard adjustable duration. I only pay attention to when motion is detected, not ‘no longer detected’ (cheaper not 100% reliable motion sensors).
  2. Said timer has automations that when it starts, it turns on a light (only if the light was not turned off manually within the last 5 minutes*), and when the timer is either canceled or finished it turns the light off.

(* This is to fix the problem where someone turns a light off ands then leaves the room, but their movement leaving the room is detected also by the motion sensor so it doesn’t turn the light back on. (Unfortunately there is a slight delay in saving that ‘last manual off’ information in HA as well, it is not instant…))

As IFTTT messages are delayed sometimes - but even when not, sometimes the integration message from yolink about movement may not make it through to HA in a timely manner - what would be the next best step? (For instance, I would turn off the light and leave the room, and sometimes 30 seconds or a minute later the light would go back on due to the ‘last mnual off’ info taking a while to update while a delayed ifttt message about movement sensed comes in.

Sheesh. I will eventually get there with both improved responsiveness and tweaked code, and long term will replace the hardware with much better sensors (but I am using Yolink because they are the only service with a tie-in the a 24/7 monitoring service for calling me, then the cops or fire department if I don’t respond. I wish someone with a more configurable local/cloud solution still offered that service.)

Thoughts on how to improve this sad situation other than spending buckets of money or giving up?

Thanks for listening to the rant and looking forward to any ideas foks may have before noodling around logic regarding how to ignore which messages and when - ?

I have made the changes required to make the Yolink MQTT connections much more robust (I finally discovered I have what should be completely urelated router settings which were the ultimate culprit that was intermittently killing some yolink MQTT connections) - so the IFTTT will eventually go away, (and then I would later slowly switch to something local) but I still want to add some logic - to disregard the incoming IFTTT messages when possible to avoid issues in use cases where it is detrimental (turning lights back on when they should not automatically be turned on and the like. Nobody has any ideas (other than the manual tedious effort of setting up more helpers to keep track of what recently happened and when etc…)?