Seite 2 von 2

Re: Warp2 Wallbox mit HTTP Binding und jasonpath

Verfasst: 20. Dez 2021 16:06
von udo1toni
Und es ist wichtig, den korrekten JSONPATH anzugeben. Wenn JSONPATH nicht matcht, wird das gesamte Objekt zurückgegeben, das ist also bei falschem JSONPATH das korrekte Verhalten. So sollte es gehen:

Code: Alles auswählen

Thing http:url:warp2_status "Wallbox Status" [ baseURL="http://192.168.1.110/evse/state", commandMethod="GET" ] {
    Channels:
        Type number : iec61851_state "IEC Status" [ stateTransformation:"JSONPATH:$.iec61851_state" ]
        Type number : vehicle_state "Fahrzeug Status" [ stateTransformation:"JSONPATH:$.vehicle_state" ]
        Type number : contactor_state "Anschluss Status" [ stateTransformation:"JSONPATH:$.contactor_state" ]
        Type number : contactor_error "Anschluss Fehler" [ stateTransformation:"JSONPATH:$.contactor_error" ]
        Type number : charge_release "Lade Ende" [ stateTransformation:"JSONPATH:$.charge_release" ]
        Type number : allowed_charging_current "max. Ladestrom" [ stateTransformation:"JSONPATH:$.allowed_charging_current" ]
        Type number : error_state "Fehler Status" [ stateTransformation:"JSONPATH:$.error_state" ]
        Type number : lock_state "Verriegelung" [ stateTransformation:"JSONPATH:$.lock_state" ]
        Type number : time_since_state_change "Zeit seit Änderung" [ stateTransformation:"JSONPATH:$.time_since_state_change" ]
        Type number : uptime "Reboot seit" [ stateTransformation:"JSONPATH:$.uptime" ]
}
Da ich nicht in Besitz der Wall Box bin, sind die Bezeichnungen der Channel geraten :)
Es bietet sich an, alle Channel auf Mode="READONLY" zu setzen

Re: Warp2 Wallbox mit HTTP Binding und jasonpath

Verfasst: 20. Dez 2021 18:18
von rbeudel
Hallo,
@udo1toni und @int5749
habe Eure Ratschläge zusammengelegt und folgende things gebaut:

Code: Alles auswählen

Thing http:url:warp "Warp Status" [
	baseURL="http://192.168.1.110/evse/state",
	commandMethod="GET",
	refresh=15
	] {
		Channels:
		Type number : iec61851_state "IEC Status" [ stateTransformation="JSONPATH:$.iec61851_state" ]
        Type number : vehicle_state "Fahrzeug Status" [ stateTransformation="JSONPATH:$.vehicle_state" ]
        Type number : contactor_state "Anschluss Status" [ stateTransformation="JSONPATH:$.contactor_state" ]
        Type number : contactor_error "Anschluss Fehler" [ stateTransformation="JSONPATH:$.contactor_error" ]
        Type number : charge_release "Lade Ende" [ stateTransformation="JSONPATH:$.charge_release" ]
        Type number : allowed_charging_current "max. Ladestrom" [ stateTransformation="JSONPATH:$.allowed_charging_current" ]
        Type number : error_state "Fehler Status" [ stateTransformation="JSONPATH:$.error_state" ]
        Type number : lock_state "Verriegelung" [ stateTransformation="JSONPATH:$.lock_state" ]
        Type number : time_since_state_change "Zeit seit Änderung" [ stateTransformation="JSONPATH:$.time_since_state_change" ]
        Type number : uptime "Reboot seit" [ stateTransformation="JSONPATH:$.uptime" ]
    }

Thing http:url:warp1 "Warp Ladeströme" [
	baseURL="http://192.168.1.110/evse/max_charging_current",
	commandMethod="GET",
	refresh=15
	] {
		Channels:
		Type number : max_current_configured "Ladestrom eingestellt" [ stateTransformation="JSONPATH:$.max_current_configured" ]
        Type number : max_current_incoming_cable "Ladestrom höchstens Eingangseitig" [ stateTransformation="JSONPATH:$.max_current_incoming_cable" ]
        Type number : max_current_outgoing_cable "Ladestrom höchstens Ausgangsseitig" [ stateTransformation="JSONPATH:$.max_current_outgoing_cable" ]
        Type number : max_current_managed "Ladestrom zugeteilt" [ stateTransformation="JSONPATH:$.max_current_managed" ]
        
    }
und items:

Code: Alles auswählen

Number iec61851_state "IEC Status" {channel="http:url:warp:iec61851_state"}
Number vehicle_state "Fahrzeug Status" {channel="http:url:warp:ehicle_state"}
Number contactor_state "Anschluss Status"  {channel="http:url:warp:contactor_state"}
Number contactor_error "Anschluss Fehler" {channel="http:url:warp:contactor_error"}
Number charge_release "Lade Ende" {channel="http:url:warp:iec61851_state"}
Number allowed_charging_current "max. Ladestrom" {channel="http:url:warp:charge_release"}
Number error_state "Fehler Status" {channel="http:url:warp:error_state"}
Number lock_state "Verriegelung" {channel="http:url:warp:lock_state"}
Number time_since_state_change "Zeit seit Änderung" {channel="http:url:warp:time_since_state_change"}
Number max_current_configured "Ladestrom eingestellt" {channel="http:url:warp1:max_current_configured"}
Number max_current_incoming_cable "Ladestrom höchstens Eingangseitig" {channel="http:url:warp1:max_current_incoming_cable"}
Number max_current_outgoing_cable "Ladestrom höchstens Ausgangsseitig" {channel="http:url:warp1:max_current_outgoing_cable"}
Number max_current_managed "Ladestrom zugeteilt" {channel="http:url:warp1:max_current_managed"}
Jetzt habe ich die zu erwartenden Ergebnisse. Für die kryptischen Codes müssen noch map Transformationen eingebaut werden die den verständlichen Text anzeigen. Die Ladeströme werden natürlich richtig dargestellt. Feintuning ist auch noch nötig und es ist auch erst ein Teil der Befehle eingebaut.
Vielen Dank erst einmal, ich werde jetzt mich noch an den Rest machen.