Skip to content

Commit 0f2fa10

Browse files
committed
Update the formatting and move the customization part to the end
1 parent 536d0b5 commit 0f2fa10

File tree

1 file changed

+52
-57
lines changed

1 file changed

+52
-57
lines changed

source/_components/sensor.sensehat.markdown

Lines changed: 52 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,55 @@ Configuration variables:
3535
- 'humidity'
3636
- 'pressure'
3737

38+
### {% linkable_title Installation instruction for the All-In-One installer and HASSbian %}
3839

39-
###### Customizing the Sense HAT data
40+
Here are the steps to make the Sense HAT sensor work with a virtual environment.
4041

41-
**Format the sensor values**
42-
Add the following to your `sensor`
42+
Install SenseHAT package. Switch to the `homeassistant_venv` directory and activate the virtual environment.
43+
44+
```bash
45+
$ sudo su -s /bin/bash homeassistant
46+
$ source /srv/homeassistant/homeassistant_venv/bin/activate
47+
```
48+
49+
Install the `sense-hat` module.
50+
51+
```bash
52+
$ pip3 install sense-hat
53+
```
54+
55+
Please be patient, this will take a long while...
56+
57+
Type `exit` to quit out of the _homeassistant_venv_ back to your `pi` environment. As all of the following steps should be under the `pi` user environment.
58+
59+
Install the [RTIMU](https://github.com/RPi-Distro/RTIMULib) Python module:
60+
61+
```bash
62+
$ pip3 install rtimulib
63+
```
64+
65+
Add symlink to RTIMU in `homeassistant_venv` directory. Create a symlink using the following command:
66+
67+
```bash
68+
$ ln -s /usr/lib/python3/dist-packages/RTIMU.cpython-34m-arm-linux-gnueabihf.so /srv/homeassistant/homeassistant_venv/lib/python3.4/
69+
```
70+
71+
Add `homeassistant` user to the `input` and the `i2c` groups.
72+
73+
```bash
74+
$ sudo addgroup homeassistant input
75+
$ sudo addgroup homeassistant i2c
76+
```
77+
78+
Reboot Raspberry Pi to apply changes.
79+
80+
```bash
81+
$ sudo reboot
82+
```
83+
84+
### {% linkable_title Customizing the Sense HAT data %}
85+
86+
To format the sensor values, add the following to your `sensor` entry in your `configuration.yaml` file.
4387

4488
```yaml
4589
# Example configuration.yaml entry
@@ -63,8 +107,7 @@ sensor:
63107
unit_of_measurement: '%'
64108
```
65109

66-
**Give the values friendly names & icons**
67-
Add the following to your `customize`
110+
Add the following to your `customize` section to set friendly names & icons for the values.
68111

69112
```yaml
70113
# Example configuration.yaml entry
@@ -78,10 +121,9 @@ customize:
78121
sensor.sensehat_pressure:
79122
icon: mdi:gauge
80123
friendly_name: "Pressure"
81-
```
124+
```
82125

83-
**Create a group**
84-
Add the following to your `groups`
126+
Create a group for your Sense HAT details by adding the following to your `groups` section.
85127

86128
```yaml
87129
# Example configuration.yaml entry
@@ -93,60 +135,13 @@ group:
93135
- sensor.sensehat_humidity
94136
- sensor.sensehat_pressure
95137
```
138+
96139
Add the _sense_hat group_ a group (_Kitchen for example_)
140+
97141
```yaml
98142
# Example configuration.yaml entry
99143
group:
100144
kitchen:
101145
- group.sense_hat
102146
```
103147

104-
105-
#### Directions for installing on Raspberry Pi All-In-One installer and HASSbian:
106-
Here are the steps to make the _SenseHAT_ sensor work _successfully_ with the virtual enviroment versions.
107-
108-
###### Install SenseHAT package to _homeassistant_venv_
109-
```bash
110-
# switch to the homeassistant_venv environment
111-
sudo su -s /bin/bash homeassistant
112-
source /srv/homeassistant/homeassistant_venv/bin/activate
113-
114-
# install the sense-hat lib
115-
pip3 install sense-hat
116-
# be patient, this will take a long while
117-
```
118-
###### Return to `pi`
119-
Type `exit` to quit out of the _homeassistant_venv_ back to your `pi` environment.
120-
121-
As all of the following steps should be under the `pi` user environment.
122-
123-
###### Install _RTIMU_
124-
125-
```bash
126-
# Install RTIMU to pi user environment
127-
pip3 install rtimulib
128-
129-
# Add symlink to RTIMU in _homeassistant_venv_
130-
# Create a symlink using the following command:
131-
ln -s /usr/lib/python3/dist-packages/RTIMU.cpython-34m-arm-linux-gnueabihf.so /srv/homeassistant/homeassistant_venv/lib/python3.4/
132-
133-
# Add _homeassistant_ user to the _input_ and the _i2c_ groups
134-
sudo addgroup homeassistant input
135-
sudo addgroup homeassistant i2c
136-
137-
# Reboot Raspberry Pi to apply changes
138-
sudo reboot
139-
```
140-
141-
Unfortunately, enabling the SenseHAT Sensor component for a Virtual Environment install of Home-Assistant fails with errors.
142-
_(The Raspberry Pi All-In-One installer and HASSbian both run Home-Assistant in an virtual environment)._
143-
144-
These issues have been discussed in the repository issue [#5093](https://github.com/home-assistant/home-assistant/issues/5093)
145-
146-
This fix has been tested with a clean install of:
147-
148-
* [Raspbian Jessie - version January 2017](https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-01-10/)
149-
150-
and
151-
152-
* [Home-Assistant 0.37.1](https://home-assistant.io/getting-started/installation-raspberry-pi-all-in-one/)

0 commit comments

Comments
 (0)