Envirophat MQTT
Poll a Pimoroni envirophat and publish to MQTT
Install
pip install envirophat_mqtt
python3 ./setup.py sdist install
Configure
usage: envirophat_mqtt [-h] [--mqtt_host MQTT_HOST] [--mqtt_topic MQTT_TOPIC]
[--mqtt_clientid MQTT_CLIENTID] [--mqtt_port MQTT_PORT]
[--poll_time POLL_TIME] [--overscan OVERSCAN]
optional arguments:
-h, --help show this help message and exit
--mqtt_host MQTT_HOST
MQTT host
--mqtt_topic MQTT_TOPIC
MQTT topic
--mqtt_clientid MQTT_CLIENTID
MQTT client ID
--mqtt_port MQTT_PORT
MQTT port
--poll_time POLL_TIME
How often in seconds to poll (60)
--overscan OVERSCAN How many readings to average together during the
polltime
A systemd unit file is provided for use. You may want to edit the settings in the ExecStart line of this file before installing. Copy to /etc/systemd/system/ and then run systemctl daemon-reload.
Use with homeassistant
This is my setup, in my sensors.yaml file:
# garage envirophat
- platform: mqtt
name: garage_temperature
state_topic: merope/envirophat/temperature
unit_of_measurement: '°C'
- platform: mqtt
name: garage_pressure
state_topic: merope/envirophat/pressure
unit_of_measurement: 'hPa'
- platform: mqtt
name: garage_lux
state_topic: merope/envirophat/lux
unix_of_measurement: 'lux'
I run envirophat_mqtt with the following ExecStart:
ExecStart=/usr/local/bin/envirophat_mqtt --mqtt_host elgafar.garbled.net --mqtt_topic merope/envirophat --mqtt_clientid merope
Making sure it works
Run the following command:
mosquitto_sub -v -t "#" -h <your MQTT server>
Watch for messages from the envirophat.
Metadata
Release files for envirophat-mqtt 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| envirophat_mqtt-1.1.tar.gz | 3.1 kB | Without provenance | Details for envirophat_mqtt-1.1.tar.gz |
Release files / envirophat_mqtt-1.1.tar.gz
| Download URL | envirophat_mqtt-1.1.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
377168cab8110b43f8961a02cb8697a234163732c4ab6076dd0aad21b66dddec
|
|
BLAKE2b-256 checksum How to use checksums |
f94c4041151da5e402b2eb847c755d4af8280d4e4a253cbfbc98bebfbc54a7f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3
|
Security for envirophat-mqtt 1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.