Hi everyone,
I’ve been lurking in the HA forums for a bit and have finally found something I can start giving back. I’ve got an EO charger and have spent the evening making an Android emulator talk to Charles proxy.
I’ve got 3 new API calls to add to @hoggy 's collection. They get the status, and enable and disable the charger (the pause / play button). I’ll try and work out how to make it permanently on later this week (i.e. disable schedule / solar charging so that the play button will instantly start charging).
I don’t have anywhere to host this, so I’m pasting the raw text to import into Postman below.
If it fails, I’ll post some more info in the next reply.
Murdoch
{
"info": {
"_postman_id": "79cc1537-011a-4412-a786-9d4a7bb83eb5",
"name": "EO Mini (Blank)",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Login To EO",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "grant_type=password&username={{emailId}}&password={{passwordId}}",
"options": {
"raw": {
"language": "text"
}
}
},
"url": {
"raw": "https://eoappi.eocharging.com//Token",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"Token"
]
}
},
"response": []
},
{
"name": "User",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "https://eoappi.eocharging.com//api/user/",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"user",
""
]
}
},
"response": []
},
{
"name": "List Mini",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "https://eoappi.eocharging.com//api/mini/list",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"mini",
"list"
]
}
},
"response": []
},
{
"name": "Get charger status",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "https://eoappi.eocharging.com/api/mini/status?address={{chargerID}}",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"mini",
"status"
],
"query": [
{
"key": "address",
"value": "{{chargerID}}"
}
]
}
},
"response": []
},
{
"name": "Country Codes",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "https://eoappi.eocharging.com//api/data/countrycodes",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"data",
"countrycodes"
]
}
},
"response": []
},
{
"name": "Vehicle",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "https://eoappi.eocharging.com//api/vehicle/",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"vehicle",
""
]
}
},
"response": []
},
{
"name": "Session",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"url": {
"raw": "https://eoappi.eocharging.com//api/session/",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"session",
""
]
}
},
"response": []
},
{
"name": "Session History",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
]
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "id",
"value": "0",
"type": "text"
},
{
"key": "startDate",
"value": "1614159816",
"description": "Enter Unix Epoch Timecodes!",
"type": "text"
},
{
"key": "endDate",
"value": "1614159876",
"description": "Enter Unix Epoch Timecodes!",
"type": "text"
}
]
},
"url": {
"raw": "https://eoappi.eocharging.com//api/session/detail",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"session",
"detail"
]
}
},
"response": []
},
{
"name": "Disable Charger",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.",
"key": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "default"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "id",
"value": "{{chargerID}}",
"type": "text"
}
]
},
"url": {
"raw": "https://eoappi.eocharging.com//api/mini/disable",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"mini",
"disable"
]
}
},
"response": []
},
{
"name": "Enable Charger",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
},
{
"warning": "This is a duplicate header and will be overridden by the Content-Type header generated by Postman.",
"key": "Content-Type",
"value": "application/x-www-form-urlencoded",
"type": "default"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "id",
"value": "{{chargerID}}",
"type": "text"
}
]
},
"url": {
"raw": "https://eoappi.eocharging.com//api/mini/enable",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"mini",
"enable"
]
}
},
"response": []
},
{
"name": "Update Charge Options (WARNING MAY WIPE CURRENT SETTINGS IF RUN)",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"const tokenUrl = `https://eoappi.eocharging.com//Token`;\r",
"\r",
"const getTokenRequest = {\r",
" method: 'POST',\r",
" url: tokenUrl,\r",
" body: {\r",
" mode: 'raw',\r",
" raw: (`grant_type=password&username=${pm.collectionVariables.get(\"emailId\")}&password=${pm.collectionVariables.get(\"passwordId\")}`)\r",
" }\r",
"};\r",
"\r",
"pm.sendRequest(getTokenRequest, (err, response) => {\r",
" const jsonResponse = response.json();\r",
" const newAccessToken = jsonResponse.access_token;\r",
"\r",
" pm.variables.set('access_token', newAccessToken);\r",
"});"
]
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{access_token}}"
}
],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "cpid",
"value": "0",
"type": "text"
},
{
"key": "scheduleWDay",
"value": "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT00",
"type": "text"
},
{
"key": "scheduleWEnd",
"value": "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT00",
"type": "text"
},
{
"key": "tariffWDay",
"value": "11111111111111111111111111111111111111111111111100",
"type": "text"
},
{
"key": "tariffWEnd",
"value": "11111111111111111111111111111111111111111111111100",
"type": "text"
},
{
"key": "appSchedWDay",
"value": "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD00",
"type": "text"
},
{
"key": "appSchedWEnd",
"value": "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD00",
"type": "text"
},
{
"key": "timeMode",
"value": "0",
"type": "text"
},
{
"key": "solarMode",
"value": "0",
"type": "text"
},
{
"key": "solarMin",
"value": "6",
"type": "text"
},
{
"key": "opMode",
"value": "0",
"type": "text"
},
{
"key": "pricePeak",
"value": "0",
"type": "text"
},
{
"key": "priceOffPeak",
"value": "0",
"type": "text"
},
{
"key": "tnid",
"value": "5",
"type": "text"
},
{
"key": "tariffZone",
"value": "N/A",
"type": "text"
}
]
},
"url": {
"raw": "https://eoappi.eocharging.com//api/user/updateChargeOpts",
"protocol": "https",
"host": [
"eoappi",
"eocharging",
"com"
],
"path": [
"",
"api",
"user",
"updateChargeOpts"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "emailId",
"value": "enter your email address here"
},
{
"key": "passwordId",
"value": "enter your password here"
},
{
"key": "chargerID",
"value": "charger address here - you can get this by using the List Mini call",
"type": "default"
}
]
}