Call to an JSON RPC API

346 views
Skip to first unread message

Christian Radermacher

unread,
Nov 21, 2013, 3:05:17 AM11/21/13
to ope...@googlegroups.com
Hello,

is it possible to call to an external json roc api?

I want to communicate with IP-Symcon. There is an JSON API

$rpc = new JSONRPC("http://user:pass...@127.0.0.1:82/api/");
$rpc->SetValue(38809, 18.5);
I must give an internal ID (38809 in the Sample) and the value.


Is there a solution in Rules possible?

Regards
Christian
 

Christian Radermacher

unread,
Nov 22, 2013, 4:13:25 PM11/22/13
to ope...@googlegroups.com
Hello,

i found a solution with httpie. I cover this in a Windows Batch File.

Now a new Problem. Can I read the item label text in a Rule. I need it as an Parameter for my batch calling?


Regards
Christian



Am Donnerstag, 21. November 2013 09:05:17 UTC+1 schrieb Christian Radermacher:
Hello,

is it possible to call to an external json roc api?

I want to communicate with IP-Symcon. There is an JSON API

$rpc = new JSONRPC("http://user:password@127.0.0.1:82/api/");
$rpc->SetValue(38809, 18.5);

Christian Radermacher

unread,
Nov 22, 2013, 4:17:15 PM11/22/13
to ope...@googlegroups.com
Sorry,

here is my call for IP-Symcon JSON API

http.exe --json POST http://user:pas...@127.0.0.1/api/ jsonrpc=2.0 method=DS_SwitchMode params:=[%1,true] id=null

Regards
Christian

Kai Kreuzer

unread,
Nov 21, 2013, 3:23:09 PM11/21/13
to ope...@googlegroups.com
Hi Christian,

Talking to IP-Symcom sounds rather like a usecase of a dedicated binding instead of doing it in a rule, don’t you think?
So if you would go for a binding, things would be easy; you could simply use the Jackson library and do your requests :-)

Regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/groups/opt_out.

Christian Radermacher

unread,
Nov 23, 2013, 8:39:38 AM11/23/13
to ope...@googlegroups.com
Hi Kai,

yes a new Binding would be the best way. But my KnowHow in Java is not enough to realize it.

Is it possible to get the item label text in a Rule?
This would be helpful for me.

Greetings
Christian




Am Donnerstag, 21. November 2013 21:23:09 UTC+1 schrieb Kai Kreuzer:
Hi Christian,

Talking to IP-Symcom sounds rather like a usecase of a dedicated binding instead of doing it in a rule, don’t you think?
So if you would go for a binding, things would be easy; you could simply use the Jackson library and do your requests :-)

Regards,
Kai
Am 21 Nov 2013 um 09:05 schrieb Christian Radermacher <radermache...@googlemail.com>:

Hello,

is it possible to call to an external json roc api?

I want to communicate with IP-Symcon. There is an JSON API

$rpc = new JSONRPC("http://user:password@127.0.0.1:82/api/");
$rpc->SetValue(38809, 18.5);
I must give an internal ID (38809 in the Sample) and the value.


Is there a solution in Rules possible?

Regards
Christian
 
Reply all
Reply to author
Forward
0 new messages