Added VE.Bus State
This commit is contained in:
@ -194,6 +194,8 @@ class BasePlugin:
|
|||||||
Domoticz.Device(Name="Frequency OUT L1", Unit=8, TypeName="Custom", Used=0, Options=Options).Create()
|
Domoticz.Device(Name="Frequency OUT L1", Unit=8, TypeName="Custom", Used=0, Options=Options).Create()
|
||||||
if 9 not in Devices:
|
if 9 not in Devices:
|
||||||
Domoticz.Device(Name="Grid Lost", Unit=9, TypeName="Alert", Used=0).Create()
|
Domoticz.Device(Name="Grid Lost", Unit=9, TypeName="Alert", Used=0).Create()
|
||||||
|
if 10 not in Devices:
|
||||||
|
Domoticz.Device(Name="VE.Bus State", Unit=10, TypeName="Text", Used=0).Create()
|
||||||
|
|
||||||
# Battery
|
# Battery
|
||||||
if 20 not in Devices:
|
if 20 not in Devices:
|
||||||
@ -261,6 +263,7 @@ class BasePlugin:
|
|||||||
Devices[7].Update(1, "0")
|
Devices[7].Update(1, "0")
|
||||||
Devices[8].Update(1, "0")
|
Devices[8].Update(1, "0")
|
||||||
Devices[9].Update(1, "0")
|
Devices[9].Update(1, "0")
|
||||||
|
Devices[10].Update(1, "0")
|
||||||
|
|
||||||
# Ac In Voltage
|
# Ac In Voltage
|
||||||
data = client.read_holding_registers(3, 1)
|
data = client.read_holding_registers(3, 1)
|
||||||
@ -402,6 +405,39 @@ class BasePlugin:
|
|||||||
else:
|
else:
|
||||||
Devices[9].Update(nValue=3, sValue="Unknown state ?")
|
Devices[9].Update(nValue=3, sValue="Unknown state ?")
|
||||||
|
|
||||||
|
# VE.Bus state
|
||||||
|
data = client.read_holding_registers(31, 1)
|
||||||
|
Domoticz.Debug("Data from register 31: "+str(data))
|
||||||
|
decoder = BinaryPayloadDecoder.fromRegisters(data, byteorder=Endian.Big, wordorder=Endian.Big)
|
||||||
|
value = decoder.decode_16bit_int()
|
||||||
|
vebus = 'Unknown?'
|
||||||
|
if value == 0:
|
||||||
|
vebus = 'Off'
|
||||||
|
elif value == 1:
|
||||||
|
vebus = 'Low Power'
|
||||||
|
elif value == 2:
|
||||||
|
vebus = 'Fault'
|
||||||
|
elif value == 3:
|
||||||
|
vebus = 'Bulk'
|
||||||
|
elif value == 4:
|
||||||
|
vebus = 'Absorption'
|
||||||
|
elif value == 5:
|
||||||
|
vebus = 'Float'
|
||||||
|
elif value == 6:
|
||||||
|
vebus = 'Storage'
|
||||||
|
elif value == 7:
|
||||||
|
vebus = 'Equalize'
|
||||||
|
elif value == 8:
|
||||||
|
vebus = 'Passthru'
|
||||||
|
elif value == 9:
|
||||||
|
vebus = 'Inverting'
|
||||||
|
elif value == 10:
|
||||||
|
vebus = 'Power assist'
|
||||||
|
elif value == 11:
|
||||||
|
vebus = 'Power supply'
|
||||||
|
Devices[10].Update(1, str(value)+": "+vebus)
|
||||||
|
|
||||||
|
|
||||||
# Multiplus devices
|
# Multiplus devices
|
||||||
Domoticz.Debug("Multiplus Interface : IP="+self.IPAddress +", Port="+str(self.IPPort)+" ID="+str(self.BattAddr))
|
Domoticz.Debug("Multiplus Interface : IP="+self.IPAddress +", Port="+str(self.IPPort)+" ID="+str(self.BattAddr))
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user