Pages: [1]   Go Down
Author Topic: Send/ Receive data to Fibaro HC2 using REST API  (Read 3 times)
0 Members and 2 Guests are viewing this topic.
Online Online
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Please could anyone help with the Arduino code required to PUT data on to a Fibaro Home Centre 2 (HC2) using their latest REST API? The plan is to connect I/O and temperature sensors to my Arduino Mega and send data to my HC2 using HTTP requests. I want to PUT the HTTP requests to global variables on the HC2 and create scenes to control lighting, heating, etc.

So far I have managed to GET data using the following code. The global variable is called test and only seems to work with Basic Authorization.

  if (client.connect(server, 80)) {
    client.println(" HTTP/1.1");
    client.println("Authorization: Basic xxxxxxxxxxxxxxx");

I'm not sure how to PUT data as I need to send a request parameter in JSON?

I managed to update the variable using WCFSTORM.REST, so I think it's possible. I'm just not sure what code is required (after many hours of failed attempts)? I've used WireShark but to be honest, this is beyond me. I'm also new to Arduino/ programming.

The request parameter I want to send follows:

  "test": "1"


Pages: [1]   Go Up
Jump to: