Hi everyone,
i hope you can understand my problem. My english isn't that good ![]()
I am working on a device, that will be used to control lights and a few more things in a living room. The device gets its orders via MQTT and decides what to do then. For example: when someone rings the doorbell, the Media Center should be told to pause the movie or turn down the volume of the music. Also some lights should be turned on. Most of this works already.
Now i really have no clue how to control the XBMC media center from the arduino. XBMC offers a HTTP JSON API so i need to get and parse JSON data from URLs like this one:
http://192.168.13.37:8080/jsonrpc?request={"jsonrpc":%20"2.0",%20"method":%20"Player.GetActivePlayers",%20"id":%201}
the reply would look like that:
{"id":1,"jsonrpc":"2.0","result":[{"playerid":0,"type":"audio"}]}
I really don't know where to start. There are three steps to be done:
- build the request URL (should not be too hard. i can do that. perhaps i could just hard-code these few commands )
- send the request
- parse the JSON-reply
Do you guys know any libraries to get the latter two actions done? Will there be any problems with my current libraries? I am using Tlc5940.h, SPI.h, Ethernet.h, PubSubClient.h, Metro.h
Thanks a lot in advance
/Jan from Germany