SofarSolar Wechselrichter 1100TL-G3

Begonnen von boeho, 05 September 2022, 17:18:09

Vorheriges Thema - Nächstes Thema

boeho

Hallo, ich habe einen Wechselrichter SofarSolar Wechselrichter 1100TL-G3, den ich gerne in mein FHEM einbinden möchte.
Erist definiert:defmod PV_Anlage HTTPMOD https://user:pasw@home.solarmanpv.com/plant/infos/data 60
attr PV_Anlage enforceGoodReadingNames 1
attr PV_Anlage reading01Name Produktion
attr PV_Anlage reading01Regex var webdata_now_p = "(\d+)"
attr PV_Anlage stateFormat { sprintf("Aktuell: %.0f Watt", ReadingsVal($name,"Produktion",0))}
attr PV_Anlage room Fritz_Smart
attr PV_Anlage verbose 5


Wenn ich im Browser mir das Element für Produktion anzeigen lassebekomme ich
<span data-v-e257487e="" class="dpIB posR" style="left: 10px; top: 20px;"><div data-v-e257487e=""><span data-v-e257487e="">Produktion</span></div><span data-v-e257487e="" class="font-w fs16x">920.00W</span></span>
Dort finde ich auch die aktuelle Produktion mit 920.00W

Im Log steht bei jedem Verbindungsversuch:
2022.09.05 17:09:20 4: PV_Anlage: GetUpdate called (update)
2022.09.05 17:09:20 4: PV_Anlage: UpdateTimer called from GetUpdate with cmd next sets timer to call update function in 60.0 sec at 17:10:20.987, interval 60
2022.09.05 17:09:20 5: PV_Anlage: AddToQueue adds type update to URL https://user:pasw@home.solarmanpv.com/plant/infos/data, no data, no headers, retry 0, initial queue len: 0
2022.09.05 17:09:20 5: PV_Anlage: HandleSendQueue called from AddToSendQueue, qlen = 1
2022.09.05 17:09:20 4: PV_Anlage: HandleSendQueue sends update with timeout 2 to https://user:pasw@home.solarmanpv.com/plant/infos/data, No Data, No Header
2022.09.05 17:09:21 5: PV_Anlage: ReadCallback called from __ANON__
2022.09.05 17:09:21 4: PV_Anlage: Read callback: request type was update retry 0,
header: HTTP/1.1 200 OK
Server: Tengine
Content-Type: text/html; charset=utf-8
Connection: close
Vary: Accept-Encoding
Strict-Transport-Security: max-age=5184000
Date: Mon, 05 Sep 2022 15:09:21 GMT
Last-Modified: Thu, 04 Aug 2022 02:58:55 GMT
ETag: W/"62eb35ef-3ea"
Cache-Control: max-age=0
Via: cache24.l2et15-7[17,0], cache16.l2na63-1[167,0], cache9.de3[329,0]
Timing-Allow-Origin: *
EagleId: 4f85b19d16623905611443943e
Content-Encoding: gzip, body length 985
2022.09.05 17:09:21 5: PV_Anlage: Read callback: body
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title></title><link rel="shortcut icon" href=/favicon.ico><link href=/public/css/vendors~app.9c4885c9.css rel=stylesheet><link href=/public/css/app.d11b2823.css rel=stylesheet></head><body><link rel=stylesheet/less type=text/css href=/color.less><script>window.less ={async:false,env:"production",};</script><script src=/less.min.js></script><noscript><strong>We're sorry but solarman3rd-home doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/public/js/vendors~app~main.196a1f18.js></script><script src=/public/js/vendors~app.aceeea73.js></script><script src=/public/app.13755aa953355c2e85a3.js></script><script src=/public/js/vendors~main.ba3ae9aa.js></script><script src=/public/main.13755aa953355c2e85a3.js></script></body></html>
2022.09.05 17:09:21 4: PV_Anlage: BodyDecode is not decoding the response body (charset utf-8, bodyDecode defaults to none)
2022.09.05 17:09:21 5: PV_Anlage: GetCookies is looking for Cookies
2022.09.05 17:09:21 5: PV_Anlage: ExtractSid called, context reading, num unknown
2022.09.05 17:09:21 4: PV_Anlage: checking for redirects, code=200, ignore=0
2022.09.05 17:09:21 4: PV_Anlage: no redirects to handle
2022.09.05 17:09:21 5: PV_Anlage: Read callback sets LAST_REQUEST to update
2022.09.05 17:09:21 5: PV_Anlage: CheckAuth decided no authentication required
2022.09.05 17:09:21 5: PV_Anlage: Read starts parsing response to update with defined readings: 01
2022.09.05 17:09:21 5: PV_Anlage: ExtractReading Produktion with regex /(?^:var webdata_now_p = "(\d+)")/...
2022.09.05 17:09:21 5: PV_Anlage: ExtractReading Produktion did not match
2022.09.05 17:09:21 4: PV_Anlage: Read response to update didn't match any Reading
2022.09.05 17:09:21 5: PV_Anlage: HandleSendQueue called from ReadCallback, qlen = 0
2022.09.05 17:09:21 5: PV_Anlage: HandleSendQueue found no usable entry in queue


Ich finde nur: We're sorry but solarman3rd-home doesn't work properly without JavaScript enabled. Please enable it to continue.
Aber was ich ändern muss weiß ich nicht. Wie schaltet man JS an?
HILFE

cruser1800

Hallo,

stehe jetzt vor dem gleichen Problem. Hast du eine Lösung gefunden die Daten von Solarman auszulesen. Ich wäre sehr daran interessiert!

Danke Lutz

boeho

Hallo Lutz,
bei mir läuft nun schon ein paar Monate folgende Variante:
define SolarAnlage HTTPMOD http://user:pswd@192.168.178.207/status.html  60
attr SolarAnlage enforceGoodReadingNames 1
attr SolarAnlage group 1 Solar
attr SolarAnlage icon sani_solar
attr SolarAnlage reading01Name Power
attr SolarAnlage reading01Regex var webdata_now_p = "(\d+)"
attr SolarAnlage reading02Name Today
attr SolarAnlage reading02Regex var webdata_today_e = "(\d+[.]\d\d)"
attr SolarAnlage reading03Name Total
attr SolarAnlage reading03Regex var webdata_total_e = "(\d+[.]\d+)"
attr SolarAnlage room SolarAnlage
attr SolarAnlage stateFormat { sprintf("Aktuell: %.0f Watt - Heute: %.2f kWh - Total: %.2f kWh", ReadingsVal($name,"Power",0), ReadingsVal($name,"Today",0), ReadingsVal($name,"Total",0)}

Dabei werden aber die Werte von Today nicht angezeigt, wenn sie kleiner als 1.0 sind. Ist aber eigentlich kein Problem.
Wichtig der WLAN-Stick muss im lokalen Netz mit 2.4 GHz angemeldet sein, die SSID und das Passwort dürfen nur Buchstaben des engl. Alphabets oder auch Zahlen enthalten, auch keine Leerzeichen. Dann ging bei mir die Verbindung. Natürlich mit Deiner IP.
Andere Werte aus der Webseite habe ich nicht lesen können. Dazu http://user:pswd@192.168.178.207/status.html im Browser aufrufen und über 'Untersuchen' den HTML-Code ansehen.
Melde Dich, wenn Fragen auftreten und natürlich auch bei Verbesserungen
VG Horst


cruser1800

Hallo Horst,

wie hast du es für Statistik gelöst, weil der Wert Total jeden Tag auf 0,0 gesetzt wird?

Gruß Lutz

boeho

Hallo Lutz, da muss ein Fehler im regexp sein. Der Wert 'Total' wird immer und ewig  addiert und nicht gelöscht, wie etwa Today.
Hast Du Dich vielleicht verschrieben? Richtig wären  'attr SolarAnlage 'reading03Name' Total'  und  'webdata_total_e' und 'Total' in stateFormat.
Falls im Log nicht steht musst Du mal in die html Source schauen.

Für die Statistik sammle ich momentan einfach diese 3  Daten. Ich will mir aber demnächst ein Excel-File via FHEM erzeugen lassen.
Falls es interessant für Dich ist melde Dich mal.
Gruß horst

cruser1800

Hallo Horst,

verschrieben habe ich mich leider nicht. Der Wert Total wird jeden Abend auf 0.0 gesetzt, nach dem ausschalten und nach dem Einschalten wieder auf den aktuellen Wert. Da ich mit diesem Wert über das Statistikmodul mir die Werte berechne hat diese mir die Statistik immer verhauen. Habe mir jetzt ein zusätzliches Reading erstellt und fange das über eine "IF-KLausel" ab.

Danke Lutz