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.
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.
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)
...
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.