Skip to content

Commit c9e1a09

Browse files
szogifabaff
authored andcommitted
Raspihats platform update, added smbus, i2c install (home-assistant#3483)
* Raspihats platform update, added smbus, i2c install * Raspihats platform update, added smbus, i2c install
1 parent 9cd72c0 commit c9e1a09

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

source/_components/binary_sensor.raspihats.markdown

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,47 @@ Configuration variables:
4444
- **invert_logic** (*Optional*): Inverts the input logic, default is `false`.
4545
- **device_class** (*Optional*): See device classes in [binary_sensor component](/components/binary_sensor/), default is `None`
4646

47+
## {% linkable_title Directions for installing smbus support on Raspberry Pi %}
48+
49+
Enable I2c interface with the Raspberry Pi configuration utility:
50+
51+
```bash
52+
# pi user environment: Enable i2c interface
53+
$ sudo raspi-config
54+
```
55+
56+
Select `Interfacing options->I2C` choose `<Yes>` and hit `Enter`, then go to `Finish`.
57+
58+
Install dependencies for use the `smbus-cffi` module and enable your _homeassistant_ user to join the _i2c_ group:
59+
60+
```bash
61+
# pi user environment: Install i2c dependencies and utilities
62+
$ sudo apt-get install build-essential libi2c-dev i2c-tools python-dev libffi-dev
63+
64+
# pi user environment: Add homeassistant user to the i2c group
65+
$ sudo usermod -a -G i2c homeassistant
66+
```
67+
68+
### {% linkable_title Check the i2c address of the sensor %}
69+
70+
After installing `i2c-tools`, a new utility is available to scan the addresses of the connected sensors, so you can see the sensor address:
71+
72+
```bash
73+
$ /usr/sbin/i2cdetect -y 1
74+
```
75+
76+
It will output a table like this:
77+
78+
```text
79+
0 1 2 3 4 5 6 7 8 9 a b c d e f
80+
00: -- -- -- -- -- -- -- -- -- -- -- -- --
81+
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
82+
20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- --
83+
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
84+
40: 40 -- -- -- -- -- UU -- -- -- -- -- -- -- -- --
85+
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
86+
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
87+
70: -- -- -- -- -- -- -- 77
88+
```
89+
4790
For more details about the `raspihats` add-on boards for Raspberry PI, visit [raspihats.com](http://www.raspihats.com/).

source/_components/switch.raspihats.markdown

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,48 @@ Configuration variables:
4545
- **invert_logic** (*Optional*): Inverts the output logic, default is `False`.
4646
- **initial_state** (*Optional*): Initial state, default is `None`, can also be `True` or `False`. `None` means no state is forced on the corresponding digital output when this switch is instantiated.
4747

48+
49+
## {% linkable_title Directions for installing smbus support on Raspberry Pi %}
50+
51+
Enable I2c interface with the Raspberry Pi configuration utility:
52+
53+
```bash
54+
# pi user environment: Enable i2c interface
55+
$ sudo raspi-config
56+
```
57+
58+
Select `Interfacing options->I2C` choose `<Yes>` and hit `Enter`, then go to `Finish`.
59+
60+
Install dependencies for use the `smbus-cffi` module and enable your _homeassistant_ user to join the _i2c_ group:
61+
62+
```bash
63+
# pi user environment: Install i2c dependencies and utilities
64+
$ sudo apt-get install build-essential libi2c-dev i2c-tools python-dev libffi-dev
65+
66+
# pi user environment: Add homeassistant user to the i2c group
67+
$ sudo usermod -a -G i2c homeassistant
68+
```
69+
70+
### {% linkable_title Check the i2c address of the sensor %}
71+
72+
After installing `i2c-tools`, a new utility is available to scan the addresses of the connected sensors, so you can see the sensor address:
73+
74+
```bash
75+
$ /usr/sbin/i2cdetect -y 1
76+
```
77+
78+
It will output a table like this:
79+
80+
```text
81+
0 1 2 3 4 5 6 7 8 9 a b c d e f
82+
00: -- -- -- -- -- -- -- -- -- -- -- -- --
83+
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
84+
20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- --
85+
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
86+
40: 40 -- -- -- -- -- UU -- -- -- -- -- -- -- -- --
87+
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
88+
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
89+
70: -- -- -- -- -- -- -- 77
90+
```
91+
4892
For more details about the Raspihats add-on boards for Raspberry PI, visit [raspihats.com](http://www.raspihats.com/).

0 commit comments

Comments
 (0)