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


Question

Posted

HI

 

I have a doorbird intercom with which I can open the gate, in fibaro HC2 I could open the gate via a virtual device by clicking twice on a light button. I understand that I need to use quick app instead of virtual device in HC3. I was told to make a quick app with which I can open the relay, I found an LUA code on line which I used, but I can I see if this quick app will work and how can I make a scene with it. Is there anyone that uses doorbird and can open a gate (relay) with fibaro who can share this with me, so I can try to make it. I have no knowledge of lua and currently only work with blockscenes

 

this is what I found online (copilot), in which I changed the local url in my own url for the gate. I do not know of this is correct and how to check if this is working. I do not see this quick app when I want to make a scene. Sorry for these "stupid" questions but this is a bridge too far for me, but I would still like to learn and get it fixed. Thanks for your help

 

local http = require("http")

-- Function to turn on the relay
local function turnOnRelay()
    local url = "https://your-relay-ip/api/relay/on"
    local response = http.request(url, nil, {["Content-Type"] = "application/json"})
    if response.status == 200 then
        print("Relay turned on successfully")
    else
        print("Failed to turn on relay: " .. response.status)
    end
end

-- Function to turn off the relay
local function turnOffRelay()
    local url = "https://your-relay-ip/api/relay/off"
    local response = http.request(url, nil, {["Content-Type"] = "application/json"})
    if response.status == 200 then
        print("Relay turned off successfully")
    else
        print("Failed to turn off relay: " .. response.status)
    end
end

return {
    turnOnRelay = turnOnRelay,
    turnOffRelay = turnOffRelay
}
 

6 answers to this question

Recommended Posts

  • 0
Posted

Hi, hope that it will help.

Please login or register to see this attachment.

  • 0
  • Inquirer
  • Posted

    thanks tony sorry i'm still a newbie with which programme should I open this. I have now done via the notepad and is everyline with .. a new line

    • 0
    Posted

    Hi @sansuus. Just add a new device, select other device and finally, select upload file and load the file I gave you. From there you'll have to setup variables in the QA with your doorbird user/pwd and ip of your device.

    • 0
  • Inquirer
  • Posted

    thank you so much Tony it works :-)

     

    • 0
  • Inquirer
  • Posted

    thank you so much it works :-) 

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