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
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: mqtt
|
||||
name: Server battery
|
||||
state_topic: &server_battery_topic "battery2mqtt/server/BAT0"
|
||||
value_template: "{{ value_json.capacity }}"
|
||||
unit_of_measurement: '%'
|
||||
json_attributes_topic: *server_battery_topic
|
||||
availability_topic: "battery2mqtt/server/status"
|
||||
device_class: battery
|
||||
mqtt:
|
||||
sensor:
|
||||
- name: Server battery
|
||||
default_entity_id: sensor.server_battery
|
||||
state_topic: &server_battery_topic "battery2mqtt/server/BAT0"
|
||||
value_template: "{{ value_json.capacity }}"
|
||||
unit_of_measurement: '%'
|
||||
json_attributes_topic: *server_battery_topic
|
||||
availability_topic: "battery2mqtt/server/status"
|
||||
device_class: battery
|
||||
```
|
||||
|
||||
# TODO
|
||||
|
||||
Reference in New Issue
Block a user