diff --git a/source/_components/mqtt.markdown b/source/_components/mqtt.markdown index e829e5da5fb..1a0e649b816 100644 --- a/source/_components/mqtt.markdown +++ b/source/_components/mqtt.markdown @@ -279,6 +279,13 @@ switch: platform: mqtt state_format: 'json:somekey[0].value' ``` +It is also possible to extract JSON values by using a value template: + +```yaml +switch: + platform: mqtt + value_template: '{% raw %}{{ value_json.somekey[0].value }}{% endraw %}' +``` More information about the full JSONPath syntax can be found [here][JSONPath syntax].