/ha_custom_filters

Custom filters for Home Assistant

Primary LanguagePythonOtherNOASSERTION

Custom filters for jinja (Home Assistant)

Installation

Manual mode

Place the custom_filters folder into your custom_components folder.

Adding custom repository to HACS

Go to the Integrations page in HACS and select the three dots in the top right corner. Select Custom repositories. Add repository url. Category - Integration. Read more on https://hacs.xyz/docs/faq/custom_repositories.

Add custom_filters: to your configuration.yaml.

Filters

unquote                     - replace %xx escapes by their single-character equivalent.
urldecode                   - alias for `unqoute`
ternary                     - to use one value on true, one value on false and a third value on null
shuffle                     - randomize an existing list, giving a different order every invocation
deflate                     - zlib decompress
inflate                     - zlib compress
decode_base64_and_inflate   - decode base64 content and decompress it
deflate_and_base64_encode   - compress content and base64 encode it
decode_valetudo_map         - decode Valetudo(https://github.com/Hypfer/Valetudo) map
ts_ago                      - humanised distance in time to now from given timestamp