Is_state() for binary_sensor/input_boolean never evaluates to True in template


I am most likely overlooking the obvious here. I have been using the waste_collection_schedule integration via HACS to keep track of the dates our bins get emptied on.
It uses template sensors to map the remaining days until collection to more readable states (0 days = “Today”, 1 day = “Tomorrow”, 2+ days = “in x days”).
After adding an input_boolean to indicate if I already placed the bins at the street to be emptied, I now also want to use this input_boolean to change the state of the sensor to “Prepared for emptying” (so my wife can easily check it on the wallpanel and remind me in case I forgot it :wink: ):

Note: I am comparing value.daysTo to 3 for easier testing, normally it would be compared to 0

- platform: waste_collection_schedule
  name: "Restmüll"
  value_template: >-
    {% set rausgestellt = is_state('binary_sensor.mull_rausgestellt', 'on') %}
    {% if value.daysTo == 3 and rausgestellt == True %} 
    {% elif value.daysTo == 3 %} 
    {% elif value.daysTo == 1 %}
    {% else %}
      in {{value.daysTo}} Tagen
    {% endif %}
    - Restabfall

My problem is that is_state(‘binary_sensor.mull_rausgestellt’, ‘on’) never evaluates to True, even though the dev tools clearly show that both the input_boolean and the binary_sensor (which is based in the input_boolean) are both set to on. So the state of the sensor always is Heute. If I change the condition to {% if value.daysTo == 3 and rausgestellt == False %} the sensor state changes to Rausgestellt.

Pasting this code to the template tool in the dev section everything works as expected:

There is also no difference if I use the input_boolean directly in the template instead of the binary_sensor.
So what am I missing here?

I wonder if it can only use Limited templates… that would explain the is_state() function not working. None of the examples in the integration’s repo show any templates that access the state machine.

You may need to create a separate template sensor to get the desired output.

@Didgeridrew could be, the examples in the docs also don’t use external entities

@Ben2401 might be best to ask for clarification in an issue on the Github page

Thanks, will do that and post an update if I find something out.

Nope, uses normal templates.

It appears to just be a one and done when the state resolves. The templates don’t trigger updates on the sensor.