Aller au contenu

jang

Membres confirmés
  • Compteur de contenus

    69
  • Inscription

  • Dernière visite

Réputation sur la communauté

61 Excellent

1 abonné

À propos de jang

  • Rang
    Membre interessé

Profile Information

  • Sexe :
    Homme
  • Ville :
    Home
  • Box
    Home Center 2

Visiteurs récents du profil

521 visualisations du profil
  1. jang

    question HTTP request

    Seulement le matin alors?
  2. jang

    question HTTP request

    Need to add 'http://' prefix to url
  3. jang

    UN petit coup de main SVP

    You can do the same with Python, Perl whatever. However, to pull down the code you need to do it from outside the HC3. I think that is what henri-allauch was attempting.
  4. jang

    UN petit coup de main SVP

    Yes, but you have to run the code offline on PC/Mac (HC3 don't have io.*). Ex. using this
  5. jang

    QuickApp - Chauffage Fil Pilote Qubino

    http://www.lua.org/manual/5.3/manual.html#3.4.1 "With the exception of exponentiation and float division, the arithmetic operators work as follows: If both operands are integers, the operation is performed over integers and the result is an integer. Otherwise, if both operands are numbers or strings that can be converted to numbers (see §3.4.3), then they are converted to floats, the operation is performed following the usual rules for floating-point arithmetic (usually the IEEE 754 standard), and the result is a float. Exponentiation and float division (/) always convert their operands to floats and the result is always a float. Exponentiation uses the ISO C function pow, so that it works for non-integer exponents too."
  6. jang

    QA remote

    It works very well for me. Does it show up in the block scene editor? The "Central Scene ID" option? Remote.fqa
  7. jang

    QA remote

    This QA shows up in the block scene editor for me function QuickApp:onInit () self:debug ("Remote") local inf = api.get("/devices/"..self.id).interfaces for _,i in ipairs(inf) do if i=='zwaveCentralScene' then inf=nil; break end end if inf then inf[#inf+1]='zwaveCentralScene' self:addInterfaces(inf) end self:debug(json.encode(inf)) self: updateProperty ( "centralSceneSupport" , { {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 1 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 2 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 3 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 4 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 5 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 6 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 7 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 8 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 9 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 10 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 11 }, {keyAttributes = { "Pressed" , "Released" , "HeldDown" , "Pressed2" , "Pressed3" }, keyId = 12 }, }) end
  8. jang

    QA remote

    Have you set interfaces = { 'zwaveCentralScene' } ?
  9. jang

    UN petit coup de main SVP

    function dumpScene(id) local s,c,f = api.get("/scenes/"..id) c = json.decode(s.content) f = io.open("Scene_"..id.."_actions.lua","w"); f:write(c.actions); f:close() f = io.open("Scene_"..id.."_conditions.lua","w"); f:write(c.conditions); f:close() f = io.open("Scene_"..id..".lua","w"); f:write(json.encode(s)); f:close() end --- Download scene from HC3 dumpScene(13) --- Edit Scene_13_actions.lua ... --- Edit Scene_13_conditions.lua ... function restoreScene(id) local f,a,c,s f = io.open("Scene_"..id.."_actions.lua","r"); a=f:read("*all"); f:close() f = io.open("Scene_"..id.."_conditions.lua","r"); c=f:read("*all"); f:close() f = io.open("Scene_"..id..".lua","r"); s=f:read("*all"); f:close() s = json.decode(s) s.content=json.encode({conditions=c,actions=a}) api.put("/scenes/"..id,s) end --- ... then restore scene to HC3 restoreScene(13)
  10. jang

    Gestion des appareils enfants

    Fair enough. I stand corrected, removeChildDevice() is called when children are deleted in the IU, so the onAction hook will work. You could also intercept calls to the method. function QuickApp:onInit() local orgRemoveChildDevice = self.removeChildDevice function self:removeChildDevice(id) self:debug("Child ",id," is about to be deleted") -- do other stuff orgRemoveChildDevice(self,id) end end
  11. Ok, I understand. Good luck :-)
  12. Is it a GEA syntax problem or api? If it's the api this is what I use in ER4 -- id to profile name function self:profileName(id) for _,p in ipairs(api.get("/profiles").profiles) do if p.id == id then return p.name end end end -- profile name to id function self:profileId(name) for _,p in ipairs(api.get("/profiles").profiles) do if p.name == name then return p.id end end end -- set active profile if id ~= nil, or return current active profile if id == nil function self:activeProfile(id) if id then if type(id)=='string' then id = self:profileName(id) end assert(id,"activeProfile(id) - no such id/name") return api.put("/profiles",{activeProfile=id}) and id end return api.get("/profiles").activeProfile end
  13. jang

    Gestion des appareils enfants

    When a child is deleted (from Lua or UI) you get a 'DeviceRemovedEvent' in / refreshStates The QuickApp will also update the self.childDevices table. Why don't you store your extra info in the child table? self.childDevices [childID] .extraInfo = ... it's just the child instance I don't think r emoveChildDevice (...) is called by the QA if you delete the child in the UI.
  14. jang

    Gestion des appareils enfants

    It should work. Be careful if chidId doesn't exist (just removed). HC3 logs a warning if ID doesn't exists. What are you doing with 'removeChildDevice' ?
  15. jang

    télécharger QA depuis une application tierce

    Yes, I can. ...but I have a Mac
×