I have an automation which works perfectly when there is an agenda item with only VAZA16, VAZA17, VAZA18, VAZA19, VAZA20 or VAZA21 in the title or subject.
But is there a way to put in an agenda item where anywhere in the subject or title the words VAZA16, VAZA17, VAZA18, VAZA19, VAZA20 or VAZA21 can be placed and that the automation will search for that in stead of only these words in the subject or title. As an example I want an event in the agenda like this
Party VAZA17 and that the automation out of these event title extracts the VAZA17 and based on that controls the heating of the room.
take a look at the below. caveat: i’m not able to test it. so apologies if it’s not perfect, but i hope the framework works for you.
instead of hardcoding the list of vaza16 through 21, i parsed for vaza followed by any 2 digit number. so vaza15 will set the temperature to 15. vaza02 will set the temperature to 02…
you didn’t say what should happen if there are more than 2 vaza in the text, so i simply picked the first occurance and used just the first.
in my implementation if you have vaza in the middle of a word, e.g. hellovazaworld, it will pick the vaza out and fail unless it says something like hellovaza19world.
it only look in summary for vaza.
in any case, take a look at what i did and let me know if this does or doesn’t work for you.
you had a condition check in your code for temp==0, but it wasn’t in an if/then, so i’m not sure what it was doing. was that working for you? i changed and put it in an if/then that i think is what you intended (??)
Thanks a lot @armedad you really helped me out!!! It’s working.
Is it also possible to limit that the value only can be between 16 and 21 so that only those temperatures can be used?
It seems you are really a scripting guy Which I’am not…