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


HC3 : Broadlink HUB (with support RM4)


10der

Recommended Posts

with your permission we should extend the topic to support of broadlink devices ...

I have added partial support based on the code here for Broadlink SP3S power plug identified by 0x947A 

There are several devices of these types and we could work together to add them based on discovery code and support / test when needed 

 

Code I have to improve ... stil it works 

 

Step 1 : import AddedSP3S_to_Broadlink_hub (v7).fqa

Step 2: use discovery => to get device IP 

Step 3 : import plugBroadlink_V1.fqa

Step 4: set ip; scriptId => script id of the hub ; id => self id inside the plugBroadlink_Example_V[version].fqa

Step 5 : have fun

 

 

 

 

Please login or register to see this attachment.

Please login or register to see this attachment.

Edited by vifefref45
Link to comment
Share on other sites

  • 3 months later...
On 10/1/2021 at 11:32 AM, Phenix said:

Hopefully it worked for you

@Phenix I followed your youtube videos (thanks for the efforts) - but like others have posted on your YouTube page - it is not working for me either. Has something changed since you posted the video in Sep 2021? My HC3 is on 5.100.22 and I have a RM4 Pro

My goal is to get my RM4 Pro learning codes form the IR remote so I can then write block scenes to control IR devices on my HC3. Any chance of an updated video or instructions from you please?

all I got on button press was:

[DEBUG] [QUICKAPP89]: onAction: {"args":["192.168.0.161"],"actionName":"learn","deviceId":89}[07.02.2022] [07:53:28 pm] [WARNING] [QUICKAPP89]: Class does not have learn function defined - action ignored

Edited by mrmoon
Link to comment
Share on other sites

Can you send me the code you are using to "learn"?

 

looks like the learn is not linked to the "onReleased" button.

 

function QuickApp:learnRM4()

    self:debug("button1 turned on")

    self:updateProperty("value", true)

 

fibaro.call(193, "learn", "IP of your BL device", 0x51da) -- Only for RM4

end

 

 

Please login or register to see this attachment.

Link to comment
Share on other sites

make sure your device ID is referenced to your broadlink hub device

Mine is 193 so replace the 193 with your device ID

 

Regards

Link to comment
Share on other sites

Let me know if that fixes the problem.

I have the latest version of HC3 and not made any changes - mine still works like a dream.

Link to comment
Share on other sites

@Phenix 

Thank you so much for looking at this for me.

My Broadlink RM4 Pro is set up and working via my phone on the Broadlink App (so I know it works and can learn from TV remote)

In HC3 I have it set up as device ID 89. Pressing discover button shows the following:

[09.02.2022] [03:42:16 pm] [DEBUG] [QUICKAPP89]: { ["blIp"] = 192.168.0.161,["blDeviceType"] = 25916,["blMac"] = a0:43:b0:b9:1a:a3,}

Which means it finds it at 192.168.0.161

I’ve got HC3 running on LAN cable only (HC3 wifi is disabled) as per instructed.

RM4 Pro ‘Lock’ setting is turned off

My ‘test’ binary switch in HC3 is at ID 90

The code copied from you is (and I changed IP and ID numbers to match my setting and I also set both buttons to same ID and IP as I’m not sure which one should work for my RM4 Pro):

 

 

-- Binary switch type should handle actions turnOn, turnOff

-- To update binary switch state, update property "value" with boolean

 

local qaHub = fibaro.getDevicesID({name="Broadlink hub"})[1]

local broadLink = ""

 

function QuickApp:turnOn()

    self:debug("binary switch turned on")

    self:updateProperty("value", true)

 

local command = "JgBYAAABJ5MTExITExISExMSEhMSFBE4EjgTNxM4ETkRORE5ETkRExMTERQTNxE5EjgTEhMSEjgTNhQ2ExMTEhMSEzcTNxMSEgAFHgABKUgTAAxUAAEnSRIADQU=" --automaticaly

    --  fibaro.call(1948, "sendIRCommand", "192.168.0.161", command) -- for all RM devices

    fibaro.call(89, "sendIRCommand", "192.168.0.161", command, 0x51da) -- Only for RM4

 

 

end

 

function QuickApp:turnOff()

    self:debug("binary switch turned off")

    self:updateProperty("value", false)    

 

local command = "JgBYAAABJ5MTExITExISExMSEhMSFBE4EjgTNxM4ETkRORE5ETkRExMTERQTNxE5EjgTEhMSEjgTNhQ2ExMTEhMSEzcTNxMSEgAFHgABKUgTAAxUAAEnSRIADQU=" 

 fibaro.call(89, "sendIRCommand", "192.168.0.161", command) -- for all RM devices

 --fibaro.call(89, "sendIRCommand", "192.168.0.161", command, 0x51da) -- Only for RM4

 

 

end

 

function QuickApp:learnRM4()

    self:debug("button1 turned on")

    self:updateProperty("value", true)

 

fibaro.call(89, "learn", "192.168.0.161", 0x51da) -- Only for RM4

end

 

function QuickApp:learnRMPro()

    self:debug("button2 turned on")

    self:updateProperty("value", true)

 

fibaro.call(89, "learn", "192.168.0.161") -- Only for RM4

end

 

function base64dec(data)

    local b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" -- You will need this for encoding/decoding

    data = string.gsub(data, "[^" .. b .. "=]", "")

    return (data:gsub(

        ".",

        function(x)

            if (x == "=") then

                return ""

            end

            local r, f = "", (b:find(x) - 1)

            for i = 6, 1, -1 do

                r = r .. (f % 2 ^ i - f % 2 ^ (i - 1) > 0 and "1" or "0")

            end

            return r

        end

    ):gsub(

        "%d%d%d?%d?%d?%d?%d?%d?",

        function(x)

            if (#x ~= 8) then

                return ""

            end

            local c = 0

            for i = 1, 8 do

                c = c + (x:sub(i, i) == "1" and 2 ^ (8 - i) or 0)

            end

            return string.char(c)

        end

    ))

end

 

function string.tohex(str)

    return (str:gsub(

        ".",

        function(c)

            return string.format("%02X", string.byte(c))

        end

    ))

end

 

function QuickApp:onInit()

    self:debug("onInit")

    broadLink = self:getVariable("Broadlink")

end

 

 

And the result I get when pressing either button (learnRMPro or learnRM4) is:

 

[[09.02.2022] [04:00:21 pm] [DEBUG] [QUICKAPP89]: onAction: {"args":["192.168.0.161"],"actionName":"learn","deviceId":89}

[09.02.2022] [04:00:21 pm] [WARNING] [QUICKAPP89]: Class does not have learn function defined - action ignored

 

Or

[09.02.2022] [03:52:46 pm] [TRACE] [QUICKAPP90]: UIEvent: {"elementName":"button1","eventType":"onReleased","values":[],"deviceId":90}

[09.02.2022] [03:52:46 pm] [DEBUG] [QUICKAPP90]: button1 turned on

 

It seems to change message after a 10 minutes - one fills in the IP address then 10 mins later has it left blank!

 

But no light on the RM4 Pro (so no indication it is ready to learn a IR remote button).

 

When I press the binary switch on/off button I get:

[09.02.2022] [03:54:44 pm] [DEBUG] [QUICKAPP90]: onAction: {"deviceId":90,"args":[90,"turnOff"],"actionName":"turnOff"}

[09.02.2022] [03:54:44 pm] [DEBUG] [QUICKAPP90]: binary switch turned off

[09.02.2022] [03:54:44 pm] [DEBUG] [QUICKAPP89]: onAction: {"args":["192.168.0.161","JgBYAAABJ5MTExITExISExMSEhMSFBE4EjgTNxM4ETkRORE5ETkRExMTERQTNxE5EjgTEhMSEjgTNhQ2ExMTEhMSEzcTNxMSEgAFHgABKUgTAAxUAAEnSRIADQU="],"actionName":"sendIRCommand","deviceId":89}

[09.02.2022] [03:54:44 pm] [ERROR] [QUICKAPP89]: Can`t send code to device 192.168.0.161

 

Which would indicate the RM4 Pro is not receiving the signal (In understate the IR code is your specific one for your AC - but I would expect my RM4 Pro to at least be able to receive it and send it out even though I have no IR device that would recognise  that code).

 

 

Then:

Pressing the LearnRM4 button again I get a different message:

09.02.2022] [03:58:14 pm] [TRACE] [QUICKAPP90]: UIEvent: {"elementName":"button1","eventType":"onReleased","values":[],"deviceId":90}

[09.02.2022] [03:58:14 pm] [DEBUG] [QUICKAPP90]: button1 turned on

[09.02.2022] [03:58:14 pm] [DEBUG] [QUICKAPP89]: onAction: {"args":["192.168.0.161",20954],"actionName":"learn","deviceId":89}

[09.02.2022] [03:58:14 pm] [WARNING] [QUICKAPP89]: Class does not have learn function defined - action ignored

 

Really appreciate your help on this. I know enough about technology to be dangerous - but not enough to get it working!

 

Please login or register to see this attachment.

Link to comment
Share on other sites

It looks correct to me - I’m at work at the moment in Denmark and returning to UK tomorrow night so can look into detail on Friday.

in the meantime can you send me the FQA for Broadlink Hub and then the QA for the learn. I’m just taking a guess here but think maybe on your FQA for Broadlink hub.

 

look at my latest video there is a link for the latest fqa with temp/humidity QA, failing that we can do a teams/Skype call.

 

Link to comment
Share on other sites

23 hours ago, Phenix said:

Glad we got it sorted

Yes - was user error on my side! I was putting the binary switch ID instead of the Broadlink Hub ID. 

Thanks for the great support!

  • Like 2
Link to comment
Share on other sites

  • 5 months later...

Hi I have been a year working with Broadlink_hub (v7) controling RM4 yesterday i have through some problems in my system because of electricity.

I have to insert RM4 through into my network again but since this the Quick app crashed and these messages is the output every time i press (Discover)

 

 [TRACE] [QUICKAPP1613]: UIEvent: {"values":[],"eventType":"onReleased","elementName":"Discover","deviceId":1613}

 

[DEBUG] [QUICKAPP1613]: ./include/manager.lua:97: attempt to index a nil value (field 'eth0')

[ERROR] [QUICKAPP1613]: QuickApp crashed

[ERROR] [QUICKAPP1613]: Unknown error occurred: handleJsonRpc

Edited by ABDULLAH258
Link to comment
Share on other sites

On 8/1/2022 at 11:18 AM, ABDULLAH258 said:

Hi I have been a year working with Broadlink_hub (v7) controling RM4 yesterday i have through some problems in my system because of electricity.

I have to insert RM4 through into my network again but since this the Quick app crashed and these messages is the output every time i press (Discover)

 

 [TRACE] [QUICKAPP1613]: UIEvent: {"values":[],"eventType":"onReleased","elementName":"Discover","deviceId":1613}

 

[DEBUG] [QUICKAPP1613]: ./include/manager.lua:97: attempt to index a nil value (field 'eth0')

[ERROR] [QUICKAPP1613]: QuickApp crashed

[ERROR] [QUICKAPP1613]: Unknown error occurred: handleJsonRpc

Is there is anyone face this problem before, please help

Link to comment
Share on other sites

2 minutes ago, ABDULLAH258 said:

Is there is anyone face this problem before, please help

 

 

Could it be that the IP adress changed for the hub after the power outage ?

Link to comment
Share on other sites

2 minutes ago, ppeterr said:

 

 

Could it be that the IP adress changed for the hub after the power outage ?

thank you for reply 

No change happen in the ip of hc because I can access it from the same ip and the other setting still as it is in hc network   

Link to comment
Share on other sites

4 minutes ago, ABDULLAH258 said:

thank you for reply 

No change happen in the ip of hc because I can access it from the same ip and the other setting still as it is in hc network   

 

So, the RM4 ip is also the same as in the config of the qa. Sorry then i dont know.

Link to comment
Share on other sites

Just now, ppeterr said:

 

So, the RM4 ip is also the same as in the config of the qa. Sorry then i dont know.

Yes it is I give RM4 static IP in my Router I also Check it ?

@ppeterr Thank You 

Link to comment
Share on other sites

7 hours ago, Phenix said:

Did you by any chance change your Fibaro hub from Cat5 hard wire to WiFi

@PhenixThank you for your respond.

I work with HC3 Lite first setup connect it to wifi then I connect with Ethernet converter but I remove it along time ago and the QA was working Fine without any problems.

If there is any thing I can do or certain configuration you know I will be grateful

Link to comment
Share on other sites

@ABDULLAH258 - not sure about this at all, and not sure if your using this code.

 

But when i read at github @Phenix (your code i think?)

This looks important.

 

- Did the naming of the device change ?

- Did you lock the device in the mobile APP?

 

Quote

Please be ware this QA searches for the Broadlink RM4 Pro QA by NAME, and the 10der Broadlink QA should be renamed to "Broadlink RM4 Pro" to work

In the Broadlink mobile APP. you need to go into the app under the Broadlink device and deselect "Lock device". if not done, the Broadlink RM4 Pro QA will fail authentication.

 

  • Thanks 1
Link to comment
Share on other sites

On 8/5/2022 at 8:58 PM, ABDULLAH258 said:

@PhenixThank you for your respond.

I work with HC3 Lite first setup connect it to wifi then I connect with Ethernet converter but I remove it along time ago and the QA was working Fine without any problems.

If there is any thing I can do or certain configuration you know I will be grateful

 

 

Watch from 1min30

 

 

 

On 8/6/2022 at 7:06 AM, ppeterr said:

@ABDULLAH258 - not sure about this at all, and not sure if your using this code.

 

But when i read at github @Phenix (your code i think?)

This looks important.

 

- Did the naming of the device change ?

- Did you lock the device in the mobile APP?

 

 

Hi @ppeterr not my code done by 10der

  • Thanks 2
Link to comment
Share on other sites

On 8/5/2022 at 9:58 PM, ABDULLAH258 said:

@PhenixThank you for your respond.

I work with HC3 Lite first setup connect it to wifi then I connect with Ethernet converter but I remove it along time ago and the QA was working Fine without any problems.

If there is any thing I can do or certain configuration you know I will be grateful

 

So, when i look at the video, posted above.

It states "you need to be connected to ethernet". So maybe put back that ethernet converter back?

Edited by ppeterr
  • Thanks 1
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
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...