Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace old counter from OpenEVSE module with new EnergyMeter class on ESP #556

Merged
merged 5 commits into from
Mar 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ paths:
temp3: -2560
state: 254
elapsed: 3473
wattsec: 22493407
watthour: 51536
session_energy: 25034
total_energy: 998
total_day: 23
total_week: 68
total_month: 126
total_year: 998
gfcicount: 0
nogndcount: 0
stuckcount: 0
Expand Down Expand Up @@ -617,6 +621,46 @@ paths:
operationId: limit_clear
tags:
- Limit
/emeter:
delete:
summary: Reset Energy Meter
description: This will clear the Energy Meter
requestBody:
content:
application/json:
schema:
type: object
properties:
hard:
type: int
description: 0|1 Enable hard reset ( reset total_counter & total_switches)
import:
type: int
description: 0|1 Import OpenEvse module total kwh.
responses:
'200':
description: Reset counter ok
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: Reset done
'500':
description: Failed to reset counter
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: Reset failed
operationId: energymeter-reset
tags:
- Energy Meter

/tesla/vehicles:
get:
Expand Down
24 changes: 18 additions & 6 deletions models/Status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,24 @@ properties:
elapsed:
type: number
description: 'The duration of the current charge session, in seconds'
wattsec:
type: integer
description: 'The amount of energy transfered in this charge session, in W/sec'
watthour:
type: integer
description: 'The total amount of energy transfered, in W/hour'
session_energy:
type: number
description: 'The total amount of energy accumulated for current session (in wh)'
total_energy:
type: number
description: 'The total amount of energy accumulated (in kwh)'
total_day:
type: number
description: 'The total amount of energy accumulated today (in kwh)'
total_week:
type: number
description: 'The total amount of energy accumulated this week (in kwh)'
total_month:
type: number
description: 'The total amount of energy accumulated this month (in kwh)'
total_yaer:
type: number
description: 'The total amount of energy accumulated the year (in kwh)'
gfcicount:
type: integer
description: Number of GFCI errors
Expand Down
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ debug_flags =
#-D ENABLE_PROFILE
#-D ENABLE_NOISY_PROFILE
#-D ENABLE_DEBUG_MICROTASKS
#-D ENABLE_DEBUG_ENERGY_METER
src_build_flags =
# -D ARDUINOJSON_USE_LONG_LONG
# -D ENABLE_ASYNC_WIFI_SCAN
Expand Down
10 changes: 7 additions & 3 deletions src/emonesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
#endif

#ifndef TOTAL_ENERGY_SCALE_FACTOR
#define TOTAL_ENERGY_SCALE_FACTOR 1.0
#define TOTAL_ENERGY_SCALE_FACTOR 1.0
#endif

#ifndef SESSION_ENERGY_SCALE_FACTOR
Expand All @@ -134,17 +134,21 @@
#endif

#ifndef TEMP_SCALE_FACTOR
#define TEMP_SCALE_FACTOR 10.0
#define TEMP_SCALE_FACTOR 10.0
#endif

#ifndef TOTAL_ENERGY_SCALE_FACTOR
#define TOTAL_ENERGY_SCALE_FACTOR 1000.0
#define TOTAL_ENERGY_SCALE_FACTOR 1000.0
#endif

#ifndef SESSION_ENERGY_SCALE_FACTOR
#define SESSION_ENERGY_SCALE_FACTOR 3600.0
#endif

#ifndef POWER_SCALE_FACTOR
#define POWER_SCALE_FACTOR 1.0
#endif

#endif

#ifndef LED_DEFAULT_BRIGHTNESS
Expand Down
Loading