In the first part of Curl Widget configuration, using the api documentation it si possible to send values to desired input in a node of EmonCMS. The json param includes the value %f that will be replaced by the value introduced by the user in the input box.
In the second part it is also possible the Max and Min value definitions. If no value is introduced, no limit will be applied.
The input box with the desired value.
Updated value after the value introduction. The input configured in curl input widget is logged to feed that it is shown in the dashboard.
If a value is introduced out of the limits, a message appears. In this case The max value allowed is 203 and I have introduced 205. The value will not bee sent to EmonCMS.
I have created this mod to satisfy the possibility of alarm updates for the emoncms feeds using Node-Red. I have designed preformatted alarm flows in Node-Red and the flows read the values thanks to the node-red-node-emoncms. The engine used to store the input values is “time series” because is the perfect engine for irregular updates. By this way each flow read the last value of desired and can execute programeted behaviour acording the saved value thanks to the curl input.
This is my personal use, but I think that it could be very interesting for other cases of use.
What do you think about it? Could it be interesting to add it in EmoncCMS?
Rubén - Here is my use case:
I’d like to enter usage data from past Utility invoices into emoncms. This would include electric, gas, and water.
Enter Date, enter Time (default to Noon), enter Value1, and enter Value2. Click submit and the data is entered into emoncms.
I am interested in seeing the Curl Widget added to the EmonCMS system. But I’m not sure if my use case is possible with the Curl Widget. And I am having trouble understanding the Curl Widget and how it works with Node-RED and emoncms (I may just need more coffee!). Is it possible to publish your node-red flow? or a generic example flow with the Curl Widget? Thanks!
The curl input widget it is only a widget to generate an input box and get value introduced by the user. That its all! Then the introduced value is sent where you want using HTTP POST.
In my case (the example) I send the value to EmonCMS again and the value is saved in a feed. The value saved in the feed can be accessed using emoncms-node. But you can send the value directly to node-red and receive it with http node.
The widget is designed thinking in a small interactions from the dashboard with a value range, not for a multi-input or dump information in EmonCMS.