kellbot
(Kellbot)
December 5, 2024, 7:52pm
1
I’m using the Spoolman integration, which does some funky stuff with the string value of the custom data it sets as an attribute:
I have an automation that is comparing another entity’s tag_uid attribute to it, but that one looks pretty normal:
I’m struggling to write a value template that successfully compares the two.
Right now I have
{{ state_attr('sensor.ams_1_tray_1', 'tag_uid') | string }} in {{ state_attr('sensor.pla_red_shimmer_pla', 'extra_rfid_tag_string') }}
But I think the escape characters in what’s coming from Spoolman are throwing it off, and I’m not sure how to get around it.
Any suggestions are appreciated, thanks!
Hellis81
(Hellis81)
December 5, 2024, 7:57pm
2
No, the issue is probably because you wrote two separate syntaxes.
Try this instead
{{ state_attr('sensor.ams_1_tray_1', 'tag_uid') | string in state_attr('sensor.pla_red_shimmer_pla', 'extra_rfid_tag_string') }}
I removed the }}
and {{
where in
is.
But if it is the \"
then you probably just need to remove "
since the backslash is probably just an escape character to visualize it for humans.
But you should probably also talk to the developer of the integration why these are left in the string
kellbot
(Kellbot)
December 5, 2024, 7:58pm
3
oh, yep! You’re 100% correct. Works perfectly now. Thank you!