Discrepancy on blind state/ position

Hello all,

After a few weeks amusing myself with HA on my new home, I encountered a weird “bug” with my HA automation, I hope that you can give me some light on what might be happening here.

I have automated all of my blinds with some Moes smart switches (ZTS-EUR-C), that works really well and I haven’t had any problems until today.

I was trying to create an automation that closes one of my blinds if another one is already closed (condition):

condition: state
entity_id: cover.cuisine_volet
state: closed

Witch seems really simple, but for some reason it didn’t work, I mean, even if the blind was closed, the condition returned always false…

After a few analysis, I found that there was a discrepancy on the blind position (and buttons) and the actual state :pensive:

Look at these screenshots, that shows all the blinds states on different screens on my HA:

  1. zigbee2mqtt state:

  2. HA dashboard buttons:

  3. HA entity modal:

  4. Entity history

As you can see, both (1) and (2) are OK, as I have my blind “position: 0” and on my dashboard I can open it.
But on (3): even if the bar shows that the blind is closed, the state title is “Open” (“Ouvert”);

And on (4), the journal clearly shows that the blind was opened just after it was closed, even if this is not the case…

And when I was investigating, I found out that if I press the “stop” button on my HA dashboard, the blind position automatically goes to the correct position of “Closed”:
(“was closed triggered by the cover service: Stop”)

Can anyone help me to figure out why does this happens? For this time I manage to override by change my condition to:

condition: numeric_state
entity_id: cover.cuisine_volet
attribute: current_position
below: 1

But I don’t think it’s the proper way of doing it, it’s just a workaround…

Anyway, I hope I was clear enough, and thanks all in advance for your help

Best regards,

Although the position is 0, the state is “STOP”, rather than “CLOSE”.
Not sure who takes precedence, here, but state, apparently.

The Z2M support page says that the device itself reports only “OPEN” and “CLOSE”, so could it be that you send a “STOP” command at some point?

Hello, thanks for the quick response :slight_smile:

I actually have an automation that close all blinds on the ground floor, here is the script sample that covers “cuisine_volet”:

service: cover.close_cover
    - 19cf5d398b571b0aaf95775e4de96525
data: {}

And now that you spoke, I just saw the “state: STOP” on my z2m state… But it’s weird, as the sample below was what close the blind. No idea where the STOP might be originated from…

I will take a look today after the next execution, witch should occur in ~2h, and than I post the results…

Well, I did some observations this night:

When my script runs, some blinds close and stays close, other blinds close and change to open position (I can see the difference on the color of the blind icon and on the logs).

If a blind jumps to “open”, if I press the stop button on the dashboard turns it to the “close” position.

On both cases (blind stated as “open” or “close”), the z2m state attribute is set to “STOP”, so I don’t think this is the problem.

And I found a new workaround:
After my automation closes all blinds, I wait 15 seconds and then I click on the “stop” button for each blind, to simulate the dashboard click:

device_id: 19cf5d398b571b0aaf95775e4de96525
domain: cover
entity_id: 08d042697ce4f1f59113972a461e4637
type: stop

When I do that, the position goes to “close”.

It’s a weird behavior, and what I try will do is see if it’s always the same blinds that have this behavior, and maybe try to re-calibrate them…

Other than that, do you have any other ideas?

Thanks again for the help,

Best regards,