Package: discoverable-tph-280
discoverable-tph-280Table of ContentsPrerequisitesInstall the module if you haven't alreadyMQTT broker configurationModule configurationSpecify location of the configuration fileConfiguration parametersChangeLog0.1.6 - 2023-08-290.1.7 - 2023-08-300.1.8 - 2023-08-30PrerequisitesInstall the module if you haven't alreadySee README_ui.md for module installationMQTT broker configurationThis code has only been tested with an external MQTT broker. I used Eclipse Mosquitto fromhttps://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 SettingsClick Devices and ServicesClick 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 INTEGRATIONEnter MQTT in the searchClick 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 iconClick ConfigureClick 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 brokerEnter the username, I believe homeassistant is the defaultEnter the passwordFor MQTT protocol, use 5, 3.1 has been deprecated but will probably work.Click Next in the bottom rightFor Enable discovery, click the Enable button, if necessary, to enableFor Discovery prefix, enter homeassistant, I believe this is the defaultEnable Birth messages, click the Enable button, if necessary, to enableFor Birth message topic, enter homeassistant/statusFor birth message payload, enter onlineClick SubmitModule configurationSpecify location of the configuration fileThe 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:.config.yaml in the current directoryconfig.yaml in the module directoryConfiguration parametersThe 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: 0x76Where the parameters have the following meaning:host: the Broker specified in the MQTT broker configuration on the Home Assistant serverusername: the username specified in the MQTT broker configuration on the Home Assistant serverpassword: the password specified in the MQTT broker configuration on the Home Assistant serverdiscovery_prefix: the Discovery Prefix specified in the MQTT broker configuration on the Home Assistant Serverstate_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 Serverport: the i2c port number used to communicate with the BME280 chip, normally 1address: the device address on the i2c bus used to communicate with the BME280 chip, normally 0x76ChangeLog0.1.6 - 2023-08-29thermometer.py change import from ha_hqtt_discoverable to ha_mqtt_discoverablebase.py, barometer.py, hygrometer.py, thermometer.py,main.py change constructor parameter from mqtt to mqtt_settings0.1.7 - 2023-08-30add pytest testsrename guage->gauge, Guage->Gauge, GuageInfo->GaugeInfo0.1.8 - 2023-08-30fix humidity precision