Thanks, I tried your curl as well as several variations.
Always either getting a 500 or 400 error.
400:
request (your sample):
curl -i -H 'Content-Type: application/json' -X POST -d '{\"prod_price_forecast\":[0.01, -0.04, -0.05, -0.05, -0.06, -0.1, -0.16, -0.16, -0.14, -0.08, -0.06, -0.05, -0.05, -0.01, 0.01, 0.03, 0.07, 0.17, 0.3, 0.3, 0.3, 0.3, 0.25, 0.28, 0.23, 0.22, 0.21, 0.22, 0.21, 0.22, 0.22, 0.22, 0.22, 0.23, 0.21, 0.18, 0.16, 0.16, 0.16],\"load_cost_forecast\":[0.09, 0.04, 0.03, 0.02, 0.01, -0.03, -0.09, -0.09, -0.07, -0.0, 0.02, 0.02, 0.02, 0.07, 0.09, 0.12, 0.16, 0.27, 0.41, 0.41, 0.41, 0.41, 0.36, 0.39, 0.34, 0.33, 0.31, 0.33, 0.32, 0.33, 0.32, 0.33, 0.32, 0.34, 0.32, 0.28, 0.26, 0.26, 0.26]}' http://192.168.0.102:5000/action/dayahead-optim
reply:
26 Sep 08:16:30 - [info] [debug:debug 2]
{
_msgid: 'b5234528097a1aa3',
topic: '',
payload: 'HTTP/1.1 400 BAD REQUEST\r\n' +
'Content-Length: 167\r\n' +
'Content-Type: text/html; charset=utf-8\r\n' +
'Date: Mon, 26 Sep 2022 06:16:30 GMT\r\n' +
'Server: waitress\r\n' +
'\r\n' +
'<!doctype html>\n' +
'<html lang=en>\n' +
'<title>400 Bad Request</title>\n' +
'<h1>Bad Request</h1>\n' +
'<p>The browser (or proxy) sent a request that this server could not understand.</p>\n',
rc: { code: 0 }
}
26 Sep 08:16:30 - [info] [debug:debug 2]
{
_msgid: 'b5234528097a1aa3',
topic: '',
payload: ' % Total % Received % Xferd Average Speed Time Time Time Current\n' +
' Dload Upload Total Spent Left Speed\n' +
'\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 697 100 167 100 530 25955 82374 --:--:-- --:--:-- --:--:-- 136k\n',
rc: { code: 0 }
}
26 Sep 08:16:30 - [info] [debug:debug 2]
{ _msgid: 'b5234528097a1aa3', topic: '', payload: { code: 0 } }
500:
request:
curl -i -H 'Content-Type: application/json' -X POST -d '{"prod_price_forecast":[0.01, -0.04, -0.05, -0.05, -0.06, -0.1, -0.16, -0.16, -0.14, -0.08, -0.06, -0.05, -0.05, -0.01, 0.01, 0.03, 0.07, 0.17, 0.3, 0.3, 0.3, 0.3, 0.25, 0.28, 0.23, 0.22, 0.21, 0.22, 0.21, 0.22, 0.22, 0.22, 0.22, 0.23, 0.21, 0.18, 0.16, 0.16, 0.16]}' http://localhost:5000/action/dayahead-optim
reply:
26 Sep 08:18:05 - [info] [debug:debug 2]
{
_msgid: '8c1603e0cdeb32c9',
topic: '',
payload: 'HTTP/1.1 500 INTERNAL SERVER ERROR\r\n' +
'Content-Length: 265\r\n' +
'Content-Type: text/html; charset=utf-8\r\n' +
'Date: Mon, 26 Sep 2022 06:18:03 GMT\r\n' +
'Server: waitress\r\n' +
'\r\n' +
'<!doctype html>\n' +
'<html lang=en>\n' +
'<title>500 Internal Server Error</title>\n' +
'<h1>Internal Server Error</h1>\n' +
'<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n',
rc: { code: 0 }
}
26 Sep 08:18:05 - [info] [debug:debug 2]
{
_msgid: '8c1603e0cdeb32c9',
topic: '',
payload: ' % Total % Received % Xferd Average Speed Time Time Time Current\n' +
' Dload Upload Total Spent Left Speed\n' +
'\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 266 0 0 100 266 0 221 0:00:01 0:00:01 --:--:-- 221\r100 266 0 0 100 266 0 120 0:00:02 0:00:02 --:--:-- 120\r 50 531 0 0 100 266 0 107 0:00:02 0:00:02 --:--:-- 107\r100 531 100 265 100 266 106 107 0:00:02 0:00:02 --:--:-- 213\n',
rc: { code: 0 }
}
26 Sep 08:18:05 - [info] [debug:debug 2]
{ _msgid: '8c1603e0cdeb32c9', topic: '', payload: { code: 0 } }
I trigger these via Node-Red and tried localhost as well as the local IP of the raspberry running Home Assistant (and EMHASS add-on).
Any idea @markpucell or @davidusb?
Thanks