I have setup the imap email content sensor and it works as expected except when I get an email from my camera recorder. The message looks fine in email clients but in HA, it looks like this.
Yep - @tinkerer is right! It is Base64 encoded, the see the same value he posted.
But I am not sure the base64 decoding is available in templates just yet… I believe it has to be implemented. You can use python_script and pass that information to python_script and you can decode there.
Thanks for steering me in the right direction. I’ll try a python script but I think i need to return the decoded value back to HA through MQTT or API. I am hoping for a simpler solution like using a command line but I don’t think shell command will return values.
I decided to go with php because i used it before for mqtt. This is the php code which I will run with a shell command on the state change of the imap content sensor. It can be used to read HA info and post on mqtt for HA to consume.