Hello!
I try to set up process over the API.
Example:
http://192.168.0.202/emoncms/input/process/add.json?inputid=1&processid=1&arg=-1&newfeedname=power
I always get "false"
May I made a error or how can I use it?
Thank you!
Archived Forum |
|
API: Input process actions not workingSubmitted by unique24 on Sun, 20/04/2014 - 15:07Hello!
I try to set up process over the API. Example: http://192.168.0.202/emoncms/input/process/add.json?inputid=1&processid=1&arg=-1&newfeedname=power
I always get "false"
May I made a error or how can I use it?
Thank you! » |
Re: API: Input process actions not working
Ok, I found the commands for "*" and "+":
http://192.168.0.202/emoncms/input/process/add.json?inputid=17&processid...
So have someone a complete list of the arg's?
Because processid 1 is for feed and it does not work to generate a new one.
I can link a existing feed, but need to create new one.
Thank you!
Re: API: Input process actions not working
Have you tried adding your Read&Write API key?
Re: API: Input process actions not working
Hello!
Well, I can add now process and feeds, but I dont know the arg.
To generate a new process and Feed I have to add The correct arguments.
Is there a list or more examles?
THank you!
Re: API: Input process actions not working
The API documentation is available from the API page in emoncms ( Input API help - top right) http://emoncms.org/input/api
Re: API: Input process actions not working
Hello!
Yes, this link I know.
But for:
Add an input process
There are a lot off different processes.
Re: API: Input process actions not working
http://emoncms.org/site/docs/inputprocessing is specific to the input processes, this and other helpful pages are all available from the main emoncms.org page http://emoncms.org/site/home
Re: API: Input process actions not working
Hello!
Ok, thank you. This helps, but it working not for me.
I found that the "arg" has to be the ID and not the name!
This is working:
But I have also to add a new feed:
With this a new feed is created, but need:
datatype: REALTIME
Engine: PHPFIWA
What means type in the url? Trying PHPFIWA and some Integer values. But always create:
Datatype:empty
Engine: MYSQL
Thank you!
Re: API: Input process actions not working
I also tryied:
http://192.168.0.202/emoncms/feed/set.json?id=18&fields={'engine':'0'}
or:
http://192.168.0.202/emoncms/feed/create.json?name=api_demo_1&type=0&fields={%27engine%27:%270%27}
But is not working.
Has someone a complete sample to create feeds and process via API?
Thank you!
Re: API: Input process actions not working
Edit:
Ok, I found it. I search the files at the local webserver.
http://192.168.0.202/emoncms/feed/create.json?name=api_demo_9&datatype=1...
I get:
Notice: Trying to get property of non-object in /var/www/emoncms/Modules/feed/feed_model.php on line 104
{"success":true,"feedid":30,"result":true}
Seems it working, but does someone know, what the notice mean?
Thank you!
Re: API: Input process actions not working
If you open emoncms.org on an input page and open your browsers developer tools to the networks page. You can then see the urls that are produced whilst creating a feed on the webpage, from this you can emulate the urls you need.
I just tried it and got this url,
http://emoncms.org/feed/create.json?name=api_demo_1&datatype=1&engine=5&options={"interval":"10"}
changed the "name" and pasted it into browser address bar and set up an identical feed, the browser returned
using this method you should be able to compile a list of editable/eusable urls.
The message is a result of not specifying a time interval, if you add
to your url it will work without the message. (10 is default for 10 secs - change as required)
Paul
Re: API: Input process actions not working
Hello!
Great Tipp. Thank You very much!
Re: API: Input process actions not working
thx a lot!
had the same issues here!
Re: API: Input process actions not working
thx also from here!
does anybody know how to add a wh Accumulator to an input?
also i'm trying to figure out how to set the tag attribute of the new feed.