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

Question

Posted

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

  • 0
Posted

Did you get it to work? Im trying to control my HTC790 soundbar

  • 0
  • Inquirer
  • Posted

    No, i sold the soundbar :-)

    • 0
    Posted

    Bad for me ?

    I just want to set ClearAudio and Nightmode On/Off, so it's not a big deal. I have had it for several years always in nightmode and clear audio on ?

    • 0
    Posted

    I have Samsung soundbar and I used iTach IP2IR to control it with HC2, but after buying new Philips TV it is automatically turned on after TV is turned on so don't need for extra control. Also volume I can change with VD for Philips TV so I don't even need extra VD for it. Very happy :-)

     

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