diff --git a/.env b/.env index 76edaa15..844fc379 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -TAG=0.0.16 +TAG=0.0.17-localbuild EVEREST_MANAGER_CPUS='1.0' EVEREST_MANAGER_MEMORY='1024mb' diff --git a/.github/workflows/build_and_push_csms.yml b/.github/workflows/build_and_push_csms.yml index eb86e32d..6811a421 100644 --- a/.github/workflows/build_and_push_csms.yml +++ b/.github/workflows/build_and_push_csms.yml @@ -129,7 +129,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ matrix.host_namespace }}/${{ matrix.image_name }} + images: ${{ matrix.host_namespace }}/${{ matrix.csms }}-${{ matrix.image_name }} tags: | type=semver,pattern={{version}},value=v${{ steps.docker-image-version-check.outputs.TAG }} diff --git a/citrineos/build-and-run.sh b/citrineos/build-and-run.sh index 0bce42b8..465c28c1 100644 --- a/citrineos/build-and-run.sh +++ b/citrineos/build-and-run.sh @@ -7,7 +7,6 @@ exit 1 pushd Server || exit 1 -docker compose build if ! docker compose --project-name "${DEMO_CSMS}"-csms up -d --wait; then echo "Failed to start ${DEMO_CSMS}" exit 1 diff --git a/demo-iso15118-2-ocpp-201.sh b/demo-iso15118-2-ocpp-201.sh index ede39f73..f0762203 100755 --- a/demo-iso15118-2-ocpp-201.sh +++ b/demo-iso15118-2-ocpp-201.sh @@ -4,13 +4,6 @@ DEMO_REPO="https://github.com/everest/everest-demo.git" DEMO_BRANCH="main" -MAEVE_REPO="https://github.com/louisg1337/maeve-csms.git" -# MAEVE_BRANCH="b990d0eddf2bf80be8d9524a7b08029fbb305c7d" # patch files are based on this commit -MAEVE_BRANCH="set_charging_profile" - -CITRINEOS_REPO="https://github.com/citrineos/citrineos-core.git" -CITRINEOS_BRANCH="feature/everest-demo" - START_OPTION="auto" usage="usage: $(basename "$0") [-r ] [-b ] [-c ] [1|2|3] [-h] @@ -87,8 +80,6 @@ echo "DEMO VERSION: $DEMO_VERSION" echo "DEMO CONFIG: $DEMO_COMPOSE_FILE_NAME" echo "DEMO DIR: $DEMO_DIR" echo "DEMO CSMS: $DEMO_CSMS" -echo "DEMO CSMS REPO: $DEMO_CSMS_REPO" -echo "DEMO CSMS BRANCH: $DEMO_CSMS_BRANCH" cd "${DEMO_DIR}" || exit 1 @@ -102,20 +93,23 @@ else fi # BEGIN: Setting up the CSMS - echo "Cloning ${DEMO_CSMS} CSMS from ${DEMO_CSMS_REPO} into ${DEMO_DIR}/${DEMO_CSMS}-csms and starting it" - git clone --branch "${DEMO_CSMS_BRANCH}" "${DEMO_CSMS_REPO}" ${DEMO_CSMS}-csms + pushd everest-demo/${DEMO_CSMS} || exit 1 - pushd ${DEMO_CSMS}-csms || exit 1 + # Copy over the environment variable so we can get the tag + cp ../.env . - cp ../everest-demo/manager/cached_certs_correct_name_emaid.tar.gz . + cp ../manager/cached_certs_correct_name_emaid.tar.gz . if [[ "$DEMO_VERSION" =~ sp2 || "$DEMO_VERSION" =~ sp3 ]]; then - source ../everest-demo/${DEMO_CSMS}/copy-certs.sh + source ../${DEMO_CSMS}/copy-certs.sh fi - source ../everest-demo/${DEMO_CSMS}/apply-patches.sh + source ../${DEMO_CSMS}/apply-runtime-patches.sh - source ../everest-demo/${DEMO_CSMS}/build-and-run.sh + if ! docker compose --project-name "${DEMO_CSMS}"-csms up -d --wait; then + echo "Failed to start ${DEMO_CSMS}" + exit 1 + fi # note that docker compose --wait only waits for the # containers to be up, not necessarily the services in those @@ -124,7 +118,7 @@ fi sleep 5 echo "Adding a charger and RFID card to ${DEMO_CSMS}" - source ../everest-demo/${DEMO_CSMS}/add-charger-and-rfid-card.sh + source ../${DEMO_CSMS}/add-charger-and-rfid-card.sh popd || exit 1 # END: Setting up the CSMS @@ -133,18 +127,29 @@ pushd everest-demo || exit 1 echo "API calls to CSMS finished, Starting everest" docker compose --project-name everest-ac-demo --file "${DEMO_COMPOSE_FILE_NAME}" up -d --wait docker cp manager/config-sil-ocpp201-pnc.yaml everest-ac-demo-manager-1:/ext/source/config/config-sil-ocpp201-pnc.yaml +docker exec everest-ac-demo-manager-1 rm /ext/dist/share/everest/modules/OCPP201/component_config/custom/EVSE_2.json +docker exec everest-ac-demo-manager-1 rm /ext/dist/share/everest/modules/OCPP201/component_config/custom/Connector_2_1.json echo "Configuring and restarting nodered" docker cp nodered/config/config-sil-iso15118-ac-flow.json everest-ac-demo-nodered-1:/config/config-sil-two-evse-flow.json docker restart everest-ac-demo-nodered-1 +echo "Installing patch and vim and cleaning up the cache" +docker exec everest-ac-demo-manager-1 /bin/bash -c "apt-get -qq -o=Dpkg::Use-Pty=0 update \ + && apt-get install -y -qq -o=Dpkg::Use-Pty=0 patch \ + && apt-get install -y -qq -o=Dpkg::Use-Pty=0 vim \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*" + echo "Copying over EVerest patches" docker cp manager/enable_payment_method_in_python.patch everest-ac-demo-manager-1:/tmp/ +docker cp manager/support_payment_in_jsevmanager.patch everest-ac-demo-manager-1:/tmp/ echo "Now applying the patches" -docker cp manager/enable_evcc_logging.cfg everest-ac-demo-manager-1:/ext/source/build/dist/etc/everest/default_logging.cfg -docker exec everest-ac-demo-manager-1 /bin/bash -c "apk add patch" +docker cp manager/enable_evcc_logging.cfg everest-ac-demo-manager-1:/ext/dist/etc/everest/default_logging.cfg docker exec everest-ac-demo-manager-1 /bin/bash -c "cd /ext && patch -p0 -i /tmp/enable_payment_method_in_python.patch" +docker exec everest-ac-demo-manager-1 /bin/bash -c "cd /ext/dist/libexec/everest && patch -p1 -i /tmp/support_payment_in_jsevmanager.patch" +docker exec everest-ac-demo-manager-1 /bin/bash -c "sed -i 's#ws://localhost:9000#ws://host.docker.internal/ws/cp001#' /ext/dist/share/everest/modules/OCPP201/component_config/standardized/InternalCtrlr.json" if [[ "$DEMO_VERSION" =~ sp2 || "$DEMO_VERSION" =~ sp3 ]]; then docker cp manager/cached_certs_correct_name_emaid.tar.gz everest-ac-demo-manager-1:/ext/source/build @@ -174,10 +179,10 @@ fi if [[ "$START_OPTION" == "auto" ]]; then echo "Starting software in the loop simulation automatically" - docker exec everest-ac-demo-manager-1 sh /ext/source/build/run-scripts/run-sil-ocpp201-pnc.sh + docker exec everest-ac-demo-manager-1 sh /ext/build/run-scripts/run-sil-ocpp201-pnc.sh else echo "Please start the software in the loop simulation manually by running" echo "on your laptop: docker exec -it everest-ac-demo-manager-1 /bin/bash" - echo "in the container: sh /ext/source/build/run-scripts/run-sil-ocpp201-pnc.sh" + echo "in the container: sh /ext/build/run-scripts/run-sil-ocpp201-pnc.sh" echo "You can now stop and restart the manager without re-creating the container" fi diff --git a/maeve/apply-runtime-patches.sh b/maeve/apply-runtime-patches.sh index f7e40e00..17740219 100644 --- a/maeve/apply-runtime-patches.sh +++ b/maeve/apply-runtime-patches.sh @@ -2,13 +2,13 @@ if [[ "$DEMO_VERSION" =~ sp2 || "$DEMO_VERSION" =~ sp3 ]]; then echo "Patching the CSMS to enable EVerest organization" - patch -p1 -i ../everest-demo/maeve/maeve-csms-everest-org.patch + patch -p1 -i maeve-csms-everest-org.patch echo "Patching the CSMS to enable local mo root" - patch -p1 -i ../everest-demo/maeve/maeve-csms-local-mo-root.patch + patch -p1 -i maeve-csms-local-mo-root.patch else echo "Patching the CSMS to disable WSS" - patch -p1 -i ../everest-demo/maeve/maeve-csms-no-wss.patch + patch -p1 -i maeve-csms-no-wss.patch fi diff --git a/maeve/build-and-run.sh b/maeve/build-and-run.sh deleted file mode 100644 index ea5a88b3..00000000 --- a/maeve/build-and-run.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -echo "Build and run" -docker compose build -if ! docker compose --project-name "${DEMO_CSMS}"-csms up -d --wait; then - echo "Failed to start ${DEMO_CSMS}" - exit 1 -fi diff --git a/maeve/config/certificates/.gitkeep b/maeve/config/certificates/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/maeve/config/certificates/Makefile b/maeve/config/certificates/Makefile new file mode 100644 index 00000000..9005cd9c --- /dev/null +++ b/maeve/config/certificates/Makefile @@ -0,0 +1,31 @@ +# Temporary file for process substitution +temp_file := /tmp/temp.ext + +all: csms.pem cpo_sub_ca1.pem cpo_sub_ca2.pem root-V2G-cert.pem trust.pem + +csms.key: + openssl ecparam -name prime256v1 -genkey -noout -out csms.key + +csms.csr: csms.key + openssl req -new -nodes -key csms.key \ + -subj "/CN=CSMS/O=Thoughtworks" \ + -addext "subjectAltName = DNS:localhost, DNS:gateway, DNS:lb" \ + -out csms.csr + +csms.pem: csms.csr + echo "basicConstraints = critical, CA:false" > $(temp_file) + echo "keyUsage = critical, digitalSignature, keyEncipherment" >> $(temp_file) + echo "subjectAltName = DNS:localhost, DNS:gateway, DNS:lb" >> $(temp_file) + openssl x509 -req -in csms.csr \ + -out csms.pem \ + -signkey csms.key \ + -days 365 \ + -extfile $(temp_file) + rm -f $(temp_file) + +cpo_sub_ca1.pem cpo_sub_ca2.pem root-V2G-cert.pem trust.pem: + ../../scripts/get-ca-cert.sh + +.PHONY: clean +clean: + rm -f *.pem csms.key csms.csr diff --git a/maeve/config/certificates/cpo_sub_ca1.key b/maeve/config/certificates/cpo_sub_ca1.key new file mode 100644 index 00000000..3a5c2ca2 --- /dev/null +++ b/maeve/config/certificates/cpo_sub_ca1.key @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIN14U+Uag5mVXNx2V625fH5I1F8xRFM8jocunYGEmxp7oAoGCCqGSM49 +AwEHoUQDQgAE1UykoMyJkCppRZKnKE+3jtWVK3HVaLHjyheLPJz64dAUeFb0dPnZ +sxqA7ipr6oZStzbQXcieXi+GdMSd/G4+8g== +-----END EC PRIVATE KEY----- diff --git a/maeve/config/certificates/cpo_sub_ca1.pem b/maeve/config/certificates/cpo_sub_ca1.pem new file mode 100644 index 00000000..38aadbfd --- /dev/null +++ b/maeve/config/certificates/cpo_sub_ca1.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICVzCCAf2gAwIBAgICMDowCgYIKoZIzj0EAwIwSDESMBAGA1UEAwwJVjJHUm9v +dENBMRAwDgYDVQQKDAdFVmVyZXN0MQswCQYDVQQGEwJERTETMBEGCgmSJomT8ixk +ARkWA1YyRzAeFw0yNDAzMTIwMTQzMDlaFw0zNDAzMTAwMTQzMDlaMEgxEjAQBgNV +BAMMCUNQT1N1YkNBMTEQMA4GA1UECgwHRVZlcmVzdDELMAkGA1UEBhMCREUxEzAR +BgoJkiaJk/IsZAEZFgNWMkcwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAS6im4H +nE9OlHDLNNUZl3NJZE4ald0+VfNiCySQWdCP/Fwl1zWSZKMidAml0BL0/lihyYO+ +cvAEM1NIYrxjQzW3o4HWMIHTMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/ +BAQDAgEGMB0GA1UdDgQWBBRvu7duCmt/mCRfjjMrxNC3MxpQvTBtBggrBgEFBQcB +AQRhMF8wJAYIKwYBBQUHMAGGGGh0dHBzOi8vd3d3LmV4YW1wbGUuY29tLzA3Bggr +BgEFBQcwAoYraHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vSW50ZXJtZWRpYXRlLUNB +LmNlcjAfBgNVHSMEGDAWgBSmkv3Hh77+YEsp57+VsBjmwzITVjAKBggqhkjOPQQD +AgNIADBFAiEA/nLc3K3Fsn4bK+9OFoTfkYJoVEl4NsyTVq4Ga71Dms4CIDyk2XU9 +/I7/KL6+oveVLYlvuOfBi489Rr4alOBR+L3L +-----END CERTIFICATE----- diff --git a/maeve/config/certificates/csms_leaf.pem b/maeve/config/certificates/csms_leaf.pem new file mode 100644 index 00000000..6b6e8cb5 --- /dev/null +++ b/maeve/config/certificates/csms_leaf.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIB6zCCAZGgAwIBAgICMDwwCgYIKoZIzj0EAwIwSDESMBAGA1UEAwwJQ1BPU3Vi +Q0EyMRAwDgYDVQQKDAdFVmVyZXN0MQswCQYDVQQGEwJERTETMBEGCgmSJomT8ixk +ARkWA1YyRzAeFw0yNDAzMTIwMTQzMDlaFw0zNDAzMTAwMTQzMDlaMFMxHTAbBgNV +BAMMFGhvc3QuZG9ja2VyLmludGVybmFsMRAwDgYDVQQKDAdFVmVyZXN0MQswCQYD +VQQGEwJERTETMBEGCgmSJomT8ixkARkWA0NQTzBZMBMGByqGSM49AgEGCCqGSM49 +AwEHA0IABH4hdFZ4+OPvMSLfwcLxvGRflEk7I5zUfQhs9J55DXBo+iv74EtJI/Qg +kf1Cl2S1BK5lGb2o2XekeIYIHOyFIxOjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0P +AQH/BAQDAgOIMB0GA1UdDgQWBBSRJ5Mlf4CqG2mbvHj3PE++7WnnpjAfBgNVHSME +GDAWgBSdZoihKocUHKu7g0HVL7/kHarXuzAKBggqhkjOPQQDAgNIADBFAiEAqxo/ +vWSzHj/415lXYoD1lrh2HgaTS8BxOR5hY44g9KcCIDFHQ2v39OV6fSETzF5VFU2/ +MblV+2toVvnyuDX5rM8v +-----END CERTIFICATE----- diff --git a/maeve/config/manager/config.toml b/maeve/config/manager/config.toml new file mode 100644 index 00000000..6925bf4d --- /dev/null +++ b/maeve/config/manager/config.toml @@ -0,0 +1,47 @@ +[api] +addr = ":9410" + +[transport] +type = "mqtt" +mqtt.urls = ["mqtt://mqtt:1883"] + +[ocpi] +addr = ":9411" +external_url = "http://manager:9411" +country_code = "GB" +party_id = "TWK" + +[storage] +type = "firestore" +firestore.project_id = "*detect-project-id*" + +[contract_cert_validator] +type = "ocsp" + +[contract_cert_validator.ocsp.root_certs] +type = "opcp" +opcp.url = "https://open.plugncharge-test.hubject.com" +opcp.ttl = "24h" +opcp.auth.type = "hubject_test_token" +opcp.auth.hubject_test_token.url = "https://hubject.stoplight.io/api/v1/projects/cHJqOjk0NTg5/nodes/6bb8b3bc79c2e-authorization-token" +opcp.auth.hubject_test_token.ttl = "6h" + +[contract_cert_provider] +type = "opcp" +opcp.url = "https://open.plugncharge-test.hubject.com" +opcp.auth.type = "hubject_test_token" +opcp.auth.hubject_test_token.url = "https://hubject.stoplight.io/api/v1/projects/cHJqOjk0NTg5/nodes/6bb8b3bc79c2e-authorization-token" +opcp.auth.hubject_test_token.ttl = "6h" + +[charge_station_cert_provider] +type = "delegating" +delegating.v2g.type = "opcp" +delegating.v2g.opcp.url = "https://open.plugncharge-test.hubject.com" +delegating.v2g.opcp.auth.type = "hubject_test_token" +delegating.v2g.opcp.auth.hubject_test_token.url = "https://hubject.stoplight.io/api/v1/projects/cHJqOjk0NTg5/nodes/6bb8b3bc79c2e-authorization-token" +delegating.v2g.opcp.auth.hubject_test_token.ttl = "6h" +delegating.cso.type = "local" +delegating.cso.local.cert.type = "file" +delegating.cso.local.cert.file = "/certificates/csms.pem" +delegating.cso.local.key.type = "file" +delegating.cso.local.key.file = "/certificates/csms.key" diff --git a/maeve/config/mosquitto/mosquitto.conf b/maeve/config/mosquitto/mosquitto.conf new file mode 100644 index 00000000..ff774840 --- /dev/null +++ b/maeve/config/mosquitto/mosquitto.conf @@ -0,0 +1,19 @@ +# Listeners +listener 1883 +protocol mqtt + +listener 9000 +protocol websockets + +# Logging +log_dest stdout +log_type error +log_type warning +log_type notice +log_type information +log_timestamp true +log_timestamp_format %Y/%m/%d %H:%M:%S +connection_messages false + +# Security +allow_anonymous true diff --git a/maeve/docker-compose.yml b/maeve/docker-compose.yml new file mode 100644 index 00000000..d9bafda4 --- /dev/null +++ b/maeve/docker-compose.yml @@ -0,0 +1,111 @@ +networks: + default: + name: maeve-csms + enable_ipv6: true + ipam: + config: + - subnet: 2001:db8:a::/64 + gateway: 2001:db8:a::1 + +services: + mqtt: + image: eclipse-mosquitto:2 + volumes: + - type: bind + source: ./config/mosquitto + target: /mosquitto/config + read_only: true + ports: + - "1883:1883" + - "9000:9000" + user: "10000:10000" + healthcheck: + test: ["CMD-SHELL", "timeout 5 mosquitto_sub -t '$$SYS/#' -C 1 | grep -v Error || exit 1"] + interval: 10s + timeout: 10s + retries: 3 + + gateway: + image: ghcr.io/us-joet/everest-demo/gateway:${TAG} + depends_on: + mqtt: + condition: service_healthy + manager: + condition: service_healthy + command: + - "serve" + - "--ws-addr" + - ":9310" + - "--wss-addr" + - ":9311" + - "--status-addr" + - ":9312" + - "--tls-server-cert" + - "/certificates/csms.pem" + - "--tls-server-key" + - "/certificates/csms.key" + - "--tls-trust-cert" + - "/certificates/trust.pem" + - "--mqtt-addr" + - "mqtt://mqtt:1883" + - "--manager-api-addr" + - "http://manager:9410" + ports: + - "80:9310" # charge station ws + - "443:9311" # charge station wss + - "9312:9312" # status + volumes: + - type: bind + source: ./config/certificates + target: /certificates + read_only: true + healthcheck: + test: ["CMD", "/usr/bin/curl", "-s", "--fail", "http://localhost:9312/health"] + interval: 10s + timeout: 10s + retries: 3 + user: "${UID}:${GID}" + + manager: + image: ghcr.io/us-joet/everest-demo/manager:${TAG} + build: + context: manager + depends_on: + mqtt: + condition: service_healthy + environment: + ENVIRONMENT: dev + FIRESTORE_EMULATOR_HOST: firestore:8080 + command: + - "serve" + - "-c" + - "/config/config.toml" + volumes: + - type: bind + source: ./config/certificates + target: /certificates + read_only: true + - type: bind + source: ./config/manager + target: /config + read_only: true + ports: + - "9410:9410" # manager api + - "9411:9411" # status + healthcheck: + test: ["CMD", "/usr/bin/curl", "-s", "--fail", "http://localhost:9410/health"] + interval: 10s + timeout: 10s + retries: 3 + user: "${UID}:${GID}" + + firestore: + image: google/cloud-sdk + command: + - gcloud + - emulators + - firestore + - start + - --host-port=0.0.0.0:8080 + ports: + - "8080:8080" diff --git a/manager/config-sil-ocpp201-pnc.yaml b/manager/config-sil-ocpp201-pnc.yaml index 2102daa9..1a37a5e5 100644 --- a/manager/config-sil-ocpp201-pnc.yaml +++ b/manager/config-sil-ocpp201-pnc.yaml @@ -20,9 +20,6 @@ active_modules: module: EvseManager config_module: connector_id: 1 - three_phases: true - has_ventilation: true - country_code: DE evse_id: "DE*PNX*00001" session_logging: true session_logging_xml: false @@ -48,18 +45,18 @@ active_modules: config_module: connector_id: 1 slac: - module: JsSlacSimulator + module: SlacSimulator car_simulator_1: - module: JsCarSimulator + module: JsEvManager config_module: connector_id: 1 auto_enable: true auto_exec: false auto_exec_commands: sleep 1;iec_wait_pwr_ready;sleep 1;draw_power_regulated 16,3;sleep 30;unplug connections: - simulation_control: + ev_board_support: - module_id: yeti_driver_1 - implementation_id: yeti_simulation_control + implementation_id: ev_board_support ev: - module_id: iso15118_car implementation_id: ev diff --git a/manager/enable_payment_method_in_python.patch b/manager/enable_payment_method_in_python.patch index d214972a..5a1ae12b 100644 --- a/manager/enable_payment_method_in_python.patch +++ b/manager/enable_payment_method_in_python.patch @@ -1,5 +1,5 @@ --- ext-switchev-iso15118/iso15118/evcc/controller/interface.py -+++ source/build/dist/libexec/everest/3rd_party/josev/iso15118/evcc/controller/interface.py ++++ dist/libexec/everest/3rd_party/josev/iso15118/evcc/controller/interface.py @@ -109,6 +109,15 @@ raise NotImplementedError @@ -17,7 +17,7 @@ self, protocol: Protocol ) -> EnergyTransferModeEnum: --- ext-switchev-iso15118/iso15118/evcc/controller/simulator.py -+++ source/build/dist/libexec/everest/3rd_party/josev/iso15118/evcc/controller/simulator.py ++++ dist/libexec/everest/3rd_party/josev/iso15118/evcc/controller/simulator.py @@ -53,6 +53,7 @@ SAScheduleTupleEntry as SAScheduleTupleEntryDINSPEC, ) @@ -46,7 +46,7 @@ async def get_supported_energy_services(self) -> List[ServiceV20]: """Overrides EVControllerInterface.get_energy_transfer_service().""" --- ext-switchev-iso15118/iso15118/evcc/states/iso15118_2_states.py -+++ source/build/dist/libexec/everest/3rd_party/josev/iso15118/evcc/states/iso15118_2_states.py ++++ dist/libexec/everest/3rd_party/josev/iso15118/evcc/states/iso15118_2_states.py @@ -193,8 +193,9 @@ self.stop_state_machine("ChargeService not offered") return diff --git a/manager/support_payment_in_jsevmanager.patch b/manager/support_payment_in_jsevmanager.patch new file mode 100644 index 00000000..ec78c903 --- /dev/null +++ b/manager/support_payment_in_jsevmanager.patch @@ -0,0 +1,48 @@ +diff --git a/modules/PyEvJosev/module.py b/modules/PyEvJosev/module.py +index fabc388..c8961fc 100644 +--- a/modules/PyEvJosev/module.py ++++ b/modules/PyEvJosev/module.py +@@ -95,6 +95,7 @@ class PyEVJosevModule(): + + def _handler_start_charging(self, args) -> bool: + ++ self._es.PaymentOption =args['PaymentOption'] + self._es.EnergyTransferMode = args['EnergyTransferMode'] + + self._ready_event.set() +diff --git a/modules/simulation/JsEvManager/index.js b/modules/simulation/JsEvManager/index.js +index e5b4e9c..4bce5f5 100644 +--- a/modules/JsEvManager/index.js ++++ b/modules/JsEvManager/index.js +@@ -362,17 +362,27 @@ function registerAllCmds(mod) { + }); + + if (mod.uses_list.ev.length > 0) { +- registerCmd(mod, 'iso_start_v2g_session', 1, (mod, c) => { +- switch (c.args[0]) { ++ registerCmd(mod, 'iso_start_v2g_session', 2, (mod, c) => { ++ if (c.args[0] === 'externalpayment') mod.payment = 'ExternalPayment'; ++ else if (c.args[0] === 'contract') mod.payment = 'Contract'; ++ else { ++ evlog.debug('Found invalid payment method' + c.args[0]); ++ return false; ++ } ++ ++ switch (c.args[1]) { + case 'ac': + if (mod.config.module.three_phases !== true) mod.energymode = 'AC_single_phase_core'; + else mod.energymode = 'AC_three_phase_core'; + break; + case 'dc': mod.energymode = 'DC_extended'; break; +- default: return false; ++ default: ++ evlog.debug('Found invalid payment method' + c.args[1]); ++ return false; + } + +- mod.uses_list.ev[0].call.start_charging({ EnergyTransferMode: mod.energymode }); ++ args = { PaymentOption: mod.payment, EnergyTransferMode: mod.energymode }; ++ mod.uses_list.ev[0].call.start_charging(args); + + return true; + }); diff --git a/nodered/config/config-sil-dc-flow.json b/nodered/config/config-sil-dc-flow.json index bea9ef8a..570bb8d0 100644 --- a/nodered/config/config-sil-dc-flow.json +++ b/nodered/config/config-sil-dc-flow.json @@ -1714,7 +1714,7 @@ "options": [ { "label": "DC ISO15118-2", - "value": "sleep 1;iso_wait_slac_matched;iso_start_v2g_session ExternalPayment,DC_extended;iso_wait_pwr_ready;sleep 36000#iso_stop_charging;iso_wait_v2g_session_stopped;unplug#iso_pause_charging;iso_wait_for_resume#iso_start_bcb_toogle 3;iso_wait_pwm_is_running;iso_start_v2g_session ExternalPayment,DC_extended;iso_wait_pwr_ready;sleep 36000;", + "value": "sleep 1;iso_wait_slac_matched;iso_start_v2g_session DC;iso_wait_pwr_ready;sleep 36000#iso_stop_charging;iso_wait_v2g_session_stopped;unplug#iso_pause_charging;iso_wait_for_resume#iso_start_bcb_toogle 3;iso_wait_pwm_is_running;iso_start_v2g_session DC;iso_wait_pwr_ready;sleep 36000;", "type": "str" } ], @@ -1768,7 +1768,7 @@ "once": true, "onceDelay": "1", "topic": "sim_commands", - "payload": "sleep 1;iso_wait_slac_matched;iso_start_v2g_session ExternalPayment,DC_extended;iso_wait_pwr_ready;sleep 36000#iso_stop_charging;iso_wait_v2g_session_stopped;unplug#iso_pause_charging;iso_wait_for_resume#iso_start_bcb_toogle 3;iso_wait_pwm_is_running;iso_start_v2g_session ExternalPayment,DC_extended;iso_wait_pwr_ready;sleep 36000;", + "payload": "sleep 1;iso_wait_slac_matched;iso_start_v2g_session DC;iso_wait_pwr_ready;sleep 36000#iso_stop_charging;iso_wait_v2g_session_stopped;unplug#iso_pause_charging;iso_wait_for_resume#iso_start_bcb_toogle 3;iso_wait_pwm_is_running;iso_start_v2g_session DC;iso_wait_pwr_ready;sleep 36000;", "payloadType": "str", "x": 90, "y": 1180, @@ -2003,4 +2003,4 @@ "y": 500, "wires": [] } -] \ No newline at end of file +] diff --git a/nodered/config/config-sil-iso15118-ac-flow.json b/nodered/config/config-sil-iso15118-ac-flow.json index b8f0f716..1ff837f9 100644 --- a/nodered/config/config-sil-iso15118-ac-flow.json +++ b/nodered/config/config-sil-iso15118-ac-flow.json @@ -2093,12 +2093,12 @@ "options": [ { "label": "AC ISO15118-2", - "value": "sleep 1;iso_wait_slac_matched;iso_start_v2g_session externalPayment,AC_three_phase_core;iso_wait_pwr_ready;iso_draw_power_regulated 16,3;sleep 36000#iso_stop_charging;iso_wait_v2g_session_stopped;unplug#iso_pause_charging;iso_wait_for_resume#iso_start_bcb_toogle 3;iso_wait_pwm_is_running;iso_start_v2g_session externalPayment,AC_three_phase_core;iso_wait_pwr_ready;iso_draw_power_regulated 16,3;sleep 36000", + "value": "sleep 1;iso_wait_slac_matched;iso_start_v2g_session externalPayment,ac;iso_wait_pwr_ready;iso_draw_power_regulated 16,3;sleep 36000#iso_stop_charging;iso_wait_v2g_session_stopped;unplug#iso_pause_charging;iso_wait_for_resume#iso_start_bcb_toogle 3;iso_wait_pwm_is_running;iso_start_v2g_session externalPayment,ac;iso_wait_pwr_ready;iso_draw_power_regulated 16,3;sleep 36000", "type": "str" }, { "label": "AC ISO15118-2 Plug&Charge", - "value": "sleep 1;iso_wait_slac_matched;iso_start_v2g_session contract,AC_three_phase_core;iso_wait_pwr_ready;iso_draw_power_regulated 16,3;sleep 36000#;iso_stop_charging;iso_wait_v2g_session_stopped;unplug#iso_pause_charging;iso_wait_for_resume#iso_start_bcb_toogle 3;iso_wait_pwm_is_running;iso_start_v2g_session contract,AC_three_phase_core;iso_wait_pwr_ready;iso_draw_power_regulated 16,3;sleep 36000", + "value": "sleep 1;iso_wait_slac_matched;iso_start_v2g_session contract,ac;iso_wait_pwr_ready;iso_draw_power_regulated 16,3;sleep 36000#;iso_stop_charging;iso_wait_v2g_session_stopped;unplug#iso_pause_charging;iso_wait_for_resume#iso_start_bcb_toogle 3;iso_wait_pwm_is_running;iso_start_v2g_session contract,ac;iso_wait_pwr_ready;iso_draw_power_regulated 16,3;sleep 36000", "type": "str" } ],