New H.A. user here and this community forum is awesome for getting beyond the basics.
I have searched the forums for an answer to my issue, without success. I need to limit my IKEA FYRTUR blinds to opening only to 97%, due to the way I framed the windows. I did find an excellent post on here and have successfully created a cover template to control this for a group of four blinds. Works flawlessly and happy with it!
Given the hard limit of 97% on opening, I would like the blinds to report Open when they are at 97%. Instead, the state on the mushroom card reports Open - 97% when they are open. I would really like this to report Open 100% to simply and to get better buy in from others in the house!
I am confused with value template versus position template. Intuitively it would see that I need to set the value template here, but have not been successful at figuring this out.
Actually it’s IKEA’s crazy blinds, so 0% is closed and 100% is open. IKEA and zigbee2mqtt support setting a max limit length for closing. But in my case, I cannot allow the blinds to fully open or the end gets caught a molding in the window trim - so I’m attempting to redefine the state "open’ to be 97%, rather than 100%. As indicated, the YAML works to stop the blinds at 97%. I just need to figure out how to not make it appear as if the blinds are not fully open (by displaying 97%)…
Alternatively, if there is a way to only display the percentage open only if less than 97%, that would work. I do not require the percentage to display if the blind is fully open or fully closed. Only if somewhere in between 1% and 96%… Not sure if that approach is easier.
Invalid config for [cover.template]: invalid template (TemplateSyntaxError: unexpected ')') for dictionary value @ data['covers']['bedroom_blinds_limited_group']['value_template']. Got '"{{ if(state_attr(\'cover.bedroom_blinds_group\', \'current_position\') | float > 96), "open", states(\'cover.bedroom_blinds_limited_group\')) }}"'. (See ?, line ?).
I tried as you suggested, though is {{ iif(state… a typo? Tried like this, but no difference…
Lastly, sorry but I don’t understand some of the terminology in the templating language. what does “… | float > 95” actually mean? Versus the “| round” syntax in the position template that is working?
The float filter converts a numeric string into a floating point number that can have mathematical comparisons or operations performed on it. The round filter does the same thing but also rounds the resulting number to the number of decimals you define.
@MackCreek You know you could limit the blinds by lowering the blinds to the desired state. Then doubletap on the lower button on the device. Then that position is reported as 100%. So no need to do calculations on HA.
When lowering the blinds, it wil automatically stop at that saved position.
As OP stated a few times, the problem is limiting maximum opening level, not maximum closing level. IKEA in their infinite wisdom do not allow to set a maximum opening level, just a maximum closing level. This leaves me with the exact same issue as OP. @MackCreek@tomg1970 if any of you figured it out, I would really appreciate if you could post the solution!