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

HC3 - Help with simple QA sending UDP commands


Firepeet

Question

I've been already searching and trying for hours to control a lamp by sending UDP commands.

If I send the commands with Packet Sender to 192.168.1.80, port 5982, it works fine.

 

For lamp on: 80 00 00 00 11 9D 01 00 00 00 31 00 00 08 04 01 00 00 00 01 00 3F

For lamp off: 80 00 00 00 11 9D 01 00 00 00 31 00 00 08 04 02 00 00 00 01 00 40

 

I'd really appreciate it if someone can help me on my way to make a simple QA for this.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • @jakub.jezek thanks for your answer.

    I tried the following code and this turns the lamp on?

     

    Please login or register to see this code.

     

    Now i have to find out how to turn the lamp off in the same QA

    Link to comment
    Share on other sites

    • 0

    This would be the structure of the QA (of type com.fibaro.binarySwitch). You would need to work on checking the return value (recieveData) to see if the action worked.

    And then if there is a command to read the current status of the lamp so you can sync the state when the QA starts up (or someone operate the lamp by some other mean than the QA?)

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thanks all for your help guys.

     

    The quick app will be crashed with the error message: Unknown error occurred: void sendTo(UDPSocket&,std::string const&,std::string const&,int)

    Something that I have to change in the code?

     

    Please login or register to see this attachment.

     

     

     

     

    Link to comment
    Share on other sites

    • 0

    Does it work better of you do

    Please login or register to see this code.

    ?

    I modified the code in the earlier post too.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Yess, it's working???

    Next step is to add a slider to dim the lamp. 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I can adjust the brightness of the lamp with the string:

    0x80, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x08, 0x03, hexvalue, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00

     

    Hexvalue 0x00 = 0%, and  0x64 = 100% brightness

     

    I try to use the following code for sending the slider value to the lamp, but doesn't work.

    In de debug i see the value 0-100 from the slider, and the hex value 0x00 - 0x64 after conversion.

     

    Please login or register to see this code.

     

    Do someone know what's going wrong?

     

    Link to comment
    Share on other sites

    • 0

    Well, send takes a string.

    Try this

    Please login or register to see this code.

     

    Actually, the code I posted assumed that the QA was a binary switch.

    If it's a multilevelSwitch the turnOff and turnOn should update the 

    'value' property to 0 and 100 respectively when you turnOff and turnOn.

    Do you have a command for reading the brightness value?

    Link to comment
    Share on other sites

    • 0

    What kind of device is it? Make and type?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thanks again, this is working for me. 

    I'm not yet have the command for reading the brightness level.

    it's Milight with a  

    Please login or register to see this link.

     

    Link to comment
    Share on other sites

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