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:
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:
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.
For the first template, could it be due to a type incompatibility? Perhaps the day_offset variable is being handled as a string whereas attributes.days is a number. Therefore the comparison performed by selectattr always fails because it’s comparing a number to a string.
Thank you @123,that fixed that issue.so now just the conditional issue left.if I change the date offset to out of range where the values returned to be null or empty,its still triggering when testing.
@123 , I did check there. Now that its working, i can actually see the values change, but still doesn’t totally explain why the condition isn’t working.
This did indeed fix it. I was digging through the forums and was looking at something similar you had posted for someone else when you posted this. So thank you for your contributions here!
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.