Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Solaredgeevufix
Browse files Browse the repository at this point in the history
  • Loading branch information
snaptec committed Mar 29, 2019
1 parent 2c23f9f commit 55f332e
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 17 deletions.
Binary file added .regel.sh.swp
Binary file not shown.
86 changes: 71 additions & 15 deletions modules/bezug_solaredge/solaredge.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,83 @@
f.write(str(final))
f.close()

resp= client.read_holding_registers(40191,1,unit=1)
resp= client.read_holding_registers(40193,2,unit=slave1id)
multipli = resp.registers[0]
multiplint = format(multipli, '04x')
fmultiplint = int(struct.unpack('>h', multiplint.decode('hex'))[0])
resp= client.read_holding_registers(40190,1,unit=1)
value1 = resp.registers[0]
all = format(value1, '04x')
final = int(struct.unpack('>h', all.decode('hex'))[0]) * -1
f = open('/var/www/html/openWB/ramdisk/bezuga1', 'w')
f.write(str(final))
f.close()
resp= client.read_holding_registers(40192,1,unit=1)
finala1 = int(struct.unpack('>h', all.decode('hex'))[0]) * -1
resp= client.read_holding_registers(40191,1,unit=1)
value1 = resp.registers[0]
all = format(value1, '04x')
final = int(struct.unpack('>h', all.decode('hex'))[0]) * -1
f = open('/var/www/html/openWB/ramdisk/bezuga2', 'w')
f.write(str(final))
f.close()
resp= client.read_holding_registers(40193,1,unit=1)
finala2 = int(struct.unpack('>h', all.decode('hex'))[0]) * -1
resp= client.read_holding_registers(40192,1,unit=1)
value1 = resp.registers[0]
all = format(value1, '04x')
final = int(struct.unpack('>h', all.decode('hex'))[0]) * -1
f = open('/var/www/html/openWB/ramdisk/bezuga3', 'w')
f.write(str(final))
f.close()
finala3 = int(struct.unpack('>h', all.decode('hex'))[0]) * -1


resp= client.read_holding_registers(40193,2,unit=slave1id)
mult2ipli = resp.registers[0]
mult2iplint = format(mult2ipli, '04x')
fmult2iplint = int(struct.unpack('>h', mult2iplint.decode('hex'))[0])

if fmultiplint == fmult2iplint:
if fmultiplint == 4:
finala1 = finala1 * 10000
finala2 = finala2 * 10000
finala3 = finala3 * 10000
if fmultiplint == 3:
finala1 = finala1 * 1000
finala2 = finala2 * 1000
finala3 = finala3 * 1000
if fmultiplint == 2:
finala1 = finala1 * 100
finala2 = finala2 * 100
finala3 = finala3 * 100
if fmultiplint == 1:
finala1 = finala1 * 10
finala2 = finala2 * 10
finala3 = finala3 * 10
if fmultiplint == 0:
finala1 = finala1
finala2 = finala2
finala3 = finala3
if fmultiplint == -1:
finala1 = finala1 / 10
finala2 = finala2 / 10
finala3 = finala3 / 10
if fmultiplint == -2:
finala1 = finala1 / 100
finala2 = finala2 / 100
finala3 = finala3 / 100
if fmultiplint == -3:
finala1 = finala1 / 1000
finala2 = finala2 / 1000
finala3 = finala3 / 1000
if fmultiplint == -4:
finala1 = finala1 / 10000
finala2 = finala2 / 10000
finala3 = finala3 / 10000
if fmultiplint == -5:
finala1 = finala1 / 100000
finala2 = finala2 / 100000
finala3 = finala3 / 100000
f = open('/var/www/html/openWB/ramdisk/bezuga1', 'w')
f.write(str(finala1))
f.close()
f = open('/var/www/html/openWB/ramdisk/bezuga2', 'w')
f.write(str(finala2))
f.close()
f = open('/var/www/html/openWB/ramdisk/bezuga3', 'w')
f.write(str(finala3))
f.close()




#resp= client.read_holding_registers(40084,2,unit=1)
#multipli = resp.registers[0]
#multiplint = format(multipli, '04x')
Expand Down
4 changes: 2 additions & 2 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
<br>
<?php if ($graphliveamold == 1) {
echo '
<div style="height:400px;" id="chartdiv"></div>
<div style="height:300px;" id="chartdiv"></div>
';
} else {
echo '
Expand Down Expand Up @@ -895,7 +895,7 @@
<div class="col-xs-4">


<!-- master --> Ver 1.352 Beta </div>
<!-- master --> Ver 1.353 Beta </div>


<div class="col-xs-4 text-center">
Expand Down

0 comments on commit 55f332e

Please sign in to comment.