Weird looping

A plugin to integration Indigo devices into HomeKit (and Siri)
User avatar
Different Computers
Posts: 2730
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Weird looping

Post by Different Computers »

Not sure this belongs here, but I feel like I should report it. Maybe my action group is borked.

I have two Nanoleaf Essentials bulbs in HomeKit. Inside of Indigo, I have those two bulbs in a virtual group "Hall Lights" set up as an action group execution model. On sends one script command to Shortcuts, off sends another.

I also have that Virtual group exposed to HomeKit in HKLS. And this seems to be the problem.

In Shortcuts, if I have the shortcut address each bulb individually, everything works as it should when triggered by Indigo or run in Shortcuts directly.

If I have the shortcut turn on or off the Hall Lights Virtual Device, I get

Code: Select all

2022-11-15 11:15:43.591   Action Group   Hall Lights ON Script
2022-11-15 11:15:43.591   Virtual Devices   sent 'Hall Fixtures' on
2022-11-15 11:17:09.889   Action Group   Hall Lights ON Script
2022-11-15 11:17:09.889   Virtual Devices   sent 'Hall Fixtures' on
2022-11-15 11:17:10.400   Action Group   Hall Lights ON Script
2022-11-15 11:17:10.401   Virtual Devices   sent 'Hall Fixtures' on
2022-11-15 11:17:10.979   Action Group   Hall Lights ON Script
2022-11-15 11:17:10.980   Virtual Devices   sent 'Hall Fixtures' on
2022-11-15 11:17:11.555   Action Group   Hall Lights ON Script
2022-11-15 11:17:11.556   Virtual Devices   sent 'Hall Fixtures' on
2022-11-15 11:17:12.130   Action Group   Hall Lights ON Script
2022-11-15 11:17:12.130   Virtual Devices   sent 'Hall Fixtures' on
2022-11-15 11:17:12.710   Action Group   Hall Lights ON Script
2022-11-15 11:17:12.711   Virtual Devices   sent 'Hall Fixtures' on
2022-11-15 11:17:13.281   Action Group   Hall Lights ON Script
2022-11-15 11:17:13.282   Virtual Devices   sent 'Hall Fixtures' on
2022-11-15 11:17:13.869   Action Group   Hall Lights ON Script
2022-11-15 11:17:13.870   Virtual Devices   sent 'Hall Fixtures' on
And it never stops without a server restart. I've double checked dependencies in Indigo for the virtual device group, and there's nothing looping there.

I don't know WHY this happens, but thought I should post it in case anyone else hits the same issue.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana, Yamaha RX Receiver.
User avatar
GlennNZ
Posts: 1873
Joined: Sun Dec 07, 2014 3:33 pm
Location: Central Coast, Australia

Re: Weird looping

Post by GlennNZ »

Hi

Hard to see where HomeKitLink fits into this issue.

Can you post the contents of the Action Group and the contents of the Virtual Device/On/Off actionGroups - I would be guessing the issue lies there. But as you say you have already looked!

The HKLS debug logging - enable deviceUpdate and Device debugging - should answer that aspect though
User avatar
Different Computers
Posts: 2730
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: Weird looping

Post by Different Computers »

Indeed the only thing that made me think HKLS might be involved was how activating the shortcut directly made the loop start.

The only difference between "loops forever" and "executes correctly is in Shortcuts. Configuring the shortcut to turn off the two lights works. Configuring shortcuts to turn off the Hall Fixtures, which is an Indigo Virtual Device, loops. The big diff is that the two lights are "native" in HomeKit, and the Virtual Device is imported from Indigo.
Attachments
Screen Shot 2022-11-15 at 8.22.06 PM.png
Screen Shot 2022-11-15 at 8.22.06 PM.png (22.21 KiB) Viewed 1418 times
Screen Shot 2022-11-15 at 8.21.41 PM.png
Screen Shot 2022-11-15 at 8.21.41 PM.png (41.74 KiB) Viewed 1418 times
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana, Yamaha RX Receiver.
User avatar
GlennNZ
Posts: 1873
Joined: Sun Dec 07, 2014 3:33 pm
Location: Central Coast, Australia

Re: Weird looping

Post by GlennNZ »

Hmm

What the contents of the shellscript?

& does the same loop happen for off? If truly an issue would guess it should...

(Hmm.. thinking aloud - may be consequence of turning on without checking first. If your VD states aren't updated - HKLS will send a turn on regardless of current state. If there is a state check elsewhere, that may send command again. HKLS doesn't resend commands. But not sure about Shortcuts - it is possible it is resending when the state doesn't change.)

Debug log would show what HKLS is doing
User avatar
Different Computers
Posts: 2730
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: Weird looping

Post by Different Computers »

The entire ON script:
#!/bin/sh

shortcuts run Hall\ Lights\ On
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana, Yamaha RX Receiver.
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Weird looping

Post by jay (support) »

Are you sure that you don't have a trigger that's causing the repetition? It's not showing in the log, but that might be because you have the Hide trigger executions in Event Log checkbox enabled for the trigger. It might show up if you right-click on both the virtual device and the action group and click on the Show Dependencies menu item. While that's not guaranteed to show dependencies that are defined through a plugin, it will show many dependencies. Maybe something in there will give you a clue.

Also, make sure you don't have any rules in your shortcuts that might introduce the looping. I don't use Shortcuts, so I can't give you explicit instructions, but I think it's possible to create rules like that.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
Different Computers
Posts: 2730
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: Weird looping

Post by Different Computers »

I am pretty sure I've never once turned on hide trigger execution. Coming from SmartThings and its total lack of logging, I knew when I started with Indigo that I wanted to see everything happening.

I checked the dependencies on everything thoroughly, and the shortcuts themselves have only "turn this on" or "turn this off" in them. I don't do ANY automation in Home or via Shortcuts--it's all controlled by Indigo.

Shortcuts is only a bridge to the Home app, since you can use shell scripts to target shortcuts but not to target Home.
Attachments
Screen Shot 2022-11-16 at 12.31.43 PM.png
Screen Shot 2022-11-16 at 12.31.43 PM.png (159.61 KiB) Viewed 1359 times
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana, Yamaha RX Receiver.
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Weird looping

Post by jay (support) »

Ok, so nothing obvious. Somewhere there is some circular logic. At this point, I think the only option is to delete all the various parts and recreate each item, testing each separate component before moving on. Hopefully that will help identify where the looping logic is happening.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Post Reply

Return to “HomeKitLink Siri”