Ghostly behavior on a Thing turning OFF all lights

  • Platform information:
    • Hardware: RPi5 8Gb 512Gb SSD
    • OS: Raspbian Debian 12 (bookworm)
    • Java Runtime Environment: Temurin-21.0.9+10 (build 21.0.9+10-LTS)
    • openHAB version: 5.1.1

Here’s what’s happening:

I have two things with a ghostly behavior that I’ve never seen this before. Whenever I put this item on a specific rule and make it turn OFF, all lights go OFF.

Then, while that item is inside that rule, if I turn that specific item OFF, it also turns OFF all lights.

There is NO other rule anywhere that sets this.

It is a Shelly device and inside Shelly APP there are no rules.

The same thing happens with another thing so two different things have this weird behavior.

Have anyone ever had this situation? I’ve already removed and created new things and did the same with items (because I’ve noticed sometimes duplicated items or things might cause some problems), but still, didn’t worked.

Any suggestions will be much appreciated.

See if you don’t have those items inside of a group. Groups can have behaviors where you turn on the group switch and all switches inside turn on too.

Yes I do. And actually, by removing them from groups, it actually worked out! But why does this one specifically and not the others on the same groups?

I mean, how can this actually be fixed?

I have a group defined as follows:

Normally all members are off. This is the behaviour when something changes:

  1. If I switch the group on all members go on

  2. If I switch the group off all members go off

  3. If I switch one of the members on, the group goes on but the other members stay off

So I think you need a “One OFF then OFF else ON” aggregation.

To the best of my knowledge, this should not happen. If you have an aggregation function on a group, the group state will update if an appropriate change occurs in one of the group members. Commands to a group are propagated to the child items, but updates to a group are not. So, there should be no way that just one item changing causes other items in the group to change as well unless there is a bug.

Can you show us this rule? This is the one factor that causes this strange behavior so either this is a result of the rule itself or this is where the bug is.

It isn’t, but here it is anyway:

configuration: {}
triggers:
  - id: "1"
    configuration:
      command: ON
      itemName: Movie_Mode
    type: core.ItemCommandTrigger
conditions: []
actions:
  - inputs: {}
    id: "3"
    configuration:
      command: "60"
      itemName: Dimmer_Light_Kitchen_Furniture_Indirect_Intensity
    type: core.ItemCommandAction
  - inputs: {}
    id: "5"
    configuration:
      command: "15"
      itemName: Light_Kitchen_1_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "6"
    configuration:
      command: "15"
      itemName: Light_Kitchen_2_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "7"
    configuration:
      command: "15"
      itemName: Light_Kitchen_3_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "8"
    configuration:
      command: "5"
      itemName: Light_Living_Room_1_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "9"
    configuration:
      command: "5"
      itemName: Light_Living_Room_2_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "10"
    configuration:
      command: "5"
      itemName: Light_Living_Room_3_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "11"
    configuration:
      command: "5"
      itemName: Light_Living_Room_4_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "12"
    configuration:
      command: "50"
      itemName: Light_Main_Hall_1_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "13"
    configuration:
      command: "50"
      itemName: Light_Main_Hall_2_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "14"
    configuration:
      command: "50"
      itemName: Light_Main_Hall_3_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "15"
    configuration:
      command: "10"
      itemName: Light_Main_Hall_4_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "16"
    configuration:
      command: "10"
      itemName: Light_Main_Hall_5_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "17"
    configuration:
      command: "10"
      itemName: Light_Main_Hall_6_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "18"
    configuration:
      command: "50"
      itemName: Light_Main_Hall_7_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "23"
    configuration:
      command: ON
      itemName: Light_Game_Room_Hall_Indirect_Power
    type: core.ItemCommandAction
  - inputs: {}
    id: "24"
    configuration:
      command: "3000"
      itemName: Light_Pantry_1_Color_Temperature
    type: core.ItemCommandAction
  - inputs: {}
    id: "25"
    configuration:
      command: "3000"
      itemName: Light_Pantry_2_Color_Temperature
    type: core.ItemCommandAction
  - inputs: {}
    id: "26"
    configuration:
      command: "40"
      itemName: Light_Pantry_1_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "27"
    configuration:
      command: "40"
      itemName: Light_Pantry_2_Dimmer
    type: core.ItemCommandAction
  - inputs: {}
    id: "2"
    configuration:
      command: ON
      itemName: Lights_Modes
    type: core.ItemCommandAction
  - inputs: {}
    id: "19"
    configuration:
      command: ON
      itemName: Dimmer_Light_Cornice_Hall_Power
    type: core.ItemCommandAction
  - inputs: {}
    id: "20"
    configuration:
      command: ON
      itemName: Light_Indirect_Kitchen_Power
    type: core.ItemCommandAction
  - inputs: {}
    id: "28"
    configuration:
      command: ON
      itemName: Light_Wine_Cellar_Indirect_Power
    type: core.ItemCommandAction
  - inputs: {}
    id: "29"
    configuration:
      command: ON
      itemName: Light_Wine_Cellar_Direct_Power
    type: core.ItemCommandAction
  - inputs: {}
    id: "4"
    configuration:
      command: "5"
      itemName: Dimmer_Light_Living_Room_Cornice_Intensity
    type: core.ItemCommandAction
  - inputs: {}
    id: "21"
    configuration:
      command: "20"
      itemName: Dimmer_Light_TV_Stand_Intensity
    type: core.ItemCommandAction
  - inputs: {}
    id: "22"
    configuration:
      itemName: Light_Hall_Wall_Power
      command: OFF
    type: core.ItemCommandAction

Item Light_Hall_Wall_Power was the one causing this. When I removed the item from the three groups where it was in, problems just stopped.

Ah, I misunderstood, I thought the problems stopped when you removed the item from the rule.

Your OH version is recent enough that the logs should show you the source that causes each log event. Trigger the unwanted behavior and watch the logs. Your group Items are getting a command from somewhere before that command then goes out to all the child items. The log should now be able to help you track down where that command is coming from.

YES! Indeed this IS the solution. In two groups I had “All ON then ON else OFF”. So… whenever at least one of the items went OFF, all belonging to that group would go OFF. :smiley:

I’ve changed group behavior to “All OFF then OFF else ON” and everything is ok now. :wink:

I don’t know if somehow these things are linked via the shelly system (I don’t have any shelly devices so I don’t know the ecosystem), but I’ll say it again, if this is happening entirely within OH, then either a major bug has been introduced, or there is some other explanation for what is going on. This is very simply not the way that group aggregation functions have ever worked or been intended to work. If changing the aggregation function solves your immediate issue then that is because it is masking some other problem, not because it is the actual solution.

I am on a recent OH shapshot and I cannot reproduce this behavior at all. Here’s a quick test example: 1 group with All ON then ON else OFF and three switches:

Clicking on the card with the group state, brings up a handy testing dialog with toggles for the group and the switches:

agTest

You can see from the video above that there is no instance of toggling one of the Item switches that impacts the other Item switches. There is no OH core way to do that. Only using the group toggle to send a command to the group item results in all the switches reacting at once.

Given that I cannot recreate the bug in a recent snapshot, and I see no issues or PRs that have addressed and error such as this in the UI or Core repositories, the most probable explanation is that you have some other rule or connection. Even if the Item in question does not show up directly in a rule, then perhaps it can trigger a rule because it is a member of some group and that rule causes your group Item to receive a command that then propagates to all the other items.

However, it is possible that this is a bug in some other area that my test doesn’t cover (such as the shelly binding) so, it would be very helpful for you to find the actual cause and report it if it is a bug.

Will try to do that and will get back later on.