Skip to main content

discoverable-tph-280

Table of Contents

Prerequisites

Install the module if you haven't already

See README_ui.md for module installation

MQTT broker configuration

This code has only been tested with an external MQTT broker. I used Eclipse Mosquitto from https://mosquitto.org/. I had trouble using the internal MQTT broker, probably because of port forwarding issues due to running under docker.

Make sure the MQTT integration is installed on the Home Assistant server.

  • Click Settings
  • Click Devices and Services
  • Click Integrations You should find MQTT listed, if not perform the following to install:
  • Click the blue button in the lower right hand corner labeled ADD INTEGRATION
  • Enter MQTT in the search
  • Click MQTT in the list of integrations (it's probably the only one)
  • You'll get a list of MQTT integrations, click the one that says only MQTT If the MQTT integration is installed, do the following:
  • Click the MQTT icon
  • Click Configure
  • Click RE-CONFIGURE MQTT Once you have ensured that the MQTT integration is installed, continue with the following to verify the correct parameters.
  • Enter the Broker (the name or address of you MQTT broker)
  • Enter the port for your MQTT broker, 1883 is the default, but use whatever is neede by the MQTT broker
  • Enter the username, I believe homeassistant is the default
  • Enter the password
  • For MQTT protocol, use 5, 3.1 has been deprecated but will probably work.
  • Click Next in the bottom right
  • For Enable discovery, click the Enable button, if necessary, to enable
  • For Discovery prefix, enter homeassistant, I believe this is the default
  • Enable Birth messages, click the Enable button, if necessary, to enable
  • For Birth message topic, enter homeassistant/status
  • For birth message payload, enter online
  • Click Submit

Module configuration

Specify location of the configuration file

The location of the configuration file is specified in the "config" environment variable. This form is primarily used for starting the module as a service, in which case it is specified as followed in the modules service file:

Environment="config=/etc/discoverable-tph-280/discoverable-tph-280.config"

This is the default if you use "make install" to install the service.

If the config environment variable is not found, then the filesystem is searched in the following order:

  1. .config.yaml in the current directory
  2. config.yaml in the module directory

Configuration parameters

The contents of the .config.yaml file is as follows:

mqtt_broker: host: hastings.attlocal.net username: homeassistant password: wu2veeJoi5ox5ooP8wai9ich0oothaepaeg5keteu4mahwui9iexai7uNufae1sa discovery_prefix: homeassistant state_prefix: hmd gpio: port: 1 address: 0x76

Where the parameters have the following meaning:

  • host: the Broker specified in the MQTT broker configuration on the Home Assistant server
  • username: the username specified in the MQTT broker configuration on the Home Assistant server
  • password: the password specified in the MQTT broker configuration on the Home Assistant server
  • discovery_prefix: the Discovery Prefix specified in the MQTT broker configuration on the Home Assistant Server
  • state_prefix: the state_prefix that the Home Assistant server will use to send state information to the module, this can be of your choosing as this configuration parameter is sent to the Home Assistant server during handshake so that the Home Assistant server knows which prefix to use and therefore there is no place to configure it on the Home Assistant Server
  • port: the i2c port number used to communicate with the BME280 chip, normally 1
  • address: the device address on the i2c bus used to communicate with the BME280 chip, normally 0x76

ChangeLog

0.1.6 - 2023-08-29

  • thermometer.py change import from ha_hqtt_discoverable to ha_mqtt_discoverable
  • base.py, barometer.py, hygrometer.py, thermometer.py, main.py change constructor parameter from mqtt to mqtt_settings

0.1.7 - 2023-08-30

  • add pytest tests
  • rename guage->gauge, Guage->Gauge, GuageInfo->GaugeInfo

0.1.8 - 2023-08-30

  • fix humidity precision

Metadata

Release files for discoverable-tph-280 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for discoverable-tph-280 0.1.8
File Size Uploaded Provenance Actions
discoverable_tph_280-0.1.8.tar.gz 11.5 kB Without provenance Details for discoverable_tph_280-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for discoverable-tph-280 0.1.8
File Interpreter ABI Platform Actions
discoverable_tph_280-0.1.8-py3-none-any.whl Python 3 none any Details for discoverable_tph_280-0.1.8-py3-none-any.whl

Total release size: 25.0 kB

Release files / discoverable_tph_280-0.1.8.tar.gz

Download URL discoverable_tph_280-0.1.8.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3250eded3c0b2c6081e3f7b16ed56973978105d3ea356d1d7842ce3e9b8b58de
BLAKE2b-256 checksum
How to use checksums
a182c0742ab99ba9d85f1ebc6d3888a849bd0616a058d2beae7c13501f23fe73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/6.1.21-v8+

Release files / discoverable_tph_280-0.1.8-py3-none-any.whl

Download URL discoverable_tph_280-0.1.8-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cffd3f3178cd9fd89c8ac6344c3cee8458d87668f4cc3a4824ffb96d8cecea4
BLAKE2b-256 checksum
How to use checksums
0429c56cac73a47f0b71eee3e131e16d4c067ec0fd88b9b8b30b9b5657bf6f60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/6.1.21-v8+

Security for discoverable-tph-280 0.1.8

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page