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
SanSuus 0
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.