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

Cannot get JSON Response - [ERROR] Operation canceled


Question

Posted

Hello!

I am trying to communicate with a sonoff mini DYI mode from my HC3. I was able to turn on the switch on the sonoff but I cannot get a response to know if the command was completed successfully. Instead I get the following: [ERROR] Operation canceled

The code that I used in my QA is:

 

function QuickApp:buttonOn()
    local http = net.HTTPClient()
    http:request("http://192.168.0.216:8081/zeroconf/switch", {
        options = { method = 'POST', headers = {Accept = "application/json"}, data = '{"deviceid": "", "data": {"switch": "on"}}', timeout = 3000 },
           success = function(status)
        if status.status ~= 200 and status.status ~= 201 then print("failed"); end
           print(status.data);
            end,
         error = function(err)
           print('[ERROR] ' .. err)
         end
      })
end
 
Could anyone help me with this issue to understand what I am doing wrong? 
Thank you

Recommended Posts

  • 0
Posted

still the same

Please login or register to see this code.

Please login or register to see this attachment.

  • 0
Posted

Ok! can you open 

Please login or register to see this code.

 

in your browser? how long it passed?

  • 0
Posted (edited)

Yep it even works if i put in a scene.

Please login or register to see this image.

/monthly_2020_10/image.png.475f0b2db93a96bdf58836653b81b3df.png" />

it just dont work in a QA.

Edited by idomotique

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...