I have several roller shutters configured in Home Assistant as covers that I control over the HomeKit component with many Apple devices.
Everything works fine until I change the closed_position in the template definition from 0 to a number greater than 0. This is required to record in Home Assistant that a cover is closed also if is not in position 0. In fact I like to leave the holes between each row of the rolling shutter opened. Normally this number is between 8% to 12% and depends on the roller shutter.
the commands sent from an HomeKit device are well executed, but the state on HomeKit is not consistent with the real state of the roller shutter, mainly stuck in Opening or Closing state but sometimes also the opening % is different from the current_position reported from the device.
On Home Assistant all seems to be good, and the state is Closed from the 8/12% to 0%, so I can log the closed state correctly.
Without the changes to the template definition, I’m not able to log the closed state of the roller shutters, but I like to control them via HomeKit without the need to select each of them and see the state.
Have you any hint on a possible way to fix this behaviour?
Maybe I find where is the issue.
I used a MQTT Cover configuration to manage the shutters as you can see on the previous message. To track the position I configured a specific sensor:
Looking at the entity States page, when the position of the cover is 8 or less, I found that the cover state is closed because of the “position_closed: 8” on the MQTT Cover configuration, but its “current_position” attribute is 0 instead of 8.
Looking at the sensor state, is correctly reported 8 as current position. This is expected because the sensor is taking the payload value from an MQTT message of the shelly module.
So it seams that the current_position attribute is automatically overrided to 0 as value when the state closed is forced by the position_closed configured on the MQTT Cover configuration.
Where I’m doing wrong? Is this an expected behaviour, or a limitation of the MQTT Cover?
I created a Template Sensor for each cover, with the state “closed” or “open” based on the current position. For example if the position is under 11, the sensor state is “closed”.