From f71665e894154ebd0bfc496e6b172f69868619b0 Mon Sep 17 00:00:00 2001 From: Jasper Ennik Date: Mon, 13 Jun 2022 21:45:10 +0200 Subject: [PATCH] Fixes --- Examples/docker-compose.yml | 4 ++-- pvmqtt.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Examples/docker-compose.yml b/Examples/docker-compose.yml index b0f5422..2a8c975 100644 --- a/Examples/docker-compose.yml +++ b/Examples/docker-compose.yml @@ -50,7 +50,7 @@ services: - pvinflux=True - pvinflux2=True - - pvifhost=influxdb + - pvifhost=localservername - pvif2protocol=http - pvif2org=acme - pvif2bucket=fusionsolar @@ -61,7 +61,7 @@ services: - pvpvoutputapikey=GENERATE_THIS_AND_SYSTEMID_ON_PVOUTPUT.ORG - pvmqtt=True - - pvmqtthost=mosquitto + - pvmqtthost=localservername - pvmqttauth=False volumes: diff --git a/pvmqtt.py b/pvmqtt.py index 2d6aff6..a7b127e 100644 --- a/pvmqtt.py +++ b/pvmqtt.py @@ -20,6 +20,7 @@ def publish_to_mqtt(self, fusionsolar_json_data): auth_obj = None try: + self.logger.info("Publishing to MQTT. Data: {}".format(jsonmsg)) publish.single( self.conf.mqtttopic, payload=jsonmsg, @@ -30,8 +31,7 @@ def publish_to_mqtt(self, fusionsolar_json_data): client_id=self.conf.pvsysname, keepalive=60, auth=auth_obj - ) - self.logger.info("Published data to MQTT: {}".format(str(jsonmsg))) + ) except TimeoutError as e: self.logger.error("Timeout while publishing to MQTT: '{}'".format(str(e)))