Skip to content

Conversation

@kevinwieland
Copy link
Contributor

Chargepoint Topic Transformation - Before/After Comparison

Overview of Changes

The chargepoint topics have been simplified to provide only the most important information and create a clearer structure.

Configuration Topics (config)

Kept (unchanged)

Before After Description
openWB/simpleAPI/chargepoint/2/config/configuration/ip_address openWB/simpleAPI/chargepoint/2/config/configuration/ip_address IP address of chargepoint
openWB/simpleAPI/chargepoint/2/config/configuration/duo_num openWB/simpleAPI/chargepoint/2/config/configuration/duo_num Duo number
openWB/simpleAPI/chargepoint/2/config/ev openWB/simpleAPI/chargepoint/2/config/ev Vehicle ID
openWB/simpleAPI/chargepoint/2/config/name openWB/simpleAPI/chargepoint/2/config/name Chargepoint name
openWB/simpleAPI/chargepoint/2/config/type openWB/simpleAPI/chargepoint/2/config/type Chargepoint type
openWB/simpleAPI/chargepoint/2/config/template openWB/simpleAPI/chargepoint/2/config/template Template ID
openWB/simpleAPI/chargepoint/2/config/connected_phases openWB/simpleAPI/chargepoint/2/config/connected_phases Number of phases
openWB/simpleAPI/chargepoint/2/config/phase_1 openWB/simpleAPI/chargepoint/2/config/phase_1 Phase 1 assignment
openWB/simpleAPI/chargepoint/2/config/auto_phase_switch_hw openWB/simpleAPI/chargepoint/2/config/auto_phase_switch_hw Auto phase switching
openWB/simpleAPI/chargepoint/2/config/control_pilot_interruption_hw openWB/simpleAPI/chargepoint/2/config/control_pilot_interruption_hw Control pilot interruption
openWB/simpleAPI/chargepoint/2/config/id openWB/simpleAPI/chargepoint/2/config/id Chargepoint ID
openWB/simpleAPI/chargepoint/2/config/ocpp_chargebox_id openWB/simpleAPI/chargepoint/2/config/ocpp_chargebox_id OCPP chargebox ID

Set Topics (Control Commands)

Removed Topics

The following topics are no longer provided in the simpleAPI:

  • All charge_template subtopics (very complex, available via separate Set-API)
  • All log subtopics (logging information)
  • phases_to_use, rfid (available via Set-API)

Get Topics (Measurements and Status)

Special Renamings

Before After Description
openWB/simpleAPI/chargepoint/2/get/connected_vehicle/info/name openWB/simpleAPI/chargepoint/2/vehicle_name Vehicle name
openWB/simpleAPI/chargepoint/2/get/connected_vehicle/config/chargemode openWB/simpleAPI/chargepoint/2/chargemode Current charging mode

Simplified Topics (without /get/)

Before After Description
openWB/simpleAPI/chargepoint/2/get/charge_state openWB/simpleAPI/chargepoint/2/charge_state Charging state
openWB/simpleAPI/chargepoint/2/get/charging_current openWB/simpleAPI/chargepoint/2/charging_current Charging current
openWB/simpleAPI/chargepoint/2/get/charging_power openWB/simpleAPI/chargepoint/2/charging_power Charging power
openWB/simpleAPI/chargepoint/2/get/charging_voltage openWB/simpleAPI/chargepoint/2/charging_voltage Charging voltage
openWB/simpleAPI/chargepoint/2/get/currents/1 openWB/simpleAPI/chargepoint/2/currents/1 Current phase 1
openWB/simpleAPI/chargepoint/2/get/currents/2 openWB/simpleAPI/chargepoint/2/currents/2 Current phase 2
openWB/simpleAPI/chargepoint/2/get/currents/3 openWB/simpleAPI/chargepoint/2/currents/3 Current phase 3
openWB/simpleAPI/chargepoint/2/get/daily_imported openWB/simpleAPI/chargepoint/2/daily_imported Daily import
openWB/simpleAPI/chargepoint/2/get/daily_exported openWB/simpleAPI/chargepoint/2/daily_exported Daily export
openWB/simpleAPI/chargepoint/2/get/error_timestamp openWB/simpleAPI/chargepoint/2/error_timestamp Error timestamp
openWB/simpleAPI/chargepoint/2/get/evse_current openWB/simpleAPI/chargepoint/2/evse_current EVSE current
openWB/simpleAPI/chargepoint/2/get/exported openWB/simpleAPI/chargepoint/2/exported Exported energy
openWB/simpleAPI/chargepoint/2/get/fault_str openWB/simpleAPI/chargepoint/2/fault_str Fault message
openWB/simpleAPI/chargepoint/2/get/fault_state openWB/simpleAPI/chargepoint/2/fault_state Fault state
openWB/simpleAPI/chargepoint/2/get/imported openWB/simpleAPI/chargepoint/2/imported Imported energy
openWB/simpleAPI/chargepoint/2/get/phases_in_use openWB/simpleAPI/chargepoint/2/phases_in_use Phases in use
openWB/simpleAPI/chargepoint/2/get/plug_state openWB/simpleAPI/chargepoint/2/plug_state Plug state
openWB/simpleAPI/chargepoint/2/get/power openWB/simpleAPI/chargepoint/2/power Current power
openWB/simpleAPI/chargepoint/2/get/rfid_timestamp openWB/simpleAPI/chargepoint/2/rfid_timestamp RFID timestamp
openWB/simpleAPI/chargepoint/2/get/rfid openWB/simpleAPI/chargepoint/2/rfid RFID
openWB/simpleAPI/chargepoint/2/get/serial_number openWB/simpleAPI/chargepoint/2/serial_number Serial number
openWB/simpleAPI/chargepoint/2/get/soc openWB/simpleAPI/chargepoint/2/soc State of charge
openWB/simpleAPI/chargepoint/2/get/soc_timestamp openWB/simpleAPI/chargepoint/2/soc_timestamp SoC timestamp
openWB/simpleAPI/chargepoint/2/get/state_str openWB/simpleAPI/chargepoint/2/state_str Status message
openWB/simpleAPI/chargepoint/2/get/vehicle_id openWB/simpleAPI/chargepoint/2/vehicle_id Vehicle ID
openWB/simpleAPI/chargepoint/2/get/voltages/1 openWB/simpleAPI/chargepoint/2/voltages/1 Voltage phase 1
openWB/simpleAPI/chargepoint/2/get/voltages/2 openWB/simpleAPI/chargepoint/2/voltages/2 Voltage phase 2
openWB/simpleAPI/chargepoint/2/get/voltages/3 openWB/simpleAPI/chargepoint/2/voltages/3 Voltage phase 3
openWB/simpleAPI/chargepoint/2/get/power_factors/1 openWB/simpleAPI/chargepoint/2/power_factors/1 Power factor phase 1
openWB/simpleAPI/chargepoint/2/get/power_factors/2 openWB/simpleAPI/chargepoint/2/power_factors/2 Power factor phase 2
openWB/simpleAPI/chargepoint/2/get/power_factors/3 openWB/simpleAPI/chargepoint/2/power_factors/3 Power factor phase 3
openWB/simpleAPI/chargepoint/2/get/powers/1 openWB/simpleAPI/chargepoint/2/powers/1 Power phase 1
openWB/simpleAPI/chargepoint/2/get/powers/2 openWB/simpleAPI/chargepoint/2/powers/2 Power phase 2
openWB/simpleAPI/chargepoint/2/get/powers/3 openWB/simpleAPI/chargepoint/2/powers/3 Power phase 3
openWB/simpleAPI/chargepoint/2/get/frequency openWB/simpleAPI/chargepoint/2/frequency Grid frequency
openWB/simpleAPI/chargepoint/2/get/max_charge_power openWB/simpleAPI/chargepoint/2/max_charge_power Max charge power
openWB/simpleAPI/chargepoint/2/get/max_discharge_power openWB/simpleAPI/chargepoint/2/max_discharge_power Max discharge power
openWB/simpleAPI/chargepoint/2/get/version openWB/simpleAPI/chargepoint/2/version Version
openWB/simpleAPI/chargepoint/2/get/evse_signaling openWB/simpleAPI/chargepoint/2/evse_signaling EVSE signaling

Removed Topics

The following topics are no longer provided:

  • All connected_vehicle subtopics (except the renamed ones above)
  • max_evse_current (redundant to other current values)
  • current_branch, current_commit (version information)

Benefits of Simplification

  • Clearer structure: Less nesting by removing /get/ and /set/
  • Fewer topics: Reduction from ~120 to ~50 topics per chargepoint
  • Better overview: Important information is easier to find
  • Consistent naming: Uniform structure without confusing paths
  • Easier integration: API clients need to handle fewer complex paths

Example Output (After Changes)

openWB/simpleAPI/chargepoint/2/config/configuration/ip_address 192.168.57.97
openWB/simpleAPI/chargepoint/2/config/configuration/duo_num 0
openWB/simpleAPI/chargepoint/2/config/ev 0
openWB/simpleAPI/chargepoint/2/config/name openWB Pro
openWB/simpleAPI/chargepoint/2/config/type openwb_pro
openWB/simpleAPI/chargepoint/2/config/template 0
openWB/simpleAPI/chargepoint/2/config/connected_phases 3
openWB/simpleAPI/chargepoint/2/config/phase_1 1
openWB/simpleAPI/chargepoint/2/config/auto_phase_switch_hw False
openWB/simpleAPI/chargepoint/2/config/control_pilot_interruption_hw False
openWB/simpleAPI/chargepoint/2/config/id 2
openWB/simpleAPI/chargepoint/2/config/ocpp_chargebox_id null
openWB/simpleAPI/chargepoint/2/manual_lock False
openWB/simpleAPI/chargepoint/2/evse_current 0
openWB/simpleAPI/chargepoint/2/charge_state False
openWB/simpleAPI/chargepoint/2/charging_current 0
openWB/simpleAPI/chargepoint/2/charging_power 0
openWB/simpleAPI/chargepoint/2/charging_voltage 0
openWB/simpleAPI/chargepoint/2/vehicle_name Kia EV3
openWB/simpleAPI/chargepoint/2/chargemode instant_charging
openWB/simpleAPI/chargepoint/2/currents/1 0
openWB/simpleAPI/chargepoint/2/currents/2 0
openWB/simpleAPI/chargepoint/2/currents/3 0
openWB/simpleAPI/chargepoint/2/daily_imported 3784.0
openWB/simpleAPI/chargepoint/2/daily_exported 0.0
openWB/simpleAPI/chargepoint/2/error_timestamp null
openWB/simpleAPI/chargepoint/2/exported 0
openWB/simpleAPI/chargepoint/2/fault_str "Kein Fehler."
openWB/simpleAPI/chargepoint/2/fault_state 0
openWB/simpleAPI/chargepoint/2/imported 1239081
openWB/simpleAPI/chargepoint/2/phases_in_use 1
openWB/simpleAPI/chargepoint/2/plug_state True
openWB/simpleAPI/chargepoint/2/power 0
openWB/simpleAPI/chargepoint/2/rfid_timestamp null
openWB/simpleAPI/chargepoint/2/rfid null
openWB/simpleAPI/chargepoint/2/serial_number "387109"
openWB/simpleAPI/chargepoint/2/soc 72
openWB/simpleAPI/chargepoint/2/soc_timestamp 1762102473
openWB/simpleAPI/chargepoint/2/state_str "Keine Ladung, da das Ladeziel bereits erreicht wurde."
openWB/simpleAPI/chargepoint/2/vehicle_id "9C:36:F8:02:B1:78"
openWB/simpleAPI/chargepoint/2/voltages/1 235.95
openWB/simpleAPI/chargepoint/2/voltages/2 0
openWB/simpleAPI/chargepoint/2/voltages/3 0
openWB/simpleAPI/chargepoint/2/power_factors/1 0.0
openWB/simpleAPI/chargepoint/2/power_factors/2 0.0
openWB/simpleAPI/chargepoint/2/power_factors/3 0.0
openWB/simpleAPI/chargepoint/2/powers/1 0
openWB/simpleAPI/chargepoint/2/powers/2 0
openWB/simpleAPI/chargepoint/2/powers/3 0
openWB/simpleAPI/chargepoint/2/frequency 49.97
openWB/simpleAPI/chargepoint/2/max_charge_power null
openWB/simpleAPI/chargepoint/2/max_discharge_power null
openWB/simpleAPI/chargepoint/2/version null
openWB/simpleAPI/chargepoint/2/evse_signaling "unclear"

Implementation Details

The changes were implemented in the _transform_chargepoint_topic() function and include:

  • Filtering: Only allowed config topics are passed through
  • Special mappings: Certain topics are renamed
  • Path simplification: Removal of /get/ and /set/ prefixes
  • Topic filtering: Unwanted complex topics are excluded

Technical Notes

  • The transformation is applied at two levels: base topic transformation and post-JSON-expansion transformation
  • Empty set topics are ignored to prevent infinite loops
  • Debug logging is available for troubleshooting topic transformations
  • Both numbered chargepoints (/2/) and simplified chargepoints (/chargepoint/) are supported

📋 Overview

Added three new write operations to configure instant charging limits via simplified MQTT API topics.

✨ New Features

1. Instant Charging Limit Type

  • Topic: openWB/simpleAPI/set/instant_charging_limit
  • Values: none, soc, amount
  • Description: Sets the type of charging limit for instant charging mode
  • Example: mosquitto_pub -t "openWB/simpleAPI/set/instant_charging_limit" -m "soc"

2. Instant Charging SoC Limit

  • Topic: openWB/simpleAPI/set/instant_charging_limit_soc
  • Values: Integer 0-100 (percentage)
  • Description: Sets the SoC limit for instant charging (active when limit type is "soc")
  • Example: mosquitto_pub -t "openWB/simpleAPI/set/instant_charging_limit_soc" -m "80"

3. Instant Charging Energy Limit

  • Topic: openWB/simpleAPI/set/instant_charging_limit_amount
  • Values: Integer 1-50 (kWh)
  • Description: Sets the energy limit for instant charging (active when limit type is "amount")
  • Internal conversion: Input value × 1000 (kWh to Wh)
  • Example: mosquitto_pub -t "openWB/simpleAPI/set/instant_charging_limit_amount" -m "25"

🔧 Technical Implementation

Automatic Chargepoint Selection

  • Uses lowest available chargepoint ID when multiple chargepoints exist
  • Consistent with existing API behavior

✅ Validation & Error Handling

  • Limit type: Validates against allowed values (none, soc, amount)
  • SoC values: Range validation (0-100%)
  • Amount values: Range validation (1-50 kWh) with automatic conversion to Wh
  • Template availability: Checks for cached charge template before modification
  • Comprehensive logging: All operations and errors are logged

🧪 Testing Recommendations

# Test limit type configuration
mosquitto_pub -t "openWB/simpleAPI/set/instant_charging_limit" -m "soc"

# Test SoC limit (80%)
mosquitto_pub -t "openWB/simpleAPI/set/instant_charging_limit_soc" -m "80"

# Test energy limit (25 kWh)
mosquitto_pub -t "openWB/simpleAPI/set/instant_charging_limit_amount" -m "25"

@LKuemmel LKuemmel merged commit e585a52 into master Nov 5, 2025
1 check passed
@kevinwieland kevinwieland deleted the feature/proposal-simpleAPI-mqtt branch December 3, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants