Skip to content

Commit

Permalink
docs: Sensor templates for lovelace
Browse files Browse the repository at this point in the history
  • Loading branch information
geertmeersman committed Jun 24, 2024
1 parent 29cd6b7 commit a632f3f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ The **REST sensors**, are updated on a configurable scan interval. When the mowe
- [Enable debug logging](#enable-debug-logging)
- [Disable debug logging and download logs](#disable-debug-logging-and-download-logs)
- [Extra sensor for daily mowing time](#extra-sensor-for-daily-mowing-time)
- [Extra template sensors, used for lovelace](#extra-template-sensors-used-for-lovelace)
- [Lovelace examples](#lovelace-examples)
- [Mower card with some nice buttons](#mower-card-with-some-nice-buttons)
- [Screenshots](#screenshots)
Expand Down Expand Up @@ -140,6 +141,34 @@ sensor:
end: "{{ now() }}"
```
## Extra template sensors, used for lovelace
In template.yaml, add the following:
```yaml
- sensor:
- name: "Automower Battery Current"
unique_id: "sensor.automower_battery_current"
unit_of_measurement: "mA"
state: "{{ state_attr('sensor.automower_battery_0', 'current') | replace(' mA', '') | int(0) }}"
icon: "mdi:current-dc"
- name: "Automower Battery Voltage"
unique_id: "sensor.automower_battery_voltage"
unit_of_measurement: "V"
state: "{{ state_attr('sensor.automower_battery_0', 'voltage') | replace(' V', '') | float(0) }}"
icon: "mdi:sine-wave"
- name: "Automower Battery Temperature"
unique_id: "sensor.automower_battery_temperature"
unit_of_measurement: "°C"
state: "{{ state_attr('sensor.automower_battery_0', 'temperature') | replace(' °C', '') | float(0) }}"
icon: "mdi:temperature-celsius"
- name: "Automower Battery Capacity"
unique_id: "sensor.automower_battery_capacity"
unit_of_measurement: "mAh"
state: "{{ state_attr('sensor.automower_battery_0', 'capacity').remaining | replace(' mAh', '') | int(0) }}"
icon: "mdi:battery-charging-medium"
```
## Lovelace examples
### Mower card with some nice buttons
Expand Down

0 comments on commit a632f3f

Please sign in to comment.