Ok, so I think I can see where I am going wrong. It transpires that marking Yale emails as unread is not adequate for testing purposes. I just triggered my alarm and everything worked as it should, but marking the emails as unread does not work.
However, the other night, my alarm was triggered, and it did not work. I am not sure why but my Garage PIR alert is displayed a little differently from other PIR’s; it does not state interior/perimeter. Can you see any reason why the Garage email below wouldn’t work the same as the others?
The only difference I can see is that “Garage” goes to a new line after “Burglar” and the others do so before. I don’t really see a reason the regex would fail due to a line break symbol there and not elsewhere, but you could try an even simpler expression like:
{{ trigger.event.data['text'] | regex_findall(find='(?<=Device Name:).*?Burglar', ignorecase=False) | list | first }}