# \[APP\]\[Pro\] \< group \> (3.2.4 - Stable)

**URL:** <https://community.homey.app/t/app-pro-group-3-2-4-stable/3168>\
**Category:** Apps\
**Tags:** app, homey-pro\
**Created:** [October 23, 2018, 4:16pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168 "2018-10-23T16:16:01Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [January 7, 2019, 1:01pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/63 "2019-01-07T13:01:12Z")

</div>

I have just installed the Alpha and come across a problem: go into the app configuration, select my group of curtains then try to make any changes and I get the error message pop up, "Error: group.setSettings is not a function. "

Also I see the group I am editing in the list. Would that cause a problem if I added the group to the group?

 ![Screenshot_20190107-124725_Homey%20(Gen%202)](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/5/5689dd575ceaa2d31bdb79c594d6b2c176ea5cf6.jpeg)

Edit: I can’t capture the error message as it disappears when the screen capture occurred.

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [January 7, 2019, 1:09pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/64 "2019-01-07T13:09:05Z")

</div>

Sorry, I’ve just seen the link at the top of the topic about where to post reports so I will add it there as well.

---

<div class="post-metadata">

**Author:** ![Jamie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jamie/32/5274_2.png) [@Jamie](https://community.homey.app/u/Jamie)\
**Post date:** [January 7, 2019, 1:11pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/65 "2019-01-07T13:11:33Z")

</div>

All good, to answer your question.

Currently the alpha required a small ‘hack’ to get the settings to work due to an issue with Homey.

[https://github.com/athombv/homey-web-api-issues/issues/5](https://github.com/athombv/homey-web-api-issues/issues/5)

This means that ‘old’ groups you created will not be able to be edited with in the settings. (until athom fix their issue).

The fact the current item shows in the list is a bug - and it would be great if you could create a ticket for it.

Thanks!

---

<div class="post-metadata">

**Author:** ![Jamie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jamie/32/5274_2.png) [@Jamie](https://community.homey.app/u/Jamie)\
**Post date:** [January 7, 2019, 4:05pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/66 "2019-01-07T16:05:15Z")

</div>

(V2).00rc12 is out. IF you are still experiencing the problem - please let me know with specific details / steps on what you did to cause the error - so I can reproduce it.

Thanks all!

---

<div class="post-metadata">

**Author:** ![xAPPO](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/xappo/32/13726_2.png) [@xAPPO](https://community.homey.app/u/xAPPO)\
**Post date:** [January 7, 2019, 5:39pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/67 "2019-01-07T17:39:44Z")

</div>

rc12 seems to have fixed it for me Jamie

---

<div class="post-metadata">

**Author:** ![DirkdeDraak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkdedraak/32/8620_2.png) [@DirkdeDraak](https://community.homey.app/u/DirkdeDraak)\
**Post date:** [January 7, 2019, 6:38pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/68 "2019-01-07T18:38:46Z")

</div>

With rc12 (just updated) creating a new group is instant on Android. So that issues seems resolved.

---

<div class="post-metadata">

**Author:** ![Davy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/davy/32/12519_2.png) [@Davy](https://community.homey.app/u/Davy)\
**Post date:** [January 7, 2019, 6:56pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/69 "2019-01-07T18:56:40Z")

</div>

> [@Davy](#):
>
> I added a group with 3 ikea gu10 bulbs (connected through Hue), the group works as expected at that moment.
> 
> When I reboot my Homey (2.0 rc8) the group doesn’t work anymore. When I try to turn on/off or dim the group then I get the following errors:
> 
> [![IMG_1979](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/8/800187eb31c9126a4203fb5307c9c82672ab02e7.png)  
> IMG\_1979.PNG1125x270 40.9 KB  
> ](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/8/800187eb31c9126a4203fb5307c9c82672ab02e7.png)
> 
> [  
> IMG\_1980.PNG.jpg1125x2436 215 KB  
> ](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/a/a79458134bf658e52ece7b617c1da2856ea16897.jpeg)
> 
> When I delete the group and re-add it, then it works again, but after a reboot it is broken again.

> [@Davy](#):
>
> When I add a group and don’t rename it, but just keep the default name “Lamp”, it’s working fine after a reboot. When I rename the new group “Lamp” to “Lampp” then it doesn’t work anymore after a reboot.

I just created a new group, added 2 ikea gu10 bulbs (connected through Hue), renamed it and moved it in a zone.

Works as expected, but as soon as I reboot it’s still the same errors.  
Homey: 2.0.0-rc12  
iOs app: 0.18.0 (241)  
\< Group \> version: v2.0.208 beta

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 7, 2019, 7:32pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/70 "2019-01-07T19:32:37Z")

</div>

@jamie this issue sounds like one that also pops up in the Homeykit app: for some reason, `device.capabilitiesObj.SOME_CAPABILITY` can sometimes be undefined. Still haven’t worked out why/when it happens.

---

<div class="post-metadata">

**Author:** ![DaneedeKruyff](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daneedekruyff/32/964_2.png) [@DaneedeKruyff](https://community.homey.app/u/DaneedeKruyff)\
**Post date:** [January 7, 2019, 7:53pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/71 "2019-01-07T19:53:24Z")

</div>

Yeah, ran into that one on Heimdall too. Found after 2 days of searching (on another users homey without access) it was because of a crashed app for which the device showed that symptoms.

Now I only add a device when device.ready=true, haven’t had the issue since.

> <https://github.com/daneedk/com.uc.heimdall/blob/911f23dce9920b4ecb181fc1cc2a6c7a7d50e698/settings/settings.js#L134>

> <https://github.com/daneedk/com.uc.heimdall/blob/911f23dce9920b4ecb181fc1cc2a6c7a7d50e698/settings/settings.js#L302>

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 7, 2019, 7:58pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/72 "2019-01-07T19:58:25Z")

</div>

Ah, nice one!

---

<div class="post-metadata">

**Author:** ![DirkdeDraak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkdedraak/32/8620_2.png) [@DirkdeDraak](https://community.homey.app/u/DirkdeDraak)\
**Post date:** [January 7, 2019, 8:02pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/73 "2019-01-07T20:02:37Z")

</div>

It seems that another issue re-appeared, which I mentioned for rc9 (see post #47 earlier) ☹ . @Davy reported it also just now.  
An existing group gives the issue “er ging iets fout…”. A newly created group works though. Have not tested it with a reboot.

---

<div class="post-metadata">

**Author:** ![Jamie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jamie/32/5274_2.png) [@Jamie](https://community.homey.app/u/Jamie)\
**Post date:** [January 8, 2019, 9:02am UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/74 "2019-01-08T09:02:08Z")

</div>

Ok from what I can gather when you :

1. create a new group
2. rename said group
3. then restart your homey

You get an error and you can not control the group.

I suspect this actually is actually a race condition with in the homey restart process, which is why it only affecting some groups for some people. @DaneedeKruyff gave me the hint with his `device.ready`.

When the groups app starts up it grabs all the devices and says to keep an eye out for changes. Now if the group app loads that piece of code prior to the devices app (fibaro/hue/whatever) loading the actual device - it will throw a hissy fit. Which in turn might cause the issue people are experiencing.

Honestly the weirdest part of this bug is the fact it only occurs after renaming a group, I have no idea why that would be the case @robertklep / @DaneedeKruyff ?

If i’m right, then that means two things : ONE : after restarting homey if you wait for all your devices to load - then restart \< group \> - you wont get the error. TWO: I’m actually a bit stuck as to how to correctly fix this issue short of some sort of lame timer hack.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 8, 2019, 9:09am UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/75 "2019-01-08T09:09:21Z")

</div>

> [@Jamie](#):
>
> I’m actually a bit stuck as to how to correctly fix this issue short of some sort of lame timer hack.

Welcome to the wonderful works of lame timer hacks. We’re doing the exact same thing in HomeyKit (when the app starts up, it checks every 30 seconds to see if the number of devices has changed; if it has, it means there are still devices being created and we wait another 30 seconds).

Alternatively, but that might be something that won’t work for your app, we’re watching the `device.update` event and keep track of which devices are “new” (not seen yet). On v1.5 we used `device.create`, but on v2 that event may trigger on devices that aren’t “ready” yet.

Is renaming a group the same as renaming any Homey device? If so, I have absolutely no idea why that would cause problems, because it’s something beyond the control of your app (from what I know).

---

<div class="post-metadata">

**Author:** ![DaneedeKruyff](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daneedekruyff/32/964_2.png) [@DaneedeKruyff](https://community.homey.app/u/DaneedeKruyff)\
**Post date:** [January 8, 2019, 9:43am UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/76 "2019-01-08T09:43:16Z")

</div>

Well, I did go for the lame timer hack (but that’s for adding a new device):

> <https://github.com/daneedk/com.uc.heimdall/blob/911f23dce9920b4ecb181fc1cc2a6c7a7d50e698/app.js#L134>

  
🙂

I’ve also tried watching the `device.update` but it seemed the floodgates were opened and decided to not listen in just for finding out when a device became ready after adding so I went the dirty road.  
It would be nice if `device.ready` was emitted but on the other hand I have no idea how many times that would occur.

---

<div class="post-metadata">

**Author:** ![Davy](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/davy/32/12519_2.png) [@Davy](https://community.homey.app/u/Davy)\
**Post date:** [January 8, 2019, 9:54am UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/77 "2019-01-08T09:54:04Z")

</div>

Manually restarting the \< Group \> app does makes the groups work after a reboot, good workaround 🤗

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 8, 2019, 10:40am UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/78 "2019-01-08T10:40:15Z")

</div>

Is 2 seconds enough time in your experience?

---

<div class="post-metadata">

**Author:** ![DaneedeKruyff](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daneedekruyff/32/964_2.png) [@DaneedeKruyff](https://community.homey.app/u/DaneedeKruyff)\
**Post date:** [January 8, 2019, 10:48am UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/79 "2019-01-08T10:48:12Z")

</div>

Yes, for me in my test situation it’s enough.  
I wrote this code in anticipation of a useable solution from Athom but not sure we will get on since Emile told us ‘A device’s lifecycle is actually quite complex’ and closed the issue. ☹

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 8, 2019, 10:50am UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/80 "2019-01-08T10:50:52Z")

</div>

I generalized it a bit so it will check a device once per second:

```auto
  async waitForDevice(id) {
    const device = await this.api.devices.getDevice({ id });
    if (device.ready) {
      return device;
    }
    await delay(1000);
    return this.waitForDevice(id);
  }

```

(theoretically, if a device _never_ becomes ready, this solution isn’t great, but YOLO)

---

<div class="post-metadata">

**Author:** ![Jamie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jamie/32/5274_2.png) [@Jamie](https://community.homey.app/u/Jamie)\
**Post date:** [January 8, 2019, 4:27pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/81 "2019-01-08T16:27:26Z")

</div>

I’ve been able to reliably reproduce the bug and more importantly log it. Consequently ive been able to ‘fix it’ - by fix it I mean the group will now be disabled and let you know to restart the app if the group contains any problem devices - For Omega testers.

YOLO fix coming soon, possibly something with doubles the setTimeout value each time it is called.

---

<div class="post-metadata">

**Author:** ![Jamie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jamie/32/5274_2.png) [@Jamie](https://community.homey.app/u/Jamie)\
**Post date:** [January 10, 2019, 5:28pm UTC](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168/82 "2019-01-10T17:28:30Z")

</div>

Alpha is now running 2.1.6 - which will now poll the grouped devices and check to ensure that they are .ready.

If a group contains a device(s) which is not ready, has crashed, app disabled etc. The group will continue to work with out said device(s) until When/If they start working again.

This also will fix the race condition people have experienced after renaming/rebooting their homey.

Thanks

[Previous page](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168.md?page=3)

[Next page](https://community.homey.app/t/app-pro-group-3-2-4-stable/3168.md?page=5)
