mirror of
https://github.com/Tediore/battery2mqtt.git
synced 2025-12-28 16:22:58 +01:00
Update to current format for Home Assistant MQTT sensor
This commit is contained in:
19
README.md
19
README.md
@@ -112,15 +112,16 @@ You can monitor the status of the AC adapter (online or offline) by setting `AC_
|
|||||||
|
|
||||||
# Example Home Assistant configuration
|
# Example Home Assistant configuration
|
||||||
```yaml
|
```yaml
|
||||||
sensor:
|
mqtt:
|
||||||
- platform: mqtt
|
sensor:
|
||||||
name: Server battery
|
- name: Server battery
|
||||||
state_topic: &server_battery_topic "battery2mqtt/server/BAT0"
|
default_entity_id: sensor.server_battery
|
||||||
value_template: "{{ value_json.capacity }}"
|
state_topic: &server_battery_topic "battery2mqtt/server/BAT0"
|
||||||
unit_of_measurement: '%'
|
value_template: "{{ value_json.capacity }}"
|
||||||
json_attributes_topic: *server_battery_topic
|
unit_of_measurement: '%'
|
||||||
availability_topic: "battery2mqtt/server/status"
|
json_attributes_topic: *server_battery_topic
|
||||||
device_class: battery
|
availability_topic: "battery2mqtt/server/status"
|
||||||
|
device_class: battery
|
||||||
```
|
```
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
Reference in New Issue
Block a user