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


10der

Broadlink (without bridge)

Recommended Posts

Hi!

 

I needing your help :)

 

i am trying to develop / porting accessing to Broadlink IR devices.

1st step is - discovering devices,

if you have some Broadlink devices please import this VD and run button

after this action you should refresh (F5) UI and should see some new VD devices in Fibaro UI.

can you confint what it's works.

 

thnak you!

 

Edited by 10der

Share this post


Link to post
Share on other sites

Discover and creation of VD work fine for RM mini3

Please login or register to see this code.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
  • Topic Author
  • So. some good news. and some bad news.

    1) now I can gran all my bradlink devices in HC2

    2) I can send any command to my devices via HC2 (command should be setuped via Broadlink.WinApp.exe  (windows)

    Please login or register to see this image.

    /monthly_2019_10/image.png.b6e219c1fde12b3c1e840f27aabfe736.png" />

     

    3) bad news. I can't  implement AES128 for HC2. at all.

    If we have any guru like @jgab or @petergebruers please help me...

     

    4) so I have publish VD's source code.

    but one notice here. for encrypt / decrypt used external php application

    please 

    1) setup this application

    2) patch lines for calling this service

     

        local url = "/crypt/aes.php?data=" .. toHex(inputStr).."&mode=" .. inOut .. "&key="..key
        fibaro:debug(url)
     
        -- connect to HC2 
        local HC2 = Net.FHttp("192.168.1.29"80); 
     

     

    Please login or register to see this code.

     

     

     

    Edited by 10der
    • Like 1

    Share this post


    Link to post
    Share on other sites

    socket is not accessible in HC2 (lines 574, 690)

    I propose:

    Please login or register to see this code.

     

    • Like 1

    Share this post


    Link to post
    Share on other sites

    or use in code

    local udp = Net.FUdpSocket()

    in place of

    local udp = socket.udp()

    and do correction to udp:setTimeout... to    udp:setReadTimeout(MSG_TIMEOUT)

    Sorry but in this moment i haven't possibility to analyze and correct whole code, maybe after tomorrow when I return home.

    Share this post


    Link to post
    Share on other sites

    Good afternoon! Please tell me if there is news on the use of your code? How to force Broadlink to execute commands with HC2? The question is very important to me

    If you use the recommendations from the post above:

     

    or use in code

    local UDP = net.Udpsocket()

    instead

    local UDP = socket.UDP()

    and make an amendment to udp: setTimeout... for UDP: setReadTimeout(MSG_TIMEOUT)

     

    then in HC2 an error comes out:

    [DEBUG] 11:44:43: 2019-11-24 11:44:43.268600 [ fatal] Unknown exception: /opt/fibaro/scenes/300.lua:582: attempt to index global 'Net' (a nil value)

     

    and one more question: can I describe in more detail how to get the keys for broadlink?

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • :(

     

    AES crypt can't be implemented on Fibaro LUA.

    that's al.

     

    here is ugly VD for using RM3 mini

    1) set Ip adress for broadlink device

    2) change lines in code

     

    Please login or register to see this code.

    aes.php is:

     

    Please login or register to see this code.

    please do not change anuthing here if you do not know what i do.

     

    3) change command

    local command = "26006800C0FA1272137214711471132F1471142E1471132F132F1131132F1372142D1471123014711174142E1471117413721372132F132F132F1372132F132E142E12301471142E1471142E1471132F1372142E132F1174132F1372132F1371142F1371147114F513000D05"

     

    image.png.8c727b7e4f071bb04ed7d693af6a6a86.png

     

     

     

    Please login or register to see this attachment.

    Edited by 10der

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • also. you can convert public database with codes  to broadlink codes with this LUA

     

    Please login or register to see this code.

    data base with codes attached,

     

     

    Please login or register to see this attachment.

    Edited by 10der

    Share this post


    Link to post
    Share on other sites
    5 hours ago, 10der said:

    :(

     

    AES crypt can't be implemented on Fibaro LUA.

    that's al.

     

    here is ugly VD for using RM3 mini

    1) set Ip adress for broadlink device

    2) change lines in code

     

    Please login or register to see this code.

    aes.php is:

     

    Please login or register to see this code.

    please do not change anuthing here if you do not know what i do.

     

    3) change command

    local command = "26006800C0FA1272137214711471132F1471142E1471132F132F1131132F1372142D1471123014711174142E1471117413721372132F132F132F1372132F132E142E12301471142E1471142E1471132F1372142E132F1174132F1372132F1371142F1371147114F513000D05"

     

    Please login or register to see this link.

     

     

     

    Please login or register to see this attachment.

    can you please describe what IP's i should fill?

     

    local aesServer = "192.168.1.XX"?
    local aesServerPort = 80
    local aesServerUrl = "/crypt/aes.php" -- data mode key iv
    --==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==

    local BROADLINK_AP_IP = "192.168.10.162"
    local UDP_IP_PORT = 80

    if require then
        require("fibaro")
    end

    local network = api.get("/settings/network")
    local OUR_IP = network.ip

    if require then
        OUR_IP = "192.168.1.XX"?

     

     

    and where i can find the  line local command =?! 

     

    thank u.

     

     

    Share this post


    Link to post
    Share on other sites

    Hello,
    I am using home center lite at my home.
    I also have broadlinkin rm pro + and rm mini3 at my house
    Although I can only see the IP addresses, I cannot see the ports.
    Also, when I query port 80 with the programs, it seems closed and I can't get a response.
    Does anyone know what I have to do to open a port?

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • unfortunately HCL not suport LUA developing you can't

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • 6 hours ago, antoniopll said:

    Anyone already add broadlink with HC3? 

    Now I have a quiz question:

    is HC3 has aes-128-cbc enc/dec on the board?

    Share this post


    Link to post
    Share on other sites
    2 hours ago, 10der said:

    is HC3 has aes-128-cbc enc/dec on the board?

    Yes, the ARM controller has hardware support for encryption but AFAIK we do not have access to (raw) functions or libraries.

     

    @A.Socha any plans to add access to eg OpenSSL functions through a wrapper?

    Share this post


    Link to post
    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
    Reply to this topic...

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