I’m attempting to customize an existing BluePrint to leverage an existing HACS adding for sending notifications.
Here is the code thus far: GarbageCollection.yaml (github.com)
The blueprint imports fine, but when I kick it off, there are 2 issues that i’m having trouble figuring out. I’m relatively new to YAML and JINJA formatting, so bare with me.
The first issue is that line 34 should be saving a query into a variable:
sensors_tomorrow: "{{ states.sensor | selectattr('attributes.device_class', 'equalto', 'garbage_collection__schedule') | selectattr('attributes.days', 'equalto', day_offset) | map(attribute='attributes.friendly_name')| list | join(', ') }}"
I can run the above as a tempalte with the variable day_offset replaced with a static number and I get the expected values, but when i call this from the automation leveraging this blueprint, it does not return any text. What am I missing here?
Here is what i’d expect that to look like based on the template tool:
Next issue is related to the above. There is a condition which should control if this automation should even run. E.g. if you get no results on the above query, do not run, but it seems to still be running and just sending empty text. Here is the condition statement:
condition:
condition: template
value_template: "{{ sensors_tomorrow != '' }}"
Any pointers on the above would be much apprecaited. I feel like i’m very close and pulling my hair out over something trivial, so hoping to use this as a learning oppurtunity.
Thanks!