Hallo
Mit einiger Hilfe habe ich es geschafft das die Daten meiner Solaranlage in Fhem erfasst werden.
List vom Device:
Internals:
BUSY 0
CFGFN /var/fhem/FHEM/OG2_Dachboden.cfg
DEF http://192.168.6.101/home.cgi 900
Interval 900
LASTSEND 1541174326.37322
MainURL http://192.168.6.101/home.cgi
ModuleVersion 3.5.1 - 5.7.2018
NAME Solaranlage
NR 1067
STATE ???
TRIGGERTIME 0
TRIGGERTIME_FMT
TYPE HTTPMOD
addr http://192.168.6.101:80
auth 0
buf
code 200
compress 1
conn
data
displayurl http://192.168.6.101/home.cgi
header
host 192.168.6.101
httpbody 1
1
EAB961723105
QN6PAX3SS4VHW8AX
M11
17A31-727R+17829-719R
16:59 02/11/2018
0
1
BS15006011720112
0
1.81
OK
Error
httpheader HTTP/1.1 200 OK
Server: MXCHIP
Connection: close
Cache-Control: max-age=36000
Expires: Wed, 31 Dec 2070 23:00:00 GMT
Last-Modified: Fri, 17 Feb 2017 06:10:54 GMT
Content-Type: text/html
Content-Length: 115
httpversion 1.1
hu_blocking 0
hu_filecount 37
hu_port 80
hu_portSfx
ignoreredirects 0
loglevel 4
path /home.cgi
protocol http
redirects 0
timeout 2
url http://192.168.6.101/home.cgi
value 0
Helper:
DBLOG:
Gesamtertrag:
mylogdb:
TIME 1541174326.41443
VALUE 578.70743
SNR:
mylogdb:
TIME 1541174326.41443
VALUE BS15006011720112
Watt:
mylogdb:
TIME 1541174326.41443
VALUE 0
kwh:
mylogdb:
TIME 1541174326.41443
VALUE 1.81
kwh_Jahr:
mylogdb:
TIME 1541174326.41443
VALUE 1434.37
kwh_Monat:
mylogdb:
TIME 1541174326.41443
VALUE 3.84
kwh_gesamt:
mylogdb:
TIME 1541174326.41443
VALUE 2421.37
state:
mylogdb:
TIME 1541175095.77919
VALUE stop
QUEUE:
READINGS:
2018-11-02 16:58:46 Gesamtertrag 578.70743
2018-11-01 12:40:42 Preis_pro_kwh 0.239
2018-11-02 16:58:46 SNR BS15006011720112
2018-11-02 16:58:46 Watt 0
2018-11-02 16:58:46 kwh 1.81
2018-11-02 16:58:46 kwh_Jahr 1434.37
2018-11-02 16:58:46 kwh_Monat 3.84
2018-11-02 16:58:46 kwh_gesamt 2421.37
REQUEST:
data
header
ignoreredirects 0
retryCount 0
type update
url http://192.168.6.101/home.cgi
value 0
defptr:
readingBase:
SNR reading
Watt reading
kwh reading
readingNum:
SNR 01
Watt 02
kwh 03
readingOutdated:
requestReadings:
update:
SNR reading 01
Watt reading 02
kwh reading 03
sslargs:
Attributes:
enableControlSet 1
enableCookies 1
httpVersion 1.1
reading01Name SNR
reading01Regex (?:[^\r\n]*(?:\r|\rn|\n)){27}([^\r\n]*)(?:\r|\rn|\n).*
reading02Name Watt
reading02Regex (?:[^\r\n]*(?:\r|\rn|\n)){28}([^\r\n]*)(?:\r|\rn|\n).*
reading03Name kwh
reading03Regex (?:[^\r\n]*(?:\r|\rn|\n)){29}([^\r\n]*)(?:\r|\rn|\n).*
room OG2_Dachboden
showBody 1
timeout 2
userReadings kwh_Monat:kwh.* monotonic {ReadingsVal("Solaranlage","kwh",0)}, kwh_Jahr:kwh.* monotonic {ReadingsVal("Solaranlage","kwh",0)}, kwh_gesamt:kwh.* monotonic {ReadingsVal("Solaranlage","kwh",0)}, Gesamtertrag:kwh.* {ReadingsVal("Solaranlage","kwh_gesamt",0) * ReadingsVal("Solaranlage","Preis_pro_kwh",0)}
userattr reading01Name reading01Regex reading02Name reading02Regex reading03Name reading03Regex
Ein bisschen ärgerlich ist allerdings das die erfassten Daten fehlerhaft sind. :-(
Die Solaranlage liefert folgende Werte:
#Solaranlage:Watt:::
2018-11-02_07:58:46 0.0
2018-11-02_08:13:46 0.0
2018-11-02_08:28:46 0.1
2018-11-02_08:43:46 0.2
2018-11-02_08:58:46 0.4
2018-11-02_09:13:46 0.6
2018-11-02_09:28:46 0.8
2018-11-02_09:43:46 0.12
2018-11-02_09:58:46 0.16
2018-11-02_10:13:46 0.20
2018-11-02_10:28:46 0.24
2018-11-02_10:43:46 0.26
2018-11-02_10:58:46 0.30
2018-11-02_11:13:46 0.43
2018-11-02_11:28:46 0.54
2018-11-02_11:43:46 0.65
2018-11-02_11:58:46 0.71
2018-11-02_12:13:46 0.75
2018-11-02_12:28:46 0.80
2018-11-02_12:43:46 0.88
2018-11-02_12:58:46 1.0
2018-11-02_13:13:46 1.5
2018-11-02_13:28:46 1.9
2018-11-02_13:43:46 1.18
2018-11-02_13:58:46 1.31
2018-11-02_14:13:46 1.52
2018-11-02_14:28:46 1.62
2018-11-02_14:43:46 1.64
2018-11-02_14:58:46 1.67
2018-11-02_15:13:46 1.70
2018-11-02_15:28:46 1.72
2018-11-02_15:43:46 1.75
2018-11-02_15:58:46 1.77
2018-11-02_16:13:46 1.78
2018-11-02_16:28:46 1.80
2018-11-02_16:43:46 1.81
2018-11-02_16:58:46 1.81
Das Problem ist das die Werte zwischen 0,00 und 0,10 kwh bzw. 1,00 - 1,10 kwh usw. mit nur eine Nachkommastelle gemeldet werden und danach zweistellig. Siehe oben.
Das führt dazu das bei der Aufsummierung für Monat und Jahr pro 1 kwh bis zu 0,9 kwh zuviel erfasst werden.
Mir fehlt gerade eine Idee wie ich das korrigieren kann und bin für jede Hilfe Dankbar.
Gruß
Daniel
Ich glaube ich hab es. :-)
Ich habe das Reading03Name von kwh auf kwh_temp umbenannt.
Und folgende userReadings erstellt.
kwh:kwh_temp.* {sprintf("%.2f",(sprintf("%.2d",ReadingsVal("Solaranlage","kwh_temp",0) =~ /(\d+)/ )) + (sprintf("%.2d",ReadingsVal("Solaranlage","kwh_temp",0) =~ /\.(\d+)/ )/100))}, kwh_Monat:kwh_temp.* monotonic {ReadingsVal("Solaranlage","kwh",0)}, kwh_Jahr:kwh_temp.* monotonic {ReadingsVal("Solaranlage","kwh",0)}, kwh_gesamt:kwh_temp.* monotonic {ReadingsVal("Solaranlage","kwh",0)}, Gesamtertrag:kwh_temp.* {sprintf("%.2f",ReadingsVal("Solaranlage","kwh_gesamt",0) * ReadingsVal("Solaranlage","Preis_pro_kwh",0))}
Wenn kwh_temp bspw. 2.3 ist so ist kwh nun 2.03.
Wenn kwh_temp bspw. 2.11 ist so ist auch kwh 2.11
Bitte korrigiert mich wenn ich Blödsinn gemacht habe.
-
Daniel