Skip to content

Commit 9268d5c

Browse files
nodinosaurfabaff
authored andcommitted
Fix merge error & added doc for sensehat new flag (#2100)
* Fix merge error & added doc for sensehat new flag * Changes as per PR comments
1 parent 7fa3069 commit 9268d5c

File tree

1 file changed

+58
-53
lines changed

1 file changed

+58
-53
lines changed

source/_components/sensor.sensehat.markdown

Lines changed: 58 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -34,56 +34,13 @@ Configuration variables:
3434
- 'temperature'
3535
- 'humidity'
3636
- 'pressure'
37+
is_hat_attached (Optional): True|False boolean; Default value is True declaring that the SenseHAT _is_ physically on the Raspberry Pi
38+
3739

38-
### {% linkable_title Installation instruction for the All-In-One installer and HASSbian %}
40+
#### Customizing the Sense HAT data
3941

40-
Here are the steps to make the Sense HAT sensor work with a virtual environment.
41-
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.
42+
**Format the sensor values**
43+
Add the following to your `sensor`
8744

8845
```yaml
8946
# Example configuration.yaml entry
@@ -107,7 +64,8 @@ sensor:
10764
unit_of_measurement: '%'
10865
```
10966

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

11270
```yaml
11371
# Example configuration.yaml entry
@@ -121,9 +79,10 @@ customize:
12179
sensor.sensehat_pressure:
12280
icon: mdi:gauge
12381
friendly_name: "Pressure"
124-
```
82+
```
12583

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

12887
```yaml
12988
# Example configuration.yaml entry
@@ -135,13 +94,59 @@ group:
13594
- sensor.sensehat_humidity
13695
- sensor.sensehat_pressure
13796
```
138-
13997
Add the _sense_hat group_ a group (_Kitchen for example_)
140-
14198
```yaml
14299
# Example configuration.yaml entry
143100
group:
144101
kitchen:
145102
- group.sense_hat
146103
```
147104

105+
106+
### Directions for installing on Raspberry Pi All-In-One installer and HASSbian:
107+
Here are the steps to make the _SenseHAT_ sensor work _successfully_ with the virtual enviroment versions.
108+
109+
#### Install SenseHAT package to _homeassistant_venv_
110+
```bash
111+
# switch to the homeassistant_venv environment
112+
sudo su -s /bin/bash homeassistant
113+
source /srv/homeassistant/homeassistant_venv/bin/activate
114+
115+
# install the sense-hat lib
116+
pip3 install sense-hat
117+
# be patient, this will take a long while
118+
```
119+
#### Return to `pi`
120+
Type `exit` to quit out of the _homeassistant_venv_ back to your `pi` environment.
121+
122+
As all of the following steps should be under the `pi` user environment.
123+
124+
###### Install _RTIMU_
125+
126+
```bash
127+
# Install RTIMU to pi user environment
128+
pip3 install rtimulib
129+
130+
# Add symlink to RTIMU in _homeassistant_venv_
131+
# Create a symlink using the following command:
132+
ln -s /usr/lib/python3/dist-packages/RTIMU.cpython-34m-arm-linux-gnueabihf.so /srv/homeassistant/homeassistant_venv/lib/python3.4/
133+
134+
# Add _homeassistant_ user to the _input_ and the _i2c_ groups
135+
sudo addgroup homeassistant input
136+
sudo addgroup homeassistant i2c
137+
138+
# Reboot Raspberry Pi to apply changes
139+
sudo reboot
140+
```
141+
142+
Unfortunately enabling the SenseHAT Sensor component for a Virtual Environment install of Home-Assistant fails with errors.
143+
_(The Raspberry Pi All-In-One installer and HASSbian both run Home-Assistant in an virtual environment)._
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)