From c45f263a8bd431b1a0ef14a784bfb2dd0aa8ee76 Mon Sep 17 00:00:00 2001 From: Dylian Melgert Date: Sat, 10 Aug 2019 05:00:15 +0200 Subject: [PATCH] Updated default power device switch type to 'Return' and set it to used by default --- plugin.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugin.py b/plugin.py index 9c67aca..6a47d7e 100644 --- a/plugin.py +++ b/plugin.py @@ -207,15 +207,14 @@ def onMessage(self, Connection, Data): Domoticz.Device(Name="Solar inverter output voltage (SN: " + inverter["sn"] + ")", Unit=(self.baseDeviceIndex + 3), Type=243, Subtype=8).Create() Domoticz.Device(Name="Solar inverter output power (SN: " + inverter["sn"] + ")", - Unit=(self.baseDeviceIndex + 4), Type=243, Subtype=29).Create() + Unit=(self.baseDeviceIndex + 4), Type=243, Subtype=29, + Switchtype=4, Used=1).Create() Domoticz.Log("Devices created for GoodWe inverter (SN: " + inverter["sn"] + ")") Devices[self.baseDeviceIndex + 1].Update(nValue=0, sValue=str(inverter["tempperature"])) Devices[self.baseDeviceIndex + 2].Update(nValue=0, sValue=str(inverter["output_current"])) Devices[self.baseDeviceIndex + 3].Update(nValue=0, sValue=str(inverter["output_voltage"])) - Devices[self.baseDeviceIndex + 4].Update(nValue=0, - sValue=str(inverter["output_power"]) + ";" + str( - inverter["etotal"])) + Devices[self.baseDeviceIndex + 4].Update(nValue=0, sValue=str(inverter["output_power"]) + ";" + str(inverter["etotal"])) self.baseDeviceIndex += 4 if self.powerStationIndex == (len(self.powerStationList) - 1): @@ -224,8 +223,7 @@ def onMessage(self, Connection, Data): self.httpConn = None self.baseDeviceIndex = 0 else: - Domoticz.Log( - "Retrieving next station data (ID: " + self.powerStationList[self.powerStationIndex] + ")") + Domoticz.Log("Retrieving next station data (ID: " + self.powerStationList[self.powerStationIndex] + ")") self.baseDeviceIndex += 1 Connection.Send(self.stationDataRequest())