Hilfe bei HTTPMOD abfrage :) komme nicht weiter

Begonnen von MichaelBHV, 11 September 2015, 19:37:59

Vorheriges Thema - Nächstes Thema

MichaelBHV

Moinsen,
Ich wollte per HTTPMOD mein smappee abfragen, wie muss ich die readings genau setzen ??
gebrauchen könnte ich die werte von activePower und tcurrent.

das war mein letzter versuch in der fhem.cfg um die werte abzufragen.... aber nix :(
define smap HTTPMOD http://192.168.178.142/gateway/apipublic/reportInstantaneousValues 10
attr smap userattr icon readingsName_activePower readingsName_tcurrent readingsRegex_activePower readingsRegex_tcurrent stateFormat timeout
attr smap group Energie
attr smap readingsName_activePower activePower=
attr smap readingsName_tcurrent tcurrent=
attr smap readingsRegex_activePower <span>activePower=</span>
attr smap readingsRegex_tcurrent <span>tcurrent=</span>
attr smap room Energie
attr smap stateFormat tcurrent: tcurrent
attr smap stateFormat activePower: activePower
attr smap timeout 5

anbei ein auszug was das HTTPMOD modul vom smappee bekommt.

mfg michael


HTTP/1.1 200 OK Content-Type: text/plain; charset=UTF-8 Cache-Control: no-cache Date: Fri, 11 Sep 2015 17:25:31 GMT Accept-Ranges: bytes Server: Restlet-Framework/2.0.14 Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept Access-Control-Allow-Origin: * Access-Control-Allow-Methods: * Access-Control-Allow-Headers: X-Requested-With, Content-Type Access-Control-Allow-Credentials: false Access-Control-Max-Age: 60 Content-Length: 1830 {"report":"Instantaneous values:<BR>voltage=230.0 Vrms<BR>FFTComponents:<BR>Phase 1:<BR>\tcurrent=1.495 A, activePower=319.294 W, reactivePower=128.533 var, apparentPower=344.194 VA, cosfi=92, quadrant=0, phaseshift=0.0, phaseDiff=0.0<BR>\tFFTComponents:<BR><BR>Load[363818] state[0] power: 0.0 on Fri Sep 11 15:25:55 GMT 2015<BR>Load[363231] state[0] power: 0.0 on Fri Sep 11 16:55:07 GMT 2015<BR>Load[363443] state[0] power: 0.0 on Fri Sep 11 08:34:29 GMT 2015<BR>Load[362593] state[0] power: 0.0 on Fri Sep 11 16:37:34 GMT 2015<BR>Load[363008] state[0] power: 0.0 on Fri Sep 11 05:45:55 GMT 2015<BR>Load[364231] state[1] power: 121.0 on Fri Sep 11 17:21:56 GMT 2015<BR>Load[363230] state[0] power: 0.0 on Fri Sep 11 03:35:39 GMT 2015<BR>Load[363688] state[0] power: 0.0 on Fri Sep 11 05:14:13 GMT 2015<BR>Load[363227] state[0] power: 0.0 on Fri Sep 11 03:43:08 GMT 2015<BR>Load[362992] state[0] power: 0.0 on Fri Sep 11 15:27:10 GMT 2015<BR>Load[362597] state[0] power: 0.0 on Fri Sep 11 13:02:28 GMT 2015<BR>Load[363821] state[0] power: 0.0 on Thu Sep 10 14:05:58 GMT 2015<BR>Load[363009] state[0] power: 0.0 on Fri Sep 11 15:01:01 GMT 2015<BR>Load[363226] state[0] power: 0.0 on Fri Sep 11 17:22:33 GMT 2015<BR>Load[364486] state[0] power: 0.0 on Fri Sep 11 12:54:27 GMT 2015<BR>Load[362994] state[0] power: 0.0 on Fri Sep 11 11:26:55 GMT 2015<BR>Load[363819] state[0] power: 0.0 on Fri Sep 11 15:36:28 GMT 2015<BR>Load[362993] state[0] power: 0.0 on Fri Sep 11 15:02:13 GMT 2015<BR>Load[363225] state[0] power: 0.0 on Fri Sep 11 02:58:41 GMT 2015<BR>Load[365093] state[0] power: 0.0 on Fri Sep 11 17:22:33 GMT 2015<BR>Load[362985] state[0] power: 0.0 on Thu Sep 10 12:41:33 GMT 2015<BR>Load[364230] state[0] power: 0.0 on Fri Sep 11 16:20:36 GMT 2015<BR><BR>Phase 1, peak active power 4900.624 W at 11/09/2015 07:05:20<BR>"}


frank

FHEM: 6.0(SVN) => Pi3(buster)
IO: CUL433|CUL868|HMLAN|HMUSB2|HMUART
CUL_HM: CC-TC|CC-VD|SEC-SD|SEC-SC|SEC-RHS|Sw1PBU-FM|Sw1-FM|Dim1TPBU-FM|Dim1T-FM|ES-PMSw1-Pl
IT: ITZ500|ITT1500|ITR1500|GRR3500
WebUI [HMdeviceTools.js (hm.js)]: https://forum.fhem.de/index.php/topic,106959.0.html

MichaelBHV

Zitat von: frank am 17 September 2015, 17:54:20
ich denke, es gibt ein smappee modul.
er
ja gibt es, funktioniert auch, nur so kann ich es lokal vom smappee gerät abfragen und nicht über den smappee server.

mfg
michael

ph1959de

Zitat von: MichaelBHV am 11 September 2015, 19:37:59
attr smap readingsName_activePower activePower=
attr smap readingsName_tcurrent tcurrent=
attr smap readingsRegex_activePower <span>activePower=</span>
attr smap readingsRegex_tcurrent <span>tcurrent=</span>

Falls das Problem noch offen ist: das sieht mir verdächtig nach "readingsRegex" noch nicht verstanden aus. Bitte noch mal genau nachlesen.

Peter
Aktives Mitglied des FHEM e.V. | Moderator im Forenbereich "Wiki"

pejonp

Zitat von: MichaelBHV am 11 September 2015, 19:37:59
...
gebrauchen könnte ich die werte von activePower und tcurrent.

das war mein letzter versuch in der fhem.cfg um die werte abzufragen.... aber nix :(
define smap HTTPMOD http://192.168.178.142/gateway/apipublic/reportInstantaneousValues 10
attr smap userattr icon readingsName_activePower readingsName_tcurrent readingsRegex_activePower readingsRegex_tcurrent stateFormat timeout
attr smap group Energie
attr smap readingsName_activePower activePower=
attr smap readingsName_tcurrent tcurrent=
attr smap readingsRegex_activePower <span>activePower=</span>
attr smap readingsRegex_tcurrent <span>tcurrent=</span>

Hallo Michael,

paß mal deine Einträge so an. Dann sollten auch Werte angezeigt werden. Perl und RegExp ist dein Freund.

attr DataLogger reading01Name activePower
attr DataLogger reading01Regex activePower\=+([\d.]+)
attr DataLogger reading02Name tcurrent
attr DataLogger reading02Regex tcurrent\=+([\d.]+)

Jörg
LaCrossGW 868MHz:WT470+TFA+TX37-IT+EMT7110+W136+WH25A HP1003+WH2621
SignalD(CC1101):Bresser+WS-0101(868MHz WH1080)+Velux KLF200+MAX!+HM-MOD-UART:Smoke HM-SEC-SD+VITOSOLIC 200 RESOL VBUS-LAN+SolarEdge SE5K(Modbus)+Sonnen!eco8(10kWh)+TD3511+DRT710M(Modbus)+ZigBee+Z-Wave+MQTT+vitoconnect