Skip to content

Instantly share code, notes, and snippets.

@ledermann
Created June 21, 2023 09:30
Show Gist options
  • Save ledermann/d03247fdc0dec5ef7e21d1d352f9fc94 to your computer and use it in GitHub Desktop.
Save ledermann/d03247fdc0dec5ef7e21d1d352f9fc94 to your computer and use it in GitHub Desktop.
SENEC-Speicher per API vollladen oder entladen

Vollladung

curl 'http://senec/lala.cgi' \
 -H 'Accept: application/json, text/javascript, _/_; q=0.01' \
 -H 'Accept-Language: de-DE,de;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6' \
 -H 'Connection: keep-alive' \
 -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
 -H 'DNT: 1' \
 -H 'Origin: http://senec' \
 -H 'Referer: http://senec/' \
 -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.78' \
 -H 'X-Requested-With: XMLHttpRequest' \
 --data-raw '{"ENERGY":{"SAFE_CHARGE_FORCE":"u8_01","SAFE_CHARGE_PROHIBIT":"","SAFE_CHARGE_RUNNING":"","LI_STORAGE_MODE_START":"","LI_STORAGE_MODE_STOP":"","LI_STORAGE_MODE_RUNNING":""}}' \
 --compressed \
 --insecure

Entscheidend ist offenbar SAFE_CHARGE_FORCE = 1

Entladen freigeben

curl 'http://senec/lala.cgi' \
 -H 'Accept: application/json, text/javascript, _/_; q=0.01' \
 -H 'Accept-Language: de-DE,de;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6' \
 -H 'Connection: keep-alive' \
 -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
 -H 'DNT: 1' \
 -H 'Origin: http://senec' \
 -H 'Referer: http://senec/' \
 -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.78' \
 -H 'X-Requested-With: XMLHttpRequest' \
 --data-raw '{"ENERGY":{"SAFE_CHARGE_FORCE":"","SAFE_CHARGE_PROHIBIT":"u8_01","SAFE_CHARGE_RUNNING":"","LI_STORAGE_MODE_START":"","LI_STORAGE_MODE_STOP":"","LI_STORAGE_MODE_RUNNING":""}}' \
 --compressed \
 --insecure

Entscheidend ist offenbar SAFE_CHARGE_PROHIBIT = 1

Ladezustand abfragen

curl 'http://senec/lala.cgi' \
  -H 'Accept: application/json, text/javascript, */*; q=0.01' \
  -H 'Accept-Language: de-DE,de;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
  -H 'DNT: 1' \
  -H 'Origin: http://senec' \
  -H 'Referer: http://senec/' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.78' \
  -H 'X-Requested-With: XMLHttpRequest' \
  --data-raw '{"ENERGY":{"SAFE_CHARGE_FORCE":"","SAFE_CHARGE_PROHIBIT":"","SAFE_CHARGE_RUNNING":"","LI_STORAGE_MODE_START":"","LI_STORAGE_MODE_STOP":"","LI_STORAGE_MODE_RUNNING":""}}' \
  --compressed \
  --insecure

Hier sind die Werte, die man haben will, mit einem Leerstring anzugeben. Im Response sind sie dann gefüllt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment