Hi everyone!
I’m probably in way over my head here…
I have set up a custom weatherstation on an ESP-07 running ESPHome, this is all integrated in HomeAssistant fine and dandy.
What I am working on next, is having the ability to view these readings on my website. So I have set up a MySQL database on the website and added a php page to upload these data. As per this guide: ESP32/ESP8266 Insert Data into MySQL Database | Random Nerd Tutorials
So, on to the question… Using http_request.post I’m getting this response in the logger from the esp device. Have I done something wrong? Any tips welcomed.
[16:37:33][W][http_request.arduino:065]: Using HTTP on Arduino version >= 3.1 is **very** slow. Consider setting framework version to 3.0.2 in your YAML, or use HTTPS
[16:37:34][D][http_request.arduino:124]: Content-Length: -1
[16:37:34][W][component:237]: Component interval took a long time for an operation (580 ms).
[16:37:34][W][component:238]: Components should block for at most 30 ms.
Code snippet on ESP device:
interval:
- interval: 10min
then:
- http_request.post:
url: *REDACTED*post-esp-data.php
body: !lambda |-
char buf1[16];
char buf2[16];
char buf3[16];
char buf4[16];
char buf5[16];
char buf6[16];
sprintf(buf1, "%0f", id(press).state);
sprintf(buf2, "%0f", id(i_lux).state);
sprintf(buf3, "%0.1f", id(hum).state);
sprintf(buf4, "%0.2f", id(temp).state);
sprintf(buf5, "%s", id(wdir).state.c_str());
sprintf(buf6, "%0.1f", id(my_wind).state);
return ((std::string) "api_key=*REDACTED*" + "&sensor=WeatherStation" + "&location=*REDACTED*"
+ "&value1=" + buf1 + "&value2=" + buf2 + "&value3=" + buf3
+ "&value4=" + buf4 + "&value5=" + buf5 + "&value6=" + buf6 + "").c_str();