[gelöst] Wallbox mit HTTPMOD auslesen

Begonnen von jnewton957, 02 Januar 2023, 14:34:48

Vorheriges Thema - Nächstes Thema

jnewton957

Hallo,
ich tue mich mit der Einbindung und somit Auslesen meiner cfos-emobility Wallbox extrem schwer.
Über Modbus TCP habe ich zwischenzeitlich per <IP>:4701 Slave ID 1 entsprechend Werte der modbus register auslesen können.
Aber die Modbus Register liefert insbesondere einen Wert nicht: Total_import


Also muss ich es anscheinend mit HTTP API probieren.
==> das habe ich noch nie gemacht und könnte bitte Hilfe gebrauchen.


Über http://192.168.2.131/cnf?cmd=get_dev_info habe ich jedoch die Wallbox Werte gefunden, die ich haben möchte.



{
"dev_type" : "meter_dts353",
"device_enabled" : 1,
"name" : "Wallbox Zähler",
"address" : "meter3",
"id" : 101,
"dev_id" : "M3",
"number" : 2,
"desc" : "cFos Power Brain, Modbus Zähler",
"com_err" : false,
"com_err_secs" : 95455,
"com_errors" : 0,
"status" : "",
"last_error" : "modbus crc error",
"is_evse" : false,
"used_phases" : 7,
"has_history" : true,
"hide_dev" : false,
"show_in_overview" : true,
"show_chart_in_dev_info" : true,
"show_chart_in_overview" : true,
"is_va" : true,
"invert" : false,
"import" : 141030,
"export" : 0,
"power" : 0,
"current_l1" : 0,
"current_l2" : 0,
"current_l3" : 0,
"voltage_l1" : 231,
"voltage_l2" : 235,
"voltage_l3" : 235,
"role" : 4,
"model" : "YTL/cFos,DTS353,1.0,1.2,0-5"
},

Wie bekomme ich die nun im fhem define eingelesen. Ich habe schon Stunden damit verbracht und x erfolglose Versuche gestartet.

Danke für die Hilfe zumindestens eines Besipieles, wie ich einen der Werte auslesen kann. Dann probiere ich weiter.

Grüße
Jörg

FHEM6.2 auf Pi5
V 1.66 nanoCUL 433 (IT)
V 1.66 nanoCUL868 (HM)
sqlite3 LogDb
ELRO AB440, DECT200,  TFA30.3125, esp8266, HM, TabletUI, IR-Schreiblesekopf (Udo),tibber Pulse, Kostal Pico, cfos Wallbox, Modbus TCP

betateilchen

Wieviele Threads eigentlich noch zu Deiner Wallbox?

https://forum.fhem.de/index.php/topic,131262.0.html

Warum mit HTTPMOD, wenn die Daten in JSON vorliegen?


define jmWallbox JsonMod http://192.168.2.131/cnf?cmd=get_dev_info
attr jmWallbox readingList complete()


sollte eigentlich alle readings liefern, die Du haben möchtest.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

Prof. Dr. Peter Henning

Es gibt eine neue Unterkategorie "Energiemanagement und Energieerzeugung" -> WallBoxen.

Und dort steht ein Beispiel zur Verfügung.

@Betateilchen: Warum? Kann ich Dir sagen. HTTPMOD bietet gegenüber JsonMod mehr Möglichkeiten und ist besser dokumentiert.

LG

pah

UdoR

Als Referenz hier die Modbus-Konfiguration, die ich für die CFOS Power Brain benutze (wichtig ist das "Q>" bei den 64-bit-Werten):

defmod WBL ModbusAttr 1 60 192.168.0.88:4701 TCP
attr WBL userattr obj-h08080-len obj-h08080-unpack
attr WBL dev-h-defLen 1
attr WBL dev-h-defPoll 1
attr WBL dev-h-defUnpack n
attr WBL event-on-change-reading .*
attr WBL icon wallbox
attr WBL obj-h08000-len 2
attr WBL obj-h08000-reading vendor_id
attr WBL obj-h08000-unpack N
attr WBL obj-h08002-reading product_id
attr WBL obj-h08003-reading device_id
attr WBL obj-h08004-reading product_version
attr WBL obj-h08005-reading product_build
attr WBL obj-h08006-reading mapping_version
attr WBL obj-h08007-reading padding_1
attr WBL obj-h08008-len 8
attr WBL obj-h08008-reading serial_no
attr WBL obj-h08008-unpack a8
attr WBL obj-h08016-len 16
attr WBL obj-h08016-reading name
attr WBL obj-h08016-unpack a16
attr WBL obj-h08040-reading slave_id
attr WBL obj-h08058-len 4
attr WBL obj-h08058-reading energy
attr WBL obj-h08058-unpack Q>
attr WBL obj-h08062-len 2
attr WBL obj-h08062-reading power
attr WBL obj-h08062-unpack N
attr WBL obj-h08080-expr $val / 10
attr WBL obj-h08080-format %.1f
attr WBL obj-h08080-reading def_fixed_current
attr WBL obj-h08081-expr $val / 10
attr WBL obj-h08081-format %.1f
attr WBL obj-h08081-reading def_charg_cur_limit
attr WBL obj-h08082-reading def_charging_enable
attr WBL obj-h08083-reading fail_safe_duration
attr WBL obj-h08085-expr $val / 10
attr WBL obj-h08085-format %.1f
attr WBL obj-h08085-reading fail_safe_current
attr WBL obj-h08086-reading disconnect_cp
attr WBL obj-h08090-expr $val / 10
attr WBL obj-h08090-format %.1f
attr WBL obj-h08090-reading cable_current
attr WBL obj-h08091-expr $val / 10
attr WBL obj-h08091-format %.1f
attr WBL obj-h08091-reading fixed_current
attr WBL obj-h08092-reading charge_pilot_state
attr WBL obj-h08093-expr $val /10
attr WBL obj-h08093-format %.1f
attr WBL obj-h08093-reading charging_cur_limit
attr WBL obj-h08093-set 1
attr WBL obj-h08093-setexpr $val *10
attr WBL obj-h08094-reading charging_enable
attr WBL obj-h08094-set 1
attr WBL obj-h08095-expr $val / 10
attr WBL obj-h08095-format %.1f
attr WBL obj-h08095-reading charging_current
attr WBL obj-h08120-len 2
attr WBL obj-h08120-reading count_restart
attr WBL obj-h08120-unpack N
attr WBL room Wallbox
attr WBL stateFormat (charge_pilot_state) charging_current A [charging_enable / charging_cur_limit A]