mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-10 07:26:38 +02:00
Merge branch 'main' of https://github.com/grindylow/ahoy
This commit is contained in:
commit
36fb05a6dd
4 changed files with 10 additions and 1 deletions
|
@ -699,6 +699,8 @@ void app::sendMqttDiscoveryConfig(void) {
|
|||
deviceDoc["name"] = iv->name;
|
||||
deviceDoc["ids"] = String(iv->serial.u64, HEX);
|
||||
deviceDoc["cu"] = F("http://") + String(WiFi.localIP().toString());
|
||||
deviceDoc["mf"] = "Hoymiles";
|
||||
deviceDoc["mdl"] = iv->name;
|
||||
JsonObject deviceObj = deviceDoc.as<JsonObject>();
|
||||
DynamicJsonDocument doc(384);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//-------------------------------------
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 5
|
||||
#define VERSION_PATCH 11
|
||||
#define VERSION_PATCH 12
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
|
|
|
@ -16,6 +16,8 @@ ahoy:
|
|||
port: 1883
|
||||
user: 'username'
|
||||
password: 'password'
|
||||
useTLS: False
|
||||
insecureTLS: False #set True for e.g. self signed certificates.
|
||||
|
||||
# Influx2 output
|
||||
influxdb:
|
||||
|
|
|
@ -226,6 +226,11 @@ if __name__ == '__main__':
|
|||
mqtt_config = ahoy_config.get('mqtt', [])
|
||||
if not mqtt_config.get('disabled', False):
|
||||
mqtt_client = paho.mqtt.client.Client()
|
||||
|
||||
if mqtt_config.get('useTLS',False):
|
||||
mqtt_client.tls_set()
|
||||
mqtt_client.tls_insecure_set(mqtt_config.get('insecureTLS',False))
|
||||
|
||||
mqtt_client.username_pw_set(mqtt_config.get('user', None), mqtt_config.get('password', None))
|
||||
mqtt_client.connect(mqtt_config.get('host', '127.0.0.1'), mqtt_config.get('port', 1883))
|
||||
mqtt_client.loop_start()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue