Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

JSON POST http request


Question

Posted

Hi community!

I was hoping someone can help me out with something.

 

So, I got

Please login or register to see this link.

to open/close my curtains.

They've got an OpenAPI. At this moment there is no integration Fibaro (but they say it will be). I also do have Home Assistant and with that I can control my curtains.

I know it's not ideal, but I would like to use the Home Assistant API to open/close my curtains. So when I press a button on a Zwave remote, it opens/closes my curtains.

 

I don''t have any knowledge about JSON and http requests into Lua. I have the code below, but it doesn't work (I didn't expected to ;-)).

At this moment it I get the error: 

[ERROR] 07:22:13: line 3: '' expected near '" "'

But I don't think it's the only thing which isn't right.

They payload I defined should be in the body.

 

Please login or register to see this code.

Recommended Posts

  • 0
Posted

@gabordewit I have only one curtain going from left to right. Now the curtain closes only half way the window. Can I make some changes to settings to close the curtain completely?

  • 0
Posted
On 10/22/2020 at 6:27 PM, Embecom said:

@gabordewit Will there be  HC3 support in the near future?

 

  • 0
Posted
On 3/3/2020 at 2:56 PM, gabordewit said:

local requestStr = {email = userName, password = password}

@gabordewiti have a question.

in need to send in the body of my http request this:

Body JSON:
{
  "mode": "MODE_VALUE"
}
 
How i can write?
 
    local requestStr = {"mode" ,  "instant_arm"}
   local requestTringToJSON = json.encode(requestStr)
 
i have always error 400.
could someone help me?
--more about the original code
  • 0
Posted

@gabordewit

 

I've got some trouble getting the scene up and running. It seems the API is not working? I get below debug log:

 

 

[DEBUG] 20:03:04: Request for dry run received
[DEBUG] 20:03:04: Calling getToken function for access
[DEBUG] 20:03:04: RequestStr:{"password":","email":""}
[DEBUG] 20:03:04:

Please login or register to see this link.


[DEBUG] 20:03:04: 2023-04-28 20:03:04.227519 [ error] Handshake error: certificate verify failed
[DEBUG] 20:03:04: 2023-04-28 20:03:04.229029 [ error] Handshake error: bad message type
[DEBUG] 20:03:04: error: bad message type
 

Could you please let me know if you have a solution.

 

Thanks,

Coen

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...