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
rvelthoen 12
Hi,
I want to control my Soundbar with a Fibaro scene.
When i test the soundbar with Postman, i can turn it on and of like this:
---------------------------------------------------------------------------------
(POST) http://192.168.0.12:10000/sony/system
and in the body:
{
"method":"setPowerStatus",
"id":55,
"params":[
{
"status":"standby"
}
],
"version":"1.1"
}
----------------------------------------------------------------------------
This works perfect.
Sinds i am not a LUA programmer, i hacke'd some code like this:
--[[
%% properties
%% events
%% globals
--]]
function updateTable()
if fibaro:getGlobalValue("NetworkTable") == nil then
local http = net.HTTPClient()
http:request("http://192.168.0.12:10000/sony/system/", {
options = { method = 'POST', headers = {},
data = '{"method":"setPowerStatus","id":55,"params":[{"status":"standby"}],"version":"1.1""}', timeout = 2000 },
success = function(status)
setTimeout(popTable, 3000)
fibaro:debug(status.status)
if status.status ~= 200 and status.status ~= 201 then print("failed"); end
print(status.data);
end,
error = function(err)
print('[ERROR] ' .. err)
end
})
else
popTable()
end
end
-------------------------------------------------------------------------------------------------------
But is does nothing, not even a error in the debug screen.
Is there somebody who can help me?
4 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.