项目作者: myDevicesIoT

项目描述 :
A DHT sensor plugin for Cayenne
高级语言: Python
项目地址: git://github.com/myDevicesIoT/cayenne-plugin-dht.git
创建时间: 2018-10-16T00:02:00Z
项目社区:https://github.com/myDevicesIoT/cayenne-plugin-dht

开源协议:MIT License

下载


Cayenne DHT Plugin

A plugin allowing the Cayenne Pi Agent to read data from DHT11, DHT22 and AM2302 sensors and display it in the Cayenne Dashboard.

Requirements

Hardware

Software

  • Cayenne Pi Agent. This can be installed from the Cayenne Dashboard.
  • Git.
  • pip3 - Python 3 package manager. This should already be available in Python 3.4+ and above. If not it can be installed using the system package manager. Via apt-get this would be:
    1. sudo apt-get install python3-pip

Getting Started

1. Installation

From the command line run the following commands to install this plugin.

  1. cd /etc/myDevices/plugins
  2. sudo git clone https://github.com/myDevicesIoT/cayenne-plugin-dht.git
  3. cd cayenne-plugin-dht
  4. sudo pip3 install .

2. Setting the sensor type and pin

Specify the sensor type and pin you are using by modifying init_args under DHT Temperature in the cayenne_dht.plugin file.
For a DHT11 use 11 for the sensor argument, for a DHT22 use 22 and for a AM2302 use 22. Set the pin argument to the GPIO
pin number your sensor is connected to. For example, a DHT11 on pin 17 would use the following:

  1. init_args={"sensor": 11, "pin": 17}

3. Restarting the agent

Restart the agent so it can load the plugin.

  1. sudo service myDevices restart

Temporary widgets for the plugin should now show up in the Cayenne Dashboard. You can make them permanent by clicking the plus sign.

NOTE: If the temporary widgets do not show up try refreshing the Cayenne Dashboard or restarting the agent again using sudo service myDevices restart.