Merge pull request #751 from chpego/patch-2

Update DOCS.md
pull/768/head
Fredrik Öhrström 2022-12-25 16:47:16 +01:00 zatwierdzone przez GitHub
commit 16eb9144e8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 15 dodań i 10 usunięć

Wyświetl plik

@ -66,20 +66,25 @@ mqtt:
## Home Assistant integration
Finally, you need to tell Home Assistant how to extract the readings from the MQTT. You can add the following sensor definition into your `sensor:` section of `configuration.yaml`.
Finally, you need to tell Home Assistant how to extract the readings from the MQTT. You can add the following sensor definition into your `mqtt:` section of `configuration.yaml`.
```yaml
sensor:
- platform: mqtt
state_topic: "wmbusmeters/MainWater"
json_attributes_topic: "wmbusmeters/MainWater"
unit_of_measurement: "m3"
value_template: "{{ value_json.total_m3 }}"
name: Water usage
icon: "mdi:gauge"
mqtt:
sensor:
- state_topic: "wmbusmeters/MainWater"
json_attributes_topic: "wmbusmeters/MainWater"
unit_of_measurement: m³
value_template: "{{ value_json.total_m3 }}"
name: Water usage
icon: "mdi:gauge"
state_class: total_increasing
device_class: water
```
_Please note: `MainWater` is the water meter name used in `meters` configuration._
_Please note:
- `MainWater` is the water meter name used in `meters` configuration._
- `device_class` is necessary to be adapt on your meters type (water, gas, etc.) [see here](https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes)
## Support