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

Need Virtual Device for Pioneer VSX 923


Question

Posted

Hello everybody

 

I need a Virtual Device for my Pioneer VSX 923

I need the following buttons:

Power ON

Power OFF

Mute

Slider for volume level

Outputs buttons for all HDMI


Thank you for your help.

2 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    POWER ON:

    --[[
    %% properties
    %% globals
    --]]

    fibaro:log("Start process");

    local _deviceIp = "192.168.1.200";
    local _devicePort = 23;
    local _maxRetryProcess = 2;

    local function _process(retry)
        retry = retry or 0;
        --open the socket
        
    local tcpSocket = Net.FTcpSocket(_deviceIp, _devicePort);
        --set the read timeout
        tcpSocket
    :setReadTimeout(250);
        --notify user
        fibaro
    :log("Try Power ON, #" .. retry .. " please wait...");
        fibaro:sleep(250);    
        
    --send packet
        
    local bytes, errorCode = tcpSocket:write("\r\nPO\r\n");
        --check for error     
        
    if errorCode == 0 then
        --cli should return the string sent if success
        
    local result = tcpSocket:read();
            -- could compare to the encoded version of the call to confirm success
        fibaro
    :log(result);
        fibaro:sleep(1000);
        return true;
        else
        if retry < _maxRetryProcess then
            fibaro:log("Retry process, please wait...");
            fibaro:sleep(1000);
            return _process(retry + 1);
        end
        return false;
        end
    end

    local f, result = pcall(_process);

    if (f) then
        if (result == true) then
            fibaro:log("Command successufully transmited.");
        else
            fibaro:log("Cannot send command!");
        end
    else
        fibaro:log("Error: " .. f);
    end

    POWER OFF:

    --[[
    %% properties
    %% globals
    --]]

    fibaro:log("Start process");

    local _deviceIp = "192.168.1.200";
    local _devicePort = 23;
    local _maxRetryProcess = 2;

    local function _process(retry)
        retry = retry or 0;
        --open the socket
        
    local tcpSocket = Net.FTcpSocket(_deviceIp, _devicePort);
        --set the read timeout
        tcpSocket
    :setReadTimeout(250);
        --notify user
        fibaro
    :log("Try Power OFF, #" .. retry .. " please wait...");
        fibaro:sleep(250);    
        
    --send packet
        
    local bytes, errorCode = tcpSocket:write("\r\nPF\r\n");
        --check for error     
        
    if errorCode == 0 then
        --cli should return the string sent if success
        
    local result = tcpSocket:read();
            -- could compare to the encoded version of the call to confirm success
        fibaro
    :log(result);
        fibaro:sleep(1000);
        return true;
        else
        if retry < _maxRetryProcess then
            fibaro:log("Retry process, please wait...");
            fibaro:sleep(1000);
            return _process(retry + 1);
        end
        return false;
        end
    end

    local f, result = pcall(_process);

    if (f) then
        if (result == true) then
            fibaro:log("Command successufully transmited.");
        else
            fibaro:log("Cannot send command!");
        end
    else
        fibaro:log("Error: " .. f);
    end

    • 0
    Posted

    Please login or register to see this link.

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