Problem commanding Tapo P300 Power Strip channels because of min_gap

Hi.

I recently updated to OH 4.0.1 and then to 4.0.3 but I keep having an issue sending commands to 2 of the channels (output2 and output3) of a P300 power strip with the OR Switch group I created to control the 3 items linked to the 3 channels.

Only the Things are managed with the UI, the rest is file-based configuration.

These are my items:

Group:Switch:OR(ON, OFF)  group_LR_PowerStrip_1_Switch "LR Power Strip 1 Switch" <switch> (group_LivingRoom)
Switch LR_PowerStrip_1_Socket1_Switch   "LR Power Strip 1 Socket 1 Switch" <switch>     (group_Plugs, group_LR_PowerStrip_1_Switch, group_LR_PowerStrip_1_Socket1)  ["Switch", "Energy", "PowerOutlet"]         { channel="tapocontrol:P300:xxxxx:ps1:actuator#output1" }
Switch LR_PowerStrip_1_Socket2_Switch   "LR Power Strip 1 Socket 2 Switch" <switch>     (group_Plugs, group_LR_PowerStrip_1_Switch, group_LR_PowerStrip_1_Socket2)  ["Switch", "Energy", "PowerOutlet"]         { channel="tapocontrol:P300:xxxxx:ps1:actuator#output2" }
Switch LR_PowerStrip_1_Socket3_Switch   "LR Power Strip 1 Socket 3 Switch" <switch>     (group_Plugs, group_LR_PowerStrip_1_Switch, group_LR_PowerStrip_1_Socket3)  ["Switch", "Energy", "PowerOutlet"]         { channel="tapocontrol:P300:xxxxx:ps1:actuator#output3" }

Whenever I switch any of the 3 items ON individually, the group switch gets switched ON. When I switch them OFF individually, the group switch is automatically switched OFF.
However, when I try to control the 3 items from the group switch, i.e., by switching the group switch ON or OFF, only Switch LR_PowerStrip_1_Socket1_Switch is altered, the other ones remain in their current status.

For example, Switch LR_PowerStrip_1_Socket1_Switch and Switch LR_PowerStrip_1Socket3_Switch are ON, and thus group_LR_PowerStrip_1_Switch is also ON. If I then try to switch the group OFF (using a button on the UI or sending a command through a rule), only Switch LR_PowerStrip_1Socket1__Switch is switched OFF but the other item remains ON, thus, the group also remains ON.

Likewise, if all items and the group are OFF and I try to switch the group ON, only the Socket 1 is switched ON and the other ones remain OFF.

After setting the Tapo binding to DEBUG I saw the following error message:

10:42:28.676 [DEBUG] [trol.internal.api.TapoDeviceConnector] - (tapocontrol:P300:xxxxx:ps1) command not sent because of min_gap: 1696322548676 <- 1696322548670
10:42:28.681 [DEBUG] [trol.internal.api.TapoDeviceConnector] - (tapocontrol:P300:xxxxx:ps1) command not sent because of min_gap: 1696322548681 <- 1696322548670

The refresh interval at the Thing (Power Strip) level is 30 seconds.

I have other OR Switch groups to control the switches of all the lights and another for all the smart plugs and they all work without problems.

What is that min_gap from the log and can it be edited?

So that the right people see this post, I recommend changing the title of the post to something like “Problem commanding Tapo P300 Power Strip channels because of min_gap”.

The Group is working as expected and Groups are generic. Those who know Tapo might pass over this post thinking it’s a generic problem instead of a problem with the binding.

With the information given, about all I can do is confirm that the Groups appear to be working as expected.

Thanks for your suggestion, @rlkoshak !
Indeed, the issue is not the group item. The OR function works as it should.

Seems like an old problem :slight_smile:
Each command for the three sockets is sent separately, but it’s sent so fast, that the binding can’t keep up.
Workaround: Don’t use the Group Item to control:

rule "switch group_LR_PowerStrip_1_Switch sockets"
when
    Item myControlItem received command
then
    group_LR_PowerStrip_1_Switch.members.forEach[i|
        i.sendCommand(receivedCommand)
        Thread.sleep(500)
    ]
end

rule "set myControlItem state"
when
    Item group_LR_PowerStrip_1_Switch changed
then
    myControlItem.postUpdate(newState)
end

The first rule will send the commands one after the other, the second rule will set the state of the Proxy Item myControlItem whenever the state of group_LR_PowerStrip_1_Switch changed.

Yet I have 2 P115 Tapo and 1 Kasa Smart Plugs which are also grouped by another OR group Switch and they have no issues when I use the group switch to switch them all OFF.

So, is it really the binding or something particular to the newly supported P300?

Does anyone know what’s missing for this pull request to be added to a milestone? It’s been waiting since the beginning of October: