Rollershutter Group - Display open shutters

Hi,
i want to see in my sitemap, if all rollershutters are closed.

I have this in my items file:

Group:Rollershutter:OR(0, 100)	gShutters		 "Alle Rollläden [%d]"

When all shutters are closed i get “100” in my sitemap. When one shutter is still open, i get “0”.

But when one shutter is only half open, i get “100”. And this is my problem…

I don´t want to get “100”, when one shutter is still half opened. Is there a way to display, that not all shutters are completely closed?

Can somebody help me?

Maybe it can be done in a rule? I want to see, if all my shutters (all shutters in a group) are down. If only one shutter is open, the whole group should be displayed as “not closed”.

Would be good, if i can use the result of this rule in another rule to send some notifications, if some shutters stay open at night.

Flip your aggregation function to AND.

AND(100, 0)

That will show 100 only if all members are 100 and 0 otherwise. So if one Item is only partially opened, it will show 0.

Ok, thanks! That will display it on my sitemap.

But how can i use this information in a rule?

A Group is an Item. Use it like any other Item.

Item MyGroup changed

if(MyGroup.state == 0)

and so on.

Is

AND(100, 0)

and

AND(0, 100)

the same?

=====

So now i tried this for testing on my sitemap.

Today morning:
All shutters are open, but 1 is still closed. I get “0”.

I can´t use this to detect, iff all shutters are open… So here i have to use “OR” ?

Today night:
All shutters are closed, but 1 is still open.
Here i want to detect, if all shutters are closed already… So there i think, AND would be the right one? Will test this today.

No, they are not the same. Read the description of Group functions in the docs.

AND(100, 0)
means -
If all member Items are 100, make the group the same state (100)
If that’s not true, default the group state to 0

That’s correct. If your Group has only two states (0 and 100) you can’t use it to detect three different conditions - all open, some of each, all closed.

You can put your Items in two different Groups at the same time, and have one group tell you if they are all open and one group tell you all closed.

Edit - thinks, there’s a cheat way to do this, as your roller members are effectively numbers.
Group AVG function should give you an average. Should yield 100 , 0 - or something else that you don’t care but means some open.

1 Like

My shutters can have ervery number between 0 and 100. But i only want to know if all shutters are closed or if all shutters are opened.

All states between can be ignored, because i don´t need them for my rules.

I will try this, what you said.

Tried it and it works good.

My problem is: I have a knx installation and sometimes when i send a command to the rollershutter group, some of my shutters stay open or stay closed…

I think, my knx is not recognizing all commands, because when there is a group command, many commands will be sent to the knx bus in very short time.

Quite possible. Use of a proxy Item and delays -

Another approach I would recommend is the Complex Example using Queues from Design Pattern: Gate Keeper. This avoids tying up a Rule thread with a while and a sleep.

In fact, the knx addon should handle this.
It’s very frustrating that such a basic functionality (don’t try to transmit more messages than the bus is capable to receive) isn’t built in.

In question of the problem itself: In a rule you can do something like this:

if(MyGroup.members.filter[m|m.state as Number == 0].size > 0)
if(MyGroup.members.filter[m|m.state as Number != 100].size > 0)
if(MyGroup.members.filter[m|m.state as Number == 0].size < MyGroup.members.size)
...

I think this would be an easy to use option, too.

Most time it is working, when i send a command to the rollershutter group.

I would say 1 time every 2 week it stucks on some shutters. No i implemented a timer and if after 1 minute some shutters are still open. I send another command.

It is not beautiful, because this basic thing should work. I think, this is one of the most used command in a knx Installation. And it is bad, when the shutters go down not synchronized. Something like “want, but not can”…

Other approach would be, to define a scene inside the knx actuator and only send a command to this. But then i am not as free in progrsmming as i am it inside openhab.

Bindings should queue nicely, but may not be the bindings fault. The missing “queuing” functionality might be in the gateway? Perhaps there is a way for the binding to handle it more gracefully?
(in Modbus binding, there is a queue and a configurable time gap between transactions)

Has anyone filed an issue on the binding? I completely agree that the binding should handle this, and KNX isn’t the only binding with this problem, but if no one has filed an issue, it has no chance of ever getting fixed.

No, a knx/IP gateway is not capable to queue, it just receives and transmits data. In fact it’s a serial interface with ethernet connection. The only thing to configure is IP and knx individual address. There are lots of other home automation systems which do it correctly (i.e. don’t send too much data)
When using the serial interface from a higher level, I guess the OS does the queuing.