Skip to article frontmatterSkip to article content
Template function

MD5

Insecure, useless, still used a darn lot πŸ™ˆ

The md5 function provides an easy way to calculate the MD5 hash of a given value.

Template function properties
FunctionCalculate the MD5 hash of a given value
Function namemd5
ReturnsThe MD5 hash
Return typestring
Can be used as a filterYes
Can be used as a testNo
Spook's influenceNewly added template function
Developer toolsTry this in the template developer tools
Signature
md5(
    value: str
) -> str
Function parameters
AttributeTypeRequiredDefault / Example
valuestringYeshash me

ExamplesΒΆ

Using md5 as a functionΒΆ

1
{{ md5("hash me") }}

Returns:

d09dba7d332adb585d176cf807f00f34

Using md5 as a filterΒΆ

1
{{ "hash me" | md5 }}

Returns:

d09dba7d332adb585d176cf807f00f34

Features requests, ideas, and supportΒΆ

If you have an idea on how to further enhance the Home Assistant template engine, for example, by adding a new template function; feel free to let us know in our discussion forums.

Are you stuck using this new feature? Or maybe you’ve run into a bug? Please check the Support page on where to go for help.