视频教程如下:
https://youtu.be/G1pRuM7ccsQ

本教程仅适用于树莓派

树派开启SPI

sudo raspi-config 选5,接口选项->选P5 I2C-> 开启

连线方法:

此内容查看价格为1.99智能币立即购买
你的支持是我更新原创的动力,如果有疑问详询qq:16900693

sudo apt-get update sudo apt-get install build-essential python-dev python-smbus i2c-tools -y git clone https://github.com/adafruit/Adafruit_Python_BMP.git cd Adafruit_Python_BMP sudo python setup.py install sudo wget https://sumju.net/bmp180.py sudo mv bmp180.py /usr/local/bin/ sudo chmod +x /usr/local/bin/bmp180.py

Home Assistant 配置:

sensor:   - platform: command_line     name: 温度     command: "sudo bmp180.py temperature"     unit_of_measurement: "°C"     value_template: '{{ value | round(2) }} '   - platform: command_line     name: 气压     command: "sudo bmp180.py pressure"     value_template: '{{ value | round(2) }} '     unit_of_measurement: "Pa"   - platform: command_line     name: 海拔     command: "sudo bmp180.py altitude"     value_template: '{{ value | round(2) }} '     unit_of_measurement: "m"

发表回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据