Weird looping

Posted on
Tue Nov 15, 2022 11:28 am
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Weird looping

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.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Tue Nov 15, 2022 4:34 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Weird looping

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

Posted on
Tue Nov 15, 2022 7:23 pm
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Weird looping

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 1211 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 1211 times

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Tue Nov 15, 2022 7:54 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Weird looping

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

Posted on
Wed Nov 16, 2022 7:36 am
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Weird looping

The entire ON script:
#!/bin/sh

shortcuts run Hall\ Lights\ On

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Wed Nov 16, 2022 10:47 am
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Weird looping

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

Posted on
Wed Nov 16, 2022 11:31 am
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Weird looping

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 1152 times

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Wed Nov 16, 2022 9:37 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Weird looping

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests