syssi / esphome-soyosource-gtn-virtual-meter

ESPHome component to simulate the current clamp to control the Soyosource GTN1200 limiter
Apache License 2.0
78 stars 21 forks source link

Add basic display support #45

Closed syssi closed 2 years ago

syssi commented 2 years ago

Introduce a soyosource_display component to replace the ESP8266 dongle of the WiFi version.

https://forum.drbacke.de/viewtopic.php?p=22798#p22798 https://forum.drbacke.de/viewtopic.php?p=22806#p22806 https://forum.drbacke.de/viewtopic.php?p=23878#p23878 https://github.com/jsphuebner/esp-egycounter/blob/main/battery-control/soyosource_inverter.py

Status request >>> 55 01 00 00 00 00 00 00 00 00 00 FE
Status response <<< A6 03 84 91 - 40 01 C5 00 DB 00 F7 63 02 BC FE

0x40 = Operation mode (40: BAT, 42, PV)
0x01 0xC5 = 45.3 V
0x00 0xDB = 21.9 A
0x00 0xF7 = 247 V
0x63 = 98 = 49.5 Hz (/2)
0x02 0xBC = 700 = 50 °C (/10-20)
0xFE = Checksun
Read settings request >>> 55 03 00 00 00 00 00 00 00 00 00 FC
Read settings response <<< A6 01 72 93 - 40 D4 30 2C 2B 00 FA 64 5A 03 A3

0x40 = Operation mode (40: BAT, 42: PV)
0xD4 = Unknown
0x30 = Unknown
0x2C = Starting voltage (44 V)
0x2B = Shutdown voltage (43 V)
0x00 0xFA - Grid voltage (250 V)
0x64 = Grid frequency (100/2 = 50 Hz)
0x5A = 90 Battery output power (steps of ten: 90, 100, 110)
0x03 = Delay time in seconds
0xA3 = Checksun

Write settings >>> 55 0B 2C 2B 5A 63 00 00 00 04 12 CA
Write settings has no response
jsphuebner commented 2 years ago

Read settings request >>> 55 03 00 00 00 00 00 00 00 00 00 FC

Write settings has no reply

syssi commented 2 years ago

Checksum

#!/usr/bin/python3

frames = [
  [0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], # FE
  [0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], # FC
  [0x0B, 0x2C, 0x2B, 0x5A, 0x63, 0x00, 0x00, 0x00, 0x04, 0x12], # CA
  [0x0B, 0x2D, 0x2B, 0x5A, 0x64, 0x00, 0x00, 0x00, 0x04, 0x12], # C8
  [0x01, 0x72, 0x93, 0x40, 0xD4, 0x30, 0x2C, 0x2B, 0x00, 0xFA, 0x64, 0x5A, 0x03], # A3
  [0x03, 0x84, 0x91, 0x40, 0x01, 0xC5, 0x00, 0xDB, 0x00, 0xF7, 0x63, 0x02, 0xBC], # FE vs. EE
]

for frame in frames:
  sum = 0xff
  for i in frame:
    sum = (sum - i) & 0xff
  print(hex(sum))
syssi commented 2 years ago

Pinout USB-TTL: 5V, TX, RX, GND

syssi commented 2 years ago

Fixed #46.