-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[sendtohttp] Add Open-Meteo events + JSON event #5207
base: mega
Are you sure you want to change the base?
Conversation
Command: Response:
|
Wrap the (long) url, that contains several commas, in quotes, and this issue should be resolved 😉 |
I tried that and it didn't work...but now i think i know what happend. I have this auto correction plugin in my browser. Disabling it helped :) |
- added FEATURE_OPENMETEO_EVENT to Custom-sample.h - disabled FEATURE_THINGSPEAK_EVENT and FEATURE_OPENMETEO_EVENT on default - both got the same structure in define_plugin_sets.h
Thanks for helping me... |
I combined the two functions because there is actually no need for that |
I don't understand why the action runs are failing. For me these builds are working just fine fine... |
OK, hopefully this time the action run finishes without errors. example content:
For the URL: There needs to be &json added to the end of it to tell the parser that there is a JSON-response. Actually i would like to see this as an plugin, where you enter your URL and store your keys in the same manner. But that not only mean to create a new plugin but also to deduplicate code because of P037. |
Usually adding a parameter that is not existent on the server side causes no issues. |
- add array output to the json parser - add grouping of keys for individual requests
-changed variable name for the decimals to decimalsJP
Is that the web-based log (Tools/Log), or via the serial console? |
Both are truncated to some fixed max. size (though not the same max.) |
unsing double for double now
Should I add a whole new page for documentation of the these parser? |
- There is no difference between is<float>() and is<double>() as a value check. Keeping <float> -#define ARDUINOJSON_USE_DOUBLE 1 does not seem to be needed (only for serializeJson)
I am inclined to use this for convenience. On a scale of 1-10, how bad is this idea? # if ESP8266
root = new (std::nothrow) DynamicJsonDocument(ESP.getMaxFreeBlockSize() - 512);
# else // if ESP8266
root = new (std::nothrow) DynamicJsonDocument(ESP.getMaxAllocHeap());
# endif // if ESP8266 Edit: Our scenario would match this: https://arduinojson.org/v6/how-to/determine-the-capacity-of-the-jsondocument/#what-if-i-dont-know-my-input-ahead-of-time |
It won't even fit on the 0...10 scale. |
To-do:
As being asked here: https://www.letscontrolit.com/forum/viewtopic.php?p=72083#p72083 i do a PR for Open-Meteo events
On OpenMeteo#current Do...
)It works but responses can get quite long, especially for hourly variables and also when all types combined together.
But for now it was working fine on an esp32 classic even with very long resonses > 6kb
I tried to kind of create a size check but i am no expert for memory constraint systems. Maybe you can help out here with some recommendations.
I guess when calling this it is already to late 🙂 :
How to use:
sendtohttp api.open-meteo.com,80,/v1/forecast?...
Issues:
ESPEasy throws a "Too many arguments" error but it still works fine