Slowing down group control with multiple MySensors devices (Lights/Blinds)

Is there a way to slow down the group switch? I’m using multiple Arduino Mega to control my Lights and Blinds centralized. Just in my garage there are 20 lights, every lamp has own relay. I have group them together. When I press the group button some of the lights are missing the command. Would it be possible to have a delay (f.e. 50 or 100ms) between the commands, to be sure, all signals will arrive to the node? Randomly one or other device is missing the command and not switching on or off. There was a problem also with feedbacks, but I have solve it in the code by just resending the status back to HA. I’m using one mqtt gateway for 200+ devices connected through PJON wired protocol (2.4.0 alpha).

The code I’m using:

There’s no way to put a delay into the group, but you could break it out into several groups and use automation or scripting to put delays between group turn on commands.

I have a similar set up where I have curtains that run on a motor plugged into a smart outlet and wrote a similar system to what you posted for timing the open time, close time, calibration, etc and those sometimes cause delays in other automation, so I always do the curtain controls first and put a short delay in so other network commands don’t get lost.

could this be done as a new feature? For example:

    name: Kitchen
    delay: 100
      - switch.kitchen_1
      - switch.kitchen_2
      - switch.kitchen_3

I have a lot of automation in Domoticz at the moment and it complicate a lot every change. This feature in group would be more clearly in smart home system with hundreds of devices. The good about group is that I just have to group them and all happend in one place. If I split it into multiple automations, then I will always need to change multiple files in order to add or remove one light. There ware other guys facing this problems before on different hardware.

You don’t have to have multiple automations, just one would do it. That delay option you have isn’t valid for a group config. But if you just split it into multiple groups you could do something like this in your automation:

  - service: homeassistant.turn_on
      entity_id: group.first_set
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: homeassistant.turn_on
      entity_id: group.second_set


Did you manage to sort out multiple messages issue?


Hi, unfortunately not. I just minimize the entities per group to max 6-8 per group. Since that it work. What is your config, what kind of communication between nodes do you use and what kind of gateway?

Hi. I use your script to operate roller blinds and I noticed the same problem with mine. Initially, I managed to bypass it by creating a script in HA that set the blinds to 100% or 0% and thus I created virtual buttons that operated the script. After the last HA update, there is a problem even with scripts. After calling the script, not all blinds respond. Now I went a step further and created a similar group in nodered, but it also happens that some blinds do not work. It seems that the only solution is to add a group to the Arduino code that will raise and lower all the blinds. I also use your code to control the lights and the problem is that the switch icon doesn’t always update. Even if I physically turn off the light, it is still on in the HA. There is no rule for this, it happens randomly. And creating a group of lights behaves exactly like a group of blinds. Some entity will always fail. This may be the same reason as with roller blinds.