Hi all,
I’ve been trying to use a current state node for a simple, or at least seemingly simple automation, where I want to send an alert if a string returned for a sensor contains some specific text in it, but since the sensor changes from day to day, I just want it to match a specific word in the string.
I thought using the if state in string would do the trick, but I can’t seem to make it match, no matter what I try.
Specifically, this is for a sensor that shows the Norwegian Postal services delivery days, and I want it to trigger a notification (code: https://github.com/ezand/home-assistant-config/blob/fad6b0af737a9240d1c8b6d4534fc586f58f86a6/sensors/posten-delivery-days.yaml)
The string the sensor returns is this:
msg.payload : string[129]
"['i morgen tirsdag 7. september', 'torsdag 9. september', 'mandag 13. september', 'onsdag 15. september', 'fredag 17. september']"
My Current State node looks like this:
Shouldn’t the if state in string = I morgen evaluation there trigger on the sensor.postendeliverydays string value, or am I missing something very obvious here? I’ve tried all sorts of other matches, but it always returns false, unless I change it to not in, then it returns true. Obviously I’m doing something wrong here, but I can’t find out what. Any pointers?


