Charge Tracker
The charge_tracker module records charging sessions. Charging sessions are stored in a compact binary format and can be retrieved in this format or processed as a PDF document.
charge_tracker/state
State of the charge tracker
{ "tracked_charges": 206, "first_charge_timestamp": 28090609 }
28090609 * 60 = 1685436540 = 2023-05-30T08:49:00+00:00
| Name | Description |
|---|---|
tracked_chargesint | Total number of recorded charging sessions. |
first_charge_timestampint (min) | A Unix timestamp in minutes indicating the start time of the first charging session. 0 if no time synchronization was available at start time. |
charge_tracker/last_charges
The last (up to) 30 recorded charging sessions
[
{
"timestamp_minutes": 28568514,
"charge_duration": 27479,
"user_id": 0,
"energy_charged": 39.83935547
},
{
"timestamp_minutes": 28572916,
"charge_duration": 37806,
"user_id": 0,
"energy_charged": 33.81298828
},
{
"timestamp_minutes": 28574252,
"charge_duration": 27915,
"user_id": 0,
"energy_charged": 34.23388672
}
]
| Index | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
[0..29]object | A tracked charging session
|
charge_tracker/current_charge
Information about the currently running charging session. If no charging session is running, user_id has the value -1
{
"user_id": 0,
"meter_start": 886.1900024,
"evse_uptime_start": 786598059,
"timestamp_minutes": 28577341,
"authorization_type": 0,
"authorization_info": null
}
| Name | Description |
|---|---|
user_idint | ID of the user who started the charging session. 0 if authorization was granted without user assignment. -1 if no charging session is currently running. |
meter_startfloat (kWh) | Meter reading at the start of the charging session. null if no meter was available at start time. |
evse_uptime_startint (s) | Uptime of the charge controller at the start of the charging session. To calculate how long the charging session has been running, the current uptime from |
timestamp_minutesint (min) | A Unix timestamp in minutes indicating the start time of the charging session. 0 if no time synchronization was available at start time. |
authorization_typeint | Indicates how the charging session was authorized.
|
authorization_infoNone | Additional information about user authorization. Format depends on authorization_type. |
charge_tracker/remove_all_charges
Deletes all recorded charging sessions and the username history. Cannot be undone! A restart is automatically performed afterwards.
# $HOST e.g. warp-AbCd
Write
curl http://$HOST/charge_tracker/remove_all_charges -d '{ "do_i_know_what_i_am_doing": false }'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp/AbCd
Write
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/remove_all_charges -m '{ "do_i_know_what_i_am_doing": false }'
| Name | Description |
|---|---|
do_i_know_what_i_am_doingbool | Indicates whether the deletion should be performed
|
charge_tracker/charge_log
Returns all recorded charging sessions in the following binary format. Entries each correspond to one charging session, are 16 bytes long and are output sequentially. The following indices are byte offsets relative to the start of a recorded charging session. All values are in little-endian format.
# $HOST e.g. warp-AbCd
curl http://$HOST/charge_tracker/charge_log
offset timestamp | kwh_start | id | duration | kwh_end
0x00000000: c2eb b301 | 3bf8 8c45 | 00 | 57 6b00 | f236 8e45
0x00000010: f4fc b301 | 2738 8e45 | 00 | ae 9300 | a846 8f45
0x00000020: 2c02 b401 | df46 8f45 | 00 | 0b 6d00 | be58 9045
Dieses Beispiel enthält die selben Ladevorgänge wie das charge_tracker/last_charges-Beispiel
Only supported by the HTTP API
| Index | Description |
|---|---|
[0..3]int (min) | A Unix timestamp in minutes indicating the start time of the charging session. 0 if no time synchronization was available at start time. |
[4..7]float (kWh) | Meter reading at the start of the charging session. NaN if no meter was available at start time. |
[8]int | ID of the user who started the charging session. 0 if authorization was granted without user assignment. |
[9..11]int (s) | Duration of the charging session. |
[12..15]float (kWh) | Meter reading at the end of the charging session. NaN if no meter was available at end time. |
charge_tracker/config
The charge tracker configuration.
# $HOST e.g. warp-AbCd
Read
curl http://$HOST/charge_tracker/config
{ "electricity_price": 3381 }
Write
curl http://$HOST/charge_tracker/config -d '{ "electricity_price": 3381 }'
or abbreviated:
curl http://$HOST/charge_tracker/config -d '3381'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/charge_tracker/config
{ "electricity_price": 3381 }
Write
With MQTT on $PREFIX/charge_tracker/config_update
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/config_update -m '{ "electricity_price": 3381 }'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/config_update -m '3381'
| Name | Description |
|---|---|
electricity_priceint (ct/kWh/100) | Electricity price used in the web interface and charge log to calculate charging costs |
charge_tracker/state
State of the charge tracker
{ "tracked_charges": 206, "first_charge_timestamp": 28090609 }
28090609 * 60 = 1685436540 = 2023-05-30T08:49:00+00:00
| Name | Description |
|---|---|
tracked_chargesint | Total number of recorded charging sessions. |
first_charge_timestampint (min) | A Unix timestamp in minutes indicating the start time of the first charging session. 0 if no time synchronization was available at start time. |
charge_tracker/last_charges
The last (up to) 30 recorded charging sessions
[
{
"timestamp_minutes": 28568514,
"charge_duration": 27479,
"user_id": 0,
"energy_charged": 39.83935547
},
{
"timestamp_minutes": 28572916,
"charge_duration": 37806,
"user_id": 0,
"energy_charged": 33.81298828
},
{
"timestamp_minutes": 28574252,
"charge_duration": 27915,
"user_id": 0,
"energy_charged": 34.23388672
}
]
| Index | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
[0..29]object | A tracked charging session
|
charge_tracker/current_charge
Information about the currently running charging session. If no charging session is running, user_id has the value -1
{
"user_id": 0,
"meter_start": 886.1900024,
"evse_uptime_start": 786598059,
"timestamp_minutes": 28577341,
"authorization_type": 0,
"authorization_info": null
}
| Name | Description |
|---|---|
user_idint | ID of the user who started the charging session. 0 if authorization was granted without user assignment. -1 if no charging session is currently running. |
meter_startfloat (kWh) | Meter reading at the start of the charging session. null if no meter was available at start time. |
evse_uptime_startint (s) | Uptime of the charge controller at the start of the charging session. To calculate how long the charging session has been running, the current uptime from |
timestamp_minutesint (min) | A Unix timestamp in minutes indicating the start time of the charging session. 0 if no time synchronization was available at start time. |
authorization_typeint | Indicates how the charging session was authorized.
|
authorization_infoNone | Additional information about user authorization. Format depends on authorization_type. |
charge_tracker/remove_all_charges
Deletes all recorded charging sessions and the username history. Cannot be undone! A restart is automatically performed afterwards.
# $HOST e.g. warp2-AbCd
Write
curl http://$HOST/charge_tracker/remove_all_charges -d '{ "do_i_know_what_i_am_doing": false }'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp2/AbCd
Write
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/remove_all_charges -m '{ "do_i_know_what_i_am_doing": false }'
| Name | Description |
|---|---|
do_i_know_what_i_am_doingbool | Indicates whether the deletion should be performed
|
charge_tracker/charge_log
Returns all recorded charging sessions in the following binary format. Entries each correspond to one charging session, are 16 bytes long and are output sequentially. The following indices are byte offsets relative to the start of a recorded charging session. All values are in little-endian format.
# $HOST e.g. warp2-AbCd
curl http://$HOST/charge_tracker/charge_log
offset timestamp | kwh_start | id | duration | kwh_end
0x00000000: c2eb b301 | 3bf8 8c45 | 00 | 57 6b00 | f236 8e45
0x00000010: f4fc b301 | 2738 8e45 | 00 | ae 9300 | a846 8f45
0x00000020: 2c02 b401 | df46 8f45 | 00 | 0b 6d00 | be58 9045
Dieses Beispiel enthält die selben Ladevorgänge wie das charge_tracker/last_charges-Beispiel
Only supported by the HTTP API
| Index | Description |
|---|---|
[0..3]int (min) | A Unix timestamp in minutes indicating the start time of the charging session. 0 if no time synchronization was available at start time. |
[4..7]float (kWh) | Meter reading at the start of the charging session. NaN if no meter was available at start time. |
[8]int | ID of the user who started the charging session. 0 if authorization was granted without user assignment. |
[9..11]int (s) | Duration of the charging session. |
[12..15]float (kWh) | Meter reading at the end of the charging session. NaN if no meter was available at end time. |
charge_tracker/config
The charge tracker configuration.
# $HOST e.g. warp2-AbCd
Read
curl http://$HOST/charge_tracker/config
{ "electricity_price": 3381 }
Write
curl http://$HOST/charge_tracker/config -d '{ "electricity_price": 3381 }'
or abbreviated:
curl http://$HOST/charge_tracker/config -d '3381'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp2/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/charge_tracker/config
{ "electricity_price": 3381 }
Write
With MQTT on $PREFIX/charge_tracker/config_update
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/config_update -m '{ "electricity_price": 3381 }'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/config_update -m '3381'
| Name | Description |
|---|---|
electricity_priceint (ct/kWh/100) | Electricity price used in the web interface and charge log to calculate charging costs |
charge_tracker/state
State of the charge tracker
{ "tracked_charges": 206, "first_charge_timestamp": 28090609 }
28090609 * 60 = 1685436540 = 2023-05-30T08:49:00+00:00
| Name | Description |
|---|---|
tracked_chargesint | Total number of recorded charging sessions. |
first_charge_timestampint (min) | A Unix timestamp in minutes indicating the start time of the first charging session. 0 if no time synchronization was available at start time. |
charge_tracker/last_charges
The last (up to) 30 recorded charging sessions
[
{
"timestamp_minutes": 28568514,
"charge_duration": 27479,
"user_id": 0,
"energy_charged": 39.83935547
},
{
"timestamp_minutes": 28572916,
"charge_duration": 37806,
"user_id": 0,
"energy_charged": 33.81298828
},
{
"timestamp_minutes": 28574252,
"charge_duration": 27915,
"user_id": 0,
"energy_charged": 34.23388672
}
]
| Index | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
[0..29]object | A tracked charging session
|
charge_tracker/current_charge
Information about the currently running charging session. If no charging session is running, user_id has the value -1
{
"user_id": 0,
"meter_start": 886.1900024,
"evse_uptime_start": 786598059,
"timestamp_minutes": 28577341,
"authorization_type": 0,
"authorization_info": null
}
| Name | Description |
|---|---|
user_idint | ID of the user who started the charging session. 0 if authorization was granted without user assignment. -1 if no charging session is currently running. |
meter_startfloat (kWh) | Meter reading at the start of the charging session. null if no meter was available at start time. |
evse_uptime_startint (s) | Uptime of the charge controller at the start of the charging session. To calculate how long the charging session has been running, the current uptime from |
timestamp_minutesint (min) | A Unix timestamp in minutes indicating the start time of the charging session. 0 if no time synchronization was available at start time. |
authorization_typeint | Indicates how the charging session was authorized.
|
authorization_infoNone | Additional information about user authorization. Format depends on authorization_type. |
charge_tracker/remove_all_charges
Deletes all recorded charging sessions and the username history. Cannot be undone! A restart is automatically performed afterwards.
# $HOST e.g. warp3-AbCd
Write
curl http://$HOST/charge_tracker/remove_all_charges -d '{ "do_i_know_what_i_am_doing": false }'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp3/AbCd
Write
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/remove_all_charges -m '{ "do_i_know_what_i_am_doing": false }'
| Name | Description |
|---|---|
do_i_know_what_i_am_doingbool | Indicates whether the deletion should be performed
|
charge_tracker/charge_log
Returns all recorded charging sessions in the following binary format. Entries each correspond to one charging session, are 16 bytes long and are output sequentially. The following indices are byte offsets relative to the start of a recorded charging session. All values are in little-endian format.
# $HOST e.g. warp3-AbCd
curl http://$HOST/charge_tracker/charge_log
offset timestamp | kwh_start | id | duration | kwh_end
0x00000000: c2eb b301 | 3bf8 8c45 | 00 | 57 6b00 | f236 8e45
0x00000010: f4fc b301 | 2738 8e45 | 00 | ae 9300 | a846 8f45
0x00000020: 2c02 b401 | df46 8f45 | 00 | 0b 6d00 | be58 9045
Dieses Beispiel enthält die selben Ladevorgänge wie das charge_tracker/last_charges-Beispiel
Only supported by the HTTP API
| Index | Description |
|---|---|
[0..3]int (min) | A Unix timestamp in minutes indicating the start time of the charging session. 0 if no time synchronization was available at start time. |
[4..7]float (kWh) | Meter reading at the start of the charging session. NaN if no meter was available at start time. |
[8]int | ID of the user who started the charging session. 0 if authorization was granted without user assignment. |
[9..11]int (s) | Duration of the charging session. |
[12..15]float (kWh) | Meter reading at the end of the charging session. NaN if no meter was available at end time. |
charge_tracker/config
The charge tracker configuration.
# $HOST e.g. warp3-AbCd
Read
curl http://$HOST/charge_tracker/config
{ "electricity_price": 3381 }
Write
curl http://$HOST/charge_tracker/config -d '{ "electricity_price": 3381 }'
or abbreviated:
curl http://$HOST/charge_tracker/config -d '3381'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp3/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/charge_tracker/config
{ "electricity_price": 3381 }
Write
With MQTT on $PREFIX/charge_tracker/config_update
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/config_update -m '{ "electricity_price": 3381 }'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/config_update -m '3381'
| Name | Description |
|---|---|
electricity_priceint (ct/kWh/100) | Electricity price used in the web interface and charge log to calculate charging costs |
Not supported on this hardware!
Not supported on this hardware!
charge_tracker/state
State of the charge tracker
{ "tracked_charges": 206, "first_charge_timestamp": 28090609 }
28090609 * 60 = 1685436540 = 2023-05-30T08:49:00+00:00
| Name | Description |
|---|---|
tracked_chargesint | Total number of recorded charging sessions. |
first_charge_timestampint (min) | A Unix timestamp in minutes indicating the start time of the first charging session. 0 if no time synchronization was available at start time. |
charge_tracker/last_charges
The last (up to) 30 recorded charging sessions
[
{
"timestamp_minutes": 28568514,
"charge_duration": 27479,
"user_id": 0,
"energy_charged": 39.83935547
},
{
"timestamp_minutes": 28572916,
"charge_duration": 37806,
"user_id": 0,
"energy_charged": 33.81298828
},
{
"timestamp_minutes": 28574252,
"charge_duration": 27915,
"user_id": 0,
"energy_charged": 34.23388672
}
]
| Index | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
[0..29]object | A tracked charging session
|
charge_tracker/current_charge
Information about the currently running charging session. If no charging session is running, user_id has the value -1
{
"user_id": 0,
"meter_start": 886.1900024,
"evse_uptime_start": 786598059,
"timestamp_minutes": 28577341,
"authorization_type": 0,
"authorization_info": null
}
| Name | Description |
|---|---|
user_idint | ID of the user who started the charging session. 0 if authorization was granted without user assignment. -1 if no charging session is currently running. |
meter_startfloat (kWh) | Meter reading at the start of the charging session. null if no meter was available at start time. |
evse_uptime_startint (s) | Uptime of the charge controller at the start of the charging session. To calculate how long the charging session has been running, the current uptime from |
timestamp_minutesint (min) | A Unix timestamp in minutes indicating the start time of the charging session. 0 if no time synchronization was available at start time. |
authorization_typeint | Indicates how the charging session was authorized.
|
authorization_infoNone | Additional information about user authorization. Format depends on authorization_type. |
charge_tracker/remove_all_charges
Deletes all recorded charging sessions and the username history. Cannot be undone! A restart is automatically performed afterwards.
# $HOST e.g. warp-AbCd
Write
curl http://$HOST/charge_tracker/remove_all_charges -d '{ "do_i_know_what_i_am_doing": false }'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp/AbCd
Write
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/remove_all_charges -m '{ "do_i_know_what_i_am_doing": false }'
| Name | Description |
|---|---|
do_i_know_what_i_am_doingbool | Indicates whether the deletion should be performed
|
charge_tracker/charge_log
Returns all recorded charging sessions in the following binary format. Entries each correspond to one charging session, are 16 bytes long and are output sequentially. The following indices are byte offsets relative to the start of a recorded charging session. All values are in little-endian format.
# $HOST e.g. warp-AbCd
curl http://$HOST/charge_tracker/charge_log
offset timestamp | kwh_start | id | duration | kwh_end
0x00000000: c2eb b301 | 3bf8 8c45 | 00 | 57 6b00 | f236 8e45
0x00000010: f4fc b301 | 2738 8e45 | 00 | ae 9300 | a846 8f45
0x00000020: 2c02 b401 | df46 8f45 | 00 | 0b 6d00 | be58 9045
Dieses Beispiel enthält die selben Ladevorgänge wie das charge_tracker/last_charges-Beispiel
Only supported by the HTTP API
| Index | Description |
|---|---|
[0..3]int (min) | A Unix timestamp in minutes indicating the start time of the charging session. 0 if no time synchronization was available at start time. |
[4..7]float (kWh) | Meter reading at the start of the charging session. NaN if no meter was available at start time. |
[8]int | ID of the user who started the charging session. 0 if authorization was granted without user assignment. |
[9..11]int (s) | Duration of the charging session. |
[12..15]float (kWh) | Meter reading at the end of the charging session. NaN if no meter was available at end time. |
charge_tracker/config
The charge tracker configuration.
# $HOST e.g. warp-AbCd
Read
curl http://$HOST/charge_tracker/config
{ "electricity_price": 3381 }
Write
curl http://$HOST/charge_tracker/config -d '{ "electricity_price": 3381 }'
or abbreviated:
curl http://$HOST/charge_tracker/config -d '3381'
# $BROKER e.g. my_mosquitto.localdomain
# $PREFIX e.g. warp/AbCd
Read
mosquitto_sub -v -C 1 -h $BROKER -t $PREFIX/charge_tracker/config
{ "electricity_price": 3381 }
Write
With MQTT on $PREFIX/charge_tracker/config_update
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/config_update -m '{ "electricity_price": 3381 }'
or abbreviated:
mosquitto_pub -h $BROKER -t $PREFIX/charge_tracker/config_update -m '3381'
| Name | Description |
|---|---|
electricity_priceint (ct/kWh/100) | Electricity price used in the web interface and charge log to calculate charging costs |