openhab-docs/_addons_transformations/jinja
openhab-bot 16363c87f7 Updated external content (Jenkins build 193) 2019-03-05 00:31:47 +00:00
..
readme.md Updated external content (Jenkins build 193) 2019-03-05 00:31:47 +00:00

readme.md

id label title type description since install
jinja Jinja Jinja - Transformation Services transform Transforms a value using a jinja template. 2x auto

{% include base.html %}

Jinja Transformation Service

Transforms a value using a jinja template.

The main purpose of this transformer is the use in the home assistant discovery. Therfore not all features of the home assistant templating are supported. Basically on Processing incoming data

Available variables

Variable Description
value The incoming value.
value_json The incoming value parsed as JSON.

Examples

Basic Example

Given the value

{"Time":"2019-01-05T22:45:12","AM2301":{"Temperature":4.7,"Humidity":93.7},"TempUnit":"C"}

the template

::: v-pre {{value_json['AM2301'].Temperature}} :::

extracts the string 4.7.

Further Reading