Skip to content

Commit 1fd1617

Browse files
authored
Add version sensor docs (home-assistant#3163)
* Add version sensor docs * Fix typo
1 parent 6baa22d commit 1fd1617

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
layout: page
3+
title: "Version Sensor"
4+
description: "Instructions how to integrate a version sensor into Home Assistant."
5+
date: 2017-08-10 10:30
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
ha_category: Sensor
11+
ha_iot_class: "Local Pushing"
12+
logo: home-assistant.png
13+
ha_release: 0.52
14+
---
15+
16+
17+
The `version` sensor platform is displaying the current version of Home Assistant in the frontend.
18+
19+
To enable this sensor, add the following lines to your `configuration.yaml` file for a GET request:
20+
21+
```yaml
22+
# Example configuration.yaml entry
23+
sensor:
24+
- platform: version
25+
```
26+
27+
Configuration variables:
28+
29+
- **name** (*Optional*): Name of the sensor. Defaults to `Current Version`.
30+
31+
## {% linkable_title Alternatives %}
32+
33+
This sensor is an alternative to the existing solutions to achieve the same result through various platforms. Remember that you can easily get the installed version on the command line.
34+
35+
```bash
36+
$ hass --version
37+
```
38+
39+
Or go to the <img src='/images/screenshots/developer-tool-about-icon.png' alt='service developer tool icon' class="no-shadow" height="38" /> **Info** section of the **Developer Tools**.
40+
41+
A [`command_line`](/components/sensor.command_line/) with [`hass`](/docs/tools/hass/) to display your current version.
42+
43+
```yaml
44+
sensor:
45+
- platform: command_line
46+
name: Version
47+
command: "/home/homeassistant/bin/hass --version"
48+
```
49+
50+
It's also possible to ready a file called `.HA_VERSION` which is located in your Home Assistant [configuration](/docs/configuration/) folder.
51+
52+
```yaml
53+
sensor:
54+
- platform: command_line
55+
name: Version
56+
command: "cat /home/homeassistant/.homeassistant/.HA_VERSION"
57+
```
58+
59+
You might think that a [`rest` sensor](/components/sensor.rest/) could work to but it will not as Home Assistant is not ready when the sensor get initialized.
60+
61+
```yaml
62+
sensor:
63+
- platform: rest
64+
resource: http://IP_ADDRESS:8123/api/config
65+
name: Current Version
66+
value_template: '{{ value_json.version }}'
67+
```

0 commit comments

Comments
 (0)