Help needed for a rule

Hi all,

i am asking for support for generating a logic for a rule. I have 7 blinds that run with Homematic. So far so good. I am having an old central Gira Blinds Timer-Switch that is triggering all blinds and manually only used as switch to eventually open all blinds in the morning and close them at night, the timer functionallity is not used anymore, i have openHab rules for this. Also i am the one here in my household that uses Siri to open/close the blinds as i know that then the status in OH and homekit is correct, but i have to consider that the old switch needs to stay to please others.

What happens if the Gira switch is used, regardless if UP or DOWN:

  • all Homematic blinds change the status to 50% immediately
  • all Homematic blinds change the Direction channel state to UNDEFINED ( usually UP, DOWN, NONE )

Obviously the state of the blinds in openHab are messed up then and i need a rule to correct this in the UI. It would be easy if i know the previous state of the blind for sure, but that is not a matter of course. I cannot use the actual state as the level goes to 50% right away to detect the direction and stays there.
Example from the logfile:

Item 'RolladenDoppelfensterEsszimmer_1_Level' changed from 0 to 50
Item 'RolladenDoppelfensterEsszimmer_Direction' changed from NONE to UNDEFINED

Some of my thoughts to work out a rule:

  • use the change to UNDEFINED of the direction channel from homematic as a trigger that the central switch was used, maybe combined with the fact that ALL 7 blinds at the same time are going to UNDEFINED ( direction channels ) and 50% LEVEL channels.
  • how to define if the aim was to go UP or DOWN? It is not fixed that this is UP in the morning and DOWN at night
  • compare this to a previous state of a blind? ( ideally use a couple of blinds as a reference just to increase the likeliness to figure out the aim )
  • level states of my 7 blinds can be different from various reasons, e.g. from shading over day and a click on UP on the Gira switch in the late afternoon…

I am a bit stuck in my logic here and would appreciate if the community has some ideas.

I hope i have given all information needed.

Thank you.

If you cannot know, you have to guess. Your suggestions seem reasonable.

Technique that might help distinguish group/individual situations -

If one blind goes UNDEF, start a short timer (if it is not already running). After time, now count how many are UNDEF to detect the situation before doing whatever.

thank you @rossko57 for your guidance. I will start to work on a rule. It is going to be some trial and error over time as i cannot exactly figure out every possible constellation. the biggest concern would be if the rule fires in the opposite direction and the blinds start moving but i just thought for a UI view correction it would be sufficient to just send a post update to the items to correct the UI status. Correct?

Yes. Bindings to the outside world generally respond only to commands.
Of course if the Item is linked to a binding, the binding may come along later and overwrite what you did, but that all depends on when it gets outside messages.