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
Question
Tibus31 0
Dear All,
I would like to change a parameter of a ZXT-120 using JSON in order to recall manually learned IR code.
I've found a code on another forum (Thanks Krikroff) and I did adapt it to my need (I'm a newbie with JSON).
It returns a 400 HTTP status code (bad request).
Here is the code:
local json = '{"id":110,"properties":{"parameters":[{"id":34,"size":1,"value":2}]}}'
local HC2 = Net.FHttp("xxxxx", 80);
HC2:setBasicAuthentication("admin", "xxxxx");
local response, status, errorCode = HC2:PUT("/api/devices?id="..deviceID, json)
if tonumber(status) == 200 then
fibaro:debug("ok");
else
fibaro:debug("err ID: "..deviceID.. " status: "..status);
end
IF i test the body (see attachment) in the new "API ACTIVE Doc" section, it works, return a 200 status number and my ZXT-120 recall a manually recorded code and turn ON my AC!
Could somebody help to correct it?
Please login or register to see this attachment.
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.