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


Broadlink (without bridge)


10der

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
  • Like 1
Link to comment
Share on other sites

Discover and creation of VD work fine for RM mini3

Please login or register to see this code.

 

  • Thanks 1
Link to comment
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
    Link to comment
    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
    Link to comment
    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.

    Link to comment
    Share on other sites

    • 1 month later...

    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?

    Link to comment
    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
    Link to comment
    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
    Link to comment
    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.

     

     

    Link to comment
    Share on other sites

    • 4 months later...

    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?

    Link to comment
    Share on other sites

  • Topic Author
  • unfortunately HCL not suport LUA developing you can't

    • Like 1
    Link to comment
    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?

    • Like 1
    Link to comment
    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?

    • Like 1
    Link to comment
    Share on other sites

    • 3 months later...

    Hi again for all of you and thank you for yours support.
    What would you say if I asked you about orvibo vs20rb?
    Is it easy to introduce this product to Fibaro as a virtual device?

    Link to comment
    Share on other sites

  • Topic Author
  • 49 minutes ago, AKILLIGUVENLI said:

    orvibo vs20rb

    I do not know what is it :) 

    • Like 1
    Link to comment
    Share on other sites

  • Topic Author
  • @10der btw 

    Please login or register to see this link.

    • Like 1
    Link to comment
    Share on other sites

    5 hours ago, AKILLIGUVENLI said:

    What would you say if I asked you about orvibo vs20rb?
    Is it easy to introduce this product to Fibaro as a virtual device?

     

    orvibo has been already reversed and implemented on 3rd part hardware, however the implementation is using fake dns/paket forwarding, which in my opinion is good for "let's try if that work", but not for serious environment. Honestly, i don't like the idea of additional hardware middle of my network stream.
    EDIT: some of these implementations are working only with older hardware etc., so don't waste time and look for "not working anymore" comments ...

    There is however PoC of another way, written by Durand and insertjokehere (which actually act as real aws client), however it's not easy to get that working on HC3 without openssl bindings. I got MD5/HMAC/PKCS5/AES256 working as standalone version, fighting now with tls/x509, however not as real implementation but as (let's call it) emulation in raw format over sockets. Anyway, with openssl it would take maybe few hours only to get working QA ... There is additionally another "small" problem, i need first QuickApp encryption enabled, i can't post the aws private keys, it is required to encrypt them for app/3rd part use (and decrypt on the fly). So it will take some weeks/months, before i publish the QA, but definitely i will post.

     

    Edited by tinman
    • Like 1
    • Thanks 1
    Link to comment
    Share on other sites

    • 4 months later...

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