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


All Activity

This stream auto-updates

  1. Past hour
  2. This works in a scene local function urlencode (str) return str and string.gsub(str ,"([^% w])",function(c) return string.format("%%% 02X",string.byte(c)) end ) end local function doTest(url) net.HTTPClient():request(url, { options = { method = 'POST', checkCertificate = false, timeout = 1000, headers= { ['Content-Type'] = 'application/json', ['accept'] = '*/*' } }, success = function(response) fibaro.debug(tag,response.status .. " " .. response.data) end, error = function(message) fibaro.debug(tag,"HTTPClient error: " .. message) end }) end doTest("https://httpbin.org/post"..urlencode("?event=e1&tag=t2")) if the parameter part is not urlencoded it's stripped away by the HC3/Scene
  3. Yesterday
  4. Same problem here. Did you find a solution?
  5. The third-part magnetic contact is good idea. Please consider, that even if you assemble the contacts and will know the gate position (open, close, partially open) you will probably need some programming to handle the gate. maybe your drive allows to force close or open, but I don't think so. I think that you can only do a sequence: move one direction, stop, move other direction by shortcut proper pins. And when o.e. you need to open the gate it may first start to close or - when closing - spot an obstacle and do not finish movement. It depends on the last operation before. This will need LUA scene to handle - to ensure that action was done to the very end. Also, there are extension cards for some gate drives (o.e. Hormann, quite popular in Poland), which provides info about gate status and can send specific command to the drive (open, close). Worth checking if there's any for CAME.
  6. I also noticed that. is there a workaround on this?
  7. Ah, you are doing a POST. Normally you have a data payload with the parameters then. What I said. Parameters in the URL don't work in a HTTP scene. I don't know why. I tested this with an own HTTP endpoint to see what the HC3 sends, and from a scene the parameters are gone and with a QA they are still there.
  8. Here is the full code that works great with QA: -- Binary switch type should handle actions turnOn, turnOff -- To update binary switch state, update property "value" with boolean function QuickApp:doTest(url) net.HTTPClient():request(url, { options = { method = 'POST', checkCertificate = false, timeout = 1000, headers= { ['Content-Type'] = 'application/json', ['accept'] = '*/*' } }, success = function(response) self:debug(response.status .. " " .. response.data) end, error = function(message) self:debug("HTTPClient error: " .. message) end }) end function QuickApp:turnOn() self:debug("binary switch turned on") QuickApp:doTest("http://10.254.5.254/webhook?event=e1&tag=t2") self:updateProperty("value", true) end function QuickApp:turnOff() self:debug("binary switch turned off") QuickApp:doTest("http://10.254.5.254/webhook?event=e2&tag=t2") self:updateProperty("value", false) end -- To update controls you can use method self:updateView(<component ID>, <component property>, <desired value>). Eg: -- self:updateView("slider", "value", "55") -- self:updateView("button1", "text", "MUTE") -- self:updateView("label", "text", "TURNED ON") -- This is QuickApp inital method. It is called right after your QuickApp starts (after each save or on gateway startup). -- Here you can set some default values, setup http connection or get QuickApp variables. -- To learn more, please visit: -- * https://manuals.fibaro.com/home-center-3/ -- * https://manuals.fibaro.com/home-center-3-quick-apps/ function QuickApp:onInit() self:debug("onInit") end also QA works with "GET" as method.
  9. I posted this a year ago and there was no response, so I ask again, wouldn't it be a good idea to redo the power panel including the batteries? Maybe it would also require more integration of power plants from different manufacturers. Perhaps systems like solarassistant and the like ? Thank you
  10. This is somfy engine (GLYDEA ULTRA 35 DCT) connection scheme. I use FGS-224 to run (switch on) Open (1) and Close (6) contacts with (3) Ground/Common. There is https://community.smartthings.com/t/somfy-glydea-35e/57415/3 a more details description. And it's working fine. I only want to add this device as "Blind" to see it in the "Blinds list".
  11. Yes, it would be too inefficient to traverse any nested json structure looking for time values…
  12. Ahh okay, so ER5 probably has some inbuilt mechanism to convert simple LUA global variables, if they have time format. Thats why it works when using simple global variable without having us to convert it before using..thanks
  13. Yes, he’s doing a GET request with the parameters in the URL.
  14. Can you show us the full request code that works in a QA? You can encode parameters in the URL of a POST... I guess you don't have a body for the POST? ...I believe that there is something else going on here
  15. Your URL doesn't work in a LUA scene but it's no problem in a quickApp (different HTTPclient)
  16. Yes, because it's a string "06:15", you need to convert it to the number of seconds. The constant 06:15 in the rule rule("@06:15 => ...") is just a short for the number of seconds (6*3600+60*15) In ER4 there used to be a function time(str) that converted a time string to number of seconds but it seems to have gone missing when I converted it to ER5. You can define it with rule("time = fibaro.toTime") and then do rule("@time(HOUSECHECKTIME) => do somethinkg...") Alternatively you convert it to seconds when you define it in Lua HOUSECHECKDATA = json.decode(hub.getGlobalvariable(HOUSECHECKDATA)) HOUSECHECKTIME = fibaro.toTime(HOUSECHECKDATA.housechecktime) -- now is number of seconds rule("@HOUSECHECKTIME => do somethinkg...")
  17. @Nevicare @Hakon @Langedijk I have uploaded a version of the quickapp (in the first post). Please let me know it this works.
  18. You're example is not working in a Lua scene. Write a QA that does it and let the scene trigger the QA as a workaround. It's not nice, I know.
  19. @jgab Jan i am storing table data in a global variable HOUSECHECKDATA like this {housechecktime = '06:15', housecheckmode = enabled} however when i want to use that table data in a rule HOUSECHECKDATA = json.decode(hub.getGlobalvariable(HOUSECHECKDATA)) HOUSECHECKTIME = HOUSECHECKDATA.housechecktime --and when using in a rule rule("@HOUSECHECKTIME => do somethinkg...") -- i am getting this error Rule: Invalid daily time: 06:15 HOUSECHECKTIME is a regular string value, what am i missing?
  20. Is there a way to do what I need? Thank you.
  21. This is a GET request with the parameters into the link. This is not a POST request. Yes, get request with application/x-www-form-urlencoded data (data in the url) is not supported in the HTTP:request implementationin a scene. I found that out the hard way. It's stupid, but the HTTP implementation of the scene and Quick App parts is different. Why FIBARO?
  22. Thank you. It works on QuickApp, but it doesn't work on LUA Scene. I get 200 status respone but doesn't work. What I actually want is to do a request to http://10.254.5.254/webhook?event=e1&tag=t1 But it seems it does a request to http://10.254.2.254/webhook instead of the full url (http://10.254.5.254/webhook?event=e1&tag=t1) I even tried with GET and still the same issue, what can I do? If I do it via QuickApp the same way it works, but it doesn't work in LUA Scene.
  1. Load more activity
×
×
  • Create New...