Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Commit

Permalink
Updated default power device switch type to 'Return' and set it to us…
Browse files Browse the repository at this point in the history
…ed by default
  • Loading branch information
dylian94 committed Aug 10, 2019
1 parent 6990d75 commit c45f263
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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())

Expand Down

0 comments on commit c45f263

Please sign in to comment.