You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,41 @@ export DEBUG_MODE=True
108
108
./wallbox_monitor.py
109
109
```
110
110
111
+
#### **External Logging Script Support**
112
+
113
+
You can configure an external script to be executed whenever the charging state changes. The script will receive a JSON payload containing session details.
114
+
115
+
1️⃣ Edit your 'wallbox_monitor.credo' file
116
+
117
+
Add the following line with the path to your external script:
118
+
```
119
+
EXTERNAL_LOG_SCRIPT = /path/to/your/log_script.sh
120
+
```
121
+
122
+
2️⃣ Ensure your script is executable
123
+
124
+
```bash
125
+
chmod +x /path/to/your/log_script.sh
126
+
```
127
+
128
+
3️⃣ JSON Data Format Passed to the Script:
129
+
130
+
```json
131
+
{
132
+
"state": "charging",
133
+
"start_time": "1739959209.48",
134
+
"stored_power": 1.26,
135
+
"total_energy_kWh": 20.0,
136
+
"notified": 1,
137
+
"repeat_check": 0
138
+
}
139
+
```
140
+
141
+
5️⃣ Run and Verify
142
+
143
+
Whenever the script detects a change in the charging state, it will execute log_script.sh, passing the charging data in JSON format.
0 commit comments