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

Sending multiple commands to Global Cache device


Question

Posted

I have a global cache close contact device and I can send a single command to the device using a virtual device without any problems.

eg to turn ON to the first relay I would send the following string command:    setstate,1:1,10x0D0x0A

 

The question I have is how can I send 2 or more consecutive commands in a single virtual device button ?  In other words, if I want to send an OFF command straight after the ON what is the format I use ?

I have tried all sorts of combinations to combine (just guessing really) but it doesn't work.

 

Do I have to use LUA to do it ? If so, can someone please help with the code ?

 

Thanks

9 answers to this question

Recommended Posts

  • 0
Posted

Hi, 
sorry for adding a question to you question but I was wondering what virtual device you used to talk to the GC appliance and which GC appliance is. I have one ready to install 

 

thanks and apologies again

-F

  • 0
Posted

Maybe you can take a look at this page:

Please login or register to see this link.

  • 0
Posted

Thanks Lambik

That helps a lot

 

-F

  • 0
  • Inquirer
  • Posted

    I am using the GC close contact relay but my question applies to any of the GC products.

    Anyone know how to send multiple commands?

    • 0
    Posted

    Not sure it this helps, but Im using the following LUA code to switch on the TV via GC:

     

    fibaro:log("Connecting...");
    fibaro:debug("Connecting...");
    local selfId = fibaro:getSelfId();   
    local ip = "192.168.1.70";
    local port = 4998;
    tcpSocket = Net.FTcpSocket(ip, port);
    tcpSocket:setReadTimeout(1000);
     
    -- POWER --
    tcpSocket:write("sendir,1:1,3,36199,1,1,97,32,16,32,16,16,16,16,16,32,32,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,16,16,32,16,16,16,3025,96,32,16,32,16,16,16,16,16,32,32,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,16,16,32,16,16,16,3025,96,32,16,32,16,16,16,16,16,32,32,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,16,16,32,16,16,16,3600\r");
    fibaro:sleep(2000);
    result, err = tcpSocket:read();
    tcpSocket:write("END");
     
    if (err == 0) then
      fibaro:log("transfer OK");
      fibaro:debug("transfer OK");
      fibaro:log("Please Wait...");
      fibaro:sleep(5000);
    else
      fibaro:log("transfer failed");
      fibaro:debug("transfer failed");
    end
    tcpSocket:disconnect();
    • 0
    Posted

    In the past, trying to learn LUA, I made a virtual device for testing purposes. Maybe you can use some lua snippets:

    Please login or register to see this link.

    • 0
  • Inquirer
  • Posted

     

    Not sure it this helps, but Im using the following LUA code to switch on the TV via GC:

     

    fibaro:log("Connecting...");
    fibaro:debug("Connecting...");
    local selfId = fibaro:getSelfId();   
    local ip = "192.168.1.70";
    local port = 4998;
    tcpSocket = Net.FTcpSocket(ip, port);
    tcpSocket:setReadTimeout(1000);
     
    -- POWER --
    tcpSocket:write("sendir,1:1,3,36199,1,1,97,32,16,32,16,16,16,16,16,32,32,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,16,16,32,16,16,16,3025,96,32,16,32,16,16,16,16,16,32,32,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,16,16,32,16,16,16,3025,96,32,16,32,16,16,16,16,16,32,32,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,16,16,32,16,16,16,3600\r");
    fibaro:sleep(2000);
    result, err = tcpSocket:read();
    tcpSocket:write("END");
     
    if (err == 0) then
      fibaro:log("transfer OK");
      fibaro:debug("transfer OK");
      fibaro:log("Please Wait...");
      fibaro:sleep(5000);
    else
      fibaro:log("transfer failed");
      fibaro:debug("transfer failed");
    end
    tcpSocket:disconnect();

     

     

    Yes the LUA code worked and will do exactly what i want! 

    Now to modify the script to suit my purpose...

     

    Thanks!

    • 0
    Posted (edited)

    Hi guys,

    Do you know to emulate a long press? I have several functions that are turned on by a short press of a button and are turned off by a long press (2-3 seconds)... the code is the same....

     
    Edited by Ros
    • 0
    Posted

    Hi Mefubar99,

     

    Thanks a lot for this piece of lua code! With this I created three-digit buttons with the names of favorite TV channels like History HD, National Geografic etc. From today I don`t need to click digits one by one and can easiely choose interested channels by my smartphone 8-)

     

    For the Ros case and others with the same problem, my suggestion is: maybe it`s enough to decrease parameter "fibaro:sleep(2000);"  to (1000) or less then copy and paste the same ir code few times for new button ? 

     

    Greetings from Poland ;-)
     

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