mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 15:26:59 +00:00
Fix templates
This commit is contained in:
parent
bd1985f2ad
commit
b43a263a47
@ -50,11 +50,11 @@ Thus the trick is extract the battery level from the payload.
|
|||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yml entry
|
# Example configuration.yml entry
|
||||||
sensor:
|
sensor:
|
||||||
platform: mqtt
|
- platform: mqtt
|
||||||
state_topic: "owntracks/tablet/tablet"
|
state_topic: "owntracks/tablet/tablet"
|
||||||
name: "Battery Tablet"
|
name: "Battery Tablet"
|
||||||
unit_of_measurement: "%"
|
unit_of_measurement: "%"
|
||||||
value_template: {% raw %}'{{ value_json.batt }}'{% endraw %}
|
value_template: {% raw %}'{{ value_json.batt }}'{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Get temperature and humidity %}
|
### {% linkable_title Get temperature and humidity %}
|
||||||
@ -73,17 +73,15 @@ Then use this configuration example to extract the data from the payload:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yml entry
|
# Example configuration.yml entry
|
||||||
sensor 1:
|
sensor:
|
||||||
platform: mqtt
|
- platform: mqtt
|
||||||
state_topic: 'office/sensor1'
|
state_topic: 'office/sensor1'
|
||||||
name: 'Temperature'
|
name: 'Temperature'
|
||||||
unit_of_measurement: '°C'
|
unit_of_measurement: '°C'
|
||||||
value_template: '{{ value_json.temperature }}'
|
value_template: {% raw %}'{{ value_json.temperature }}'{% endraw %}
|
||||||
|
- platform: mqtt
|
||||||
sensor 2:
|
state_topic: 'office/sensor1'
|
||||||
platform: mqtt
|
name: 'Humidity'
|
||||||
state_topic: 'office/sensor1'
|
unit_of_measurement: '%'
|
||||||
name: 'Humidity'
|
value_template: {% raw %}'{{ value_json.humidity }}'{% endraw %}
|
||||||
unit_of_measurement: '%'
|
|
||||||
value_template: '{{ value_json.humidity }}'
|
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user