Telegraf config to query a Tesla Wallbox Gen 3

Here is a sample configuration file to query a Tesla Wallbox Gen 3. It collect’s wifi, lifetime and vital stats. It’s designed around Europes three phase power grid. Just fill in your desired output block and you should be good to go. Pass in the IP address of your wallbox as environment variable.

[agent]
    # Don't stress the little CPU too much by streching requests
    collection_jitter = "3s"

[[inputs.http]]
    # Collect wifi stats
    urls = ["http://${WALLBOX_HOST}/api/1/wifi_status"]
    name_override = "wifi"
    tagexclude = ["url", "host"]
    data_format = "json_v2"

    [[inputs.http.json_v2]]
        [[inputs.http.json_v2.field]]
        path = "wifi_signal_strength"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "wifi_rssi"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "wifi_snr"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "internet"
        type = "bool"


[[inputs.http]]
# Collect lifetime stats
urls = ["http://${WALLBOX_HOST}/api/1/lifetime"]
name_override = "lifetime"
tagexclude = ["url", "host"]
data_format = "json_v2"

    [[inputs.http.json_v2]]
        [[inputs.http.json_v2.field]]
        path = "contactor_cycles"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "contactor_cycles_loaded"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "alert_count"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "thermal_foldbacks"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "avg_startup_temp"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "charge_starts"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "energy_wh"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "connector_cycles"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "uptime_s"
        rename = "uptime_seconds"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "charging_time_s"
        rename = "charging_time_seconds"
        type = "int"


[[inputs.http]]
# Collect vital stats
urls = ["http://${WALLBOX_HOST}/api/1/vitals"]
name_override = "vitals"
tagexclude = ["url", "host"]
data_format = "json_v2"

    [[inputs.http.json_v2]]
        [[inputs.http.json_v2.field]]
        path = "grid_v"
        rename = "grid_voltage"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "grid_hz"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "contactor_closed"
        type = "bool"

        [[inputs.http.json_v2.field]]
        path = "vehicle_connected"
        type = "bool"

        [[inputs.http.json_v2.field]]
        path = "currentA_a"
        rename = "phase_1_current"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "currentB_a"
        rename = "phase_2_current"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "currentC_a"
        rename = "phase_3_current"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "currentN_a"
        rename = "neutral_current"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "voltageA_v"
        rename = "phase_1_voltage"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "voltageB_v"
        rename = "phase_2_voltage"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "voltageC_v"
        rename = "phase_3_voltage"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "relay_coil_v"
        rename = "relay_coil_voltage"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "pcba_temp_c"
        rename = "pcb_temperature"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "handle_temp_c"
        rename = "handle_temperature"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "mcu_temp_c"
        rename = "mcu_temperature"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "session_s"
        rename = "current_session_seconds"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "uptime_s"
        rename = "uptime_seconds"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "prox_v"
        rename = "proximity_voltage"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "pilot_high_v"
        rename = "pilot_high_voltage"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "pilot_low_v"
        rename = "pilot_low_voltage"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "session_energy_wh"
        rename = "session_energy"
        type = "float"

        [[inputs.http.json_v2.field]]
        path = "config_status"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "evse_state"
        type = "int"

        [[inputs.http.json_v2.field]]
        path = "vehicle_current_a"
        rename = "vehicle_current"
        type = "float"

Du hast einen Kommentar, einen Wunsch oder eine Verbesserung? Schreib mir doch eine E-Mail! Die Infos dazu stehen hier.

🖇️ = Link zu anderer Webseite
🔐 = Webseite nutzt HTTPS (verschlüsselter Transportweg)
Zurück