Aller au contenu

Overdrive

Membres confirmés
  • Compteur de contenus

    16
  • Inscription

  • Dernière visite

Profile Information

  • Sexe :
    Homme
  • Ville :
    hendaye
  • Box
    Autre

Visiteurs récents du profil

Le bloc de visiteurs récents est désactivé et il n’est pas visible pour les autres utilisateurs.

Overdrive's Achievements

Newbie

Newbie (1/14)

3

Réputation sur la communauté

  1. Bonjour, désoler pour la réponse tardive. Pour moi j'ai créer un commutateur binaire avec comme code dans MAIN ; function QuickApp:turnOn() self:debug("binary switch turned on") self:updateProperty("value", true) local http = net.HTTPClient() http:request("http://---IP---/yuri.php?action=CHANGE_ENGINE_STATE&state=1&engine=RASP_SALON&q=on", { options = { headers = { ["content-type"] = "application/json;charset=UTF-8", ["Authorization"] = "Basic TON-MOT-DE-PASSE", ["Cache-Control"] = "no-cache, no-store", ["X-Fibaro-Version"] = "2" }, method = "GET" }, }) end function QuickApp:turnOff() self:debug("binary switch turned off") self:updateProperty("value", false) local http = net.HTTPClient() http:request("http://---IP---/yuri.php?action=CHANGE_ENGINE_STATES&state=1&engine=RASP_SALON&q=off", { options = { headers = { ["content-type"] = "application/json;charset=UTF-8", ["Authorization"] = "Basic TON-MOT-DE-PASSE", ["Cache-Control"] = "no-cache, no-store", ["X-Fibaro-Version"] = "2" }, method = "GET" }, }) end function QuickApp:uibtnonOnReleased(event) self:turnOn() end function QuickApp:uibtnoffOnReleased(event) self:turnOff() end CA MARCHE TRES BIEN POUR MOI
  2. Slt, non, avant tout fonctionner sur domoticz.
  3. Bonjour a tous personne a une petite idée !!!!! Please
  4. Bonjour, j'essai de récupérer les températures de mes capteurs Phillips hue. J'ai rien trouver dans se sens.
  5. Overdrive

    Création bouton lecture

    Ok c'est bon tous marche merci encore a toi GÉNIAL !!!!!!!!!!!!!!
  6. Overdrive

    Création bouton lecture

    M'en mettant login:pass le code : "<response status: 200/>"
  7. Overdrive

    Création bouton lecture

    Alors du coup, j'ai mis j'ai essayer mais moi j'ai login:pass@ Je l'encode comme ça direct ou j’enlève le : et @
  8. Overdrive

    Création bouton lecture

    Apparemment c'est le login et pass qui marche pas je sais pas comment faire
  9. Overdrive

    Création bouton lecture

    Merci de ton aide, j'ai rajouter ; function QuickApp:setValue(Value) self:debug("Lecture ok") self:updateProperty("value", false) local http = net.HTTPClient() http:request("http://login:pass@172.20.254.250:9002/status_header.html?p0=play&player=cc%3Acc%3Acf%3A10%3A61%3A81", { options = { headers = { ["content-type"] = "application/json;charset=UTF-8", ["Authorization"] = "Basic pwd=", ["Cache-Control"] = "no-cache, no-store", ["X-Fibaro-Version"] = "2" }, method = "GET" }, success = function(response) self:debug("response status:", response.status) self:debug("headers:", response.headers["Content-Type"]) local data = json.decode(response.data) if data.contents and data.contents.quotes and data.contents.quotes[1] then local quote = data.contents.quotes[1].quote self:debug(quote) self:updateView("label", "text", quote) end end, error = function(error) self:debug('error: ' .. json.encode(error)) end }) end function QuickApp:uibtnlectureReleased(event) self:setValue(Value) end Le retour me donne ; [QUICKAPP115]: Lecture ok[19.04.2020] [10:36:20] [DEBUG] [QUICKAPP115]: response status: 401[19.04.2020] [10:36:20] [DEBUG] [QUICKAPP115]: headers: text/html[19.04.2020] [10:36:20] [ERROR] [QUICKAPP115]: QuickApp crashed[19.04.2020] [10:36:20] [ERROR] [QUICKAPP115]: /usr/share/lua/5.3/json/decode/util.lua:35: unexpected character @ character: 1 0:1 [<] line:
  10. Bonjour a tous, j’essaye de créer un bouton lecture pour mon lecture squeezbox. Malheureusement ça marche pas. Voici le code ; function QuickApp:setValue(Value) self:debug("Lecture ok") self:updateProperty("value", false) local http = net.HTTPClient() http:request("http://login:pass@172.20.254.250:9002/status_header.html?p0=play&player=cc%3Acc%3Acf%3A10%3A61%3A81", { options = { headers = { ["content-type"] = "application/json;charset=UTF-8", ["Authorization"] = "Basic pwd=", ["Cache-Control"] = "no-cache, no-store", ["X-Fibaro-Version"] = "2" }, method = "GET" }, }) end function QuickApp:uibtnlectureReleased(event) self:setValue(Value) end
  11. Overdrive

    Requette http

    Merci a vous tous, ça fonctionne nickel
  12. Overdrive

    Requette http

    Pardon petit souci ............. Mon script fait une erreur ; line: 12 Wrong parameter type, string required. Provided param 'table: 0x40832990' is type of table function QuickApp:turnOn() self:debug("binary switch turned on") self:updateProperty("value", true) local http = net.HTTPClient() http:request("http://IP:8004/yuri.php?action=CHANGE_ENGINE_STATE&state=1&engine=RASP_SDB&q=on", { success = function(response) if response.status == 200 then fibaro:debug('OK, réponse : '.. response.data) else fibaro:debug("Erreur : status=" .. tostring(response.status)) end end, error = function(err) fibaro:debug("Erreur : " .. err) end, options = { headers = { ["content-type"] = "application/json;charset=UTF-8", ["Authorization"] = "Basic YWRtaW46YWRtaW4=", ["Cache-Control"] = "no-cache, no-store", ["X-Fibaro-Version"] = "2" }, method = "GET" }, }) end function QuickApp:turnOff() self:debug("binary switch turned off") self:updateProperty("value", false) local http = net.HTTPClient() http:request("http://IP:8004/yuri.php?action=CHANGE_ENGINE_STATES&state=1&engine=RASP_SDB&q=off", { success = function(response) if response.status == 200 then fibaro:debug('OK, réponse : '.. response.data) else fibaro:debug("Erreur : status=" .. tostring(response.status)) end end, error = function(err) fibaro:debug("Erreur : " .. err) end, options = { headers = { ["content-type"] = "application/json;charset=UTF-8", ["Authorization"] = "Basic PWD", ["Cache-Control"] = "no-cache, no-store", ["X-Fibaro-Version"] = "2" }, method = "GET" }, }) end function QuickApp:onInit() self:debug("onInit") end
  13. Overdrive

    Requette http

    Merci 1000 fois, ça marche nikel.
  14. Overdrive

    Requette http

    Bonjour, merci de votre aide. Mais moi je voudrais le faire en distant , pas en local. Avec l'adresse exemple ; http://url:8080/
  15. Overdrive

    Requette http

    Bonjour, J'essaye de créer un bouton virtuel pour envoyer une requette http a un raspberry. Je suis débutant en lua. Voila ce que j'ai pour le moment function QuickApp:turnOn() self:debug("binary switch turned on") self:updateProperty("value", true) local http = net.HTTPClient() http:request("http://172.20.0.205/api/callAction?deviceID=46&name=turnOn", { success = function(response) if response.status == 200 then fibaro:debug('OK, réponse : '.. response.data) else fibaro:debug("Erreur : status=" .. tostring(response.status)) end end, error = function(err) fibaro:debug("Erreur : " .. err) end, options = { method = 'GET' } }) end function QuickApp:turnOff() self:debug("binary switch turned off") self:updateProperty("value", false) end Une fois que j'appui sur le bouton Ca me marque ; line: 14 Wrong parameter type, string required. Provided param 'table: 0x1a3270e0' is type of table Si quelqu'un a une idée. Merci de votre aide
×
×
  • Créer...