971jmd Posté(e) le 6 août 2018 Signaler Partager Posté(e) le 6 août 2018 salut je voie que toit aussi tu t'intéresse a initial state. Ci-joint le tuto : https://forum.fibaro.com/topic/30976-fibaro-initialstate-plugin-how-to/?tab=comments#comment-155160 je le teste et ça fonctionne très bien, mais le Plugin initial state de FIBARO, ne propose pas de possibilité de remonter la valeur d'une variable global ou une la valeur d'un label. je cherche de l'aide pour réaliser un code LUA pour remonter ces valeurs merci de votre aide Lien vers le commentaire Partager sur d’autres sites More sharing options...
kioneoranga Posté(e) le 6 août 2018 Signaler Partager Posté(e) le 6 août 2018 J'ai lu les informations sur le FOFO officiel, mais il semblerait que pour exploiter cette solution, il faut un abonnement? Non ? Lien vers le commentaire Partager sur d’autres sites More sharing options...
Sakkhho Posté(e) le 6 août 2018 Signaler Partager Posté(e) le 6 août 2018 Pour comprendre : C est le domochart de @Lazer mais plus funky ? Lien vers le commentaire Partager sur d’autres sites More sharing options...
pepite Posté(e) le 6 août 2018 Signaler Partager Posté(e) le 6 août 2018 Oui, c'est payant, 5 Dollars par mois. Gratuit 14 jours ;-) Lien vers le commentaire Partager sur d’autres sites More sharing options...
Dragoniacs Posté(e) le 6 août 2018 Signaler Partager Posté(e) le 6 août 2018 Pour comprendre : C est le domochart de [mention=133]Lazer[/mention] mais plus funky ?C'est quoi domochart ?Envoyé de mon BTV-W09 en utilisant Tapatalk Lien vers le commentaire Partager sur d’autres sites More sharing options...
971jmd Posté(e) le 7 août 2018 Auteur Signaler Partager Posté(e) le 7 août 2018 (modifié) j'avance bien grâce au FOFO officiel mai il reste un problème, dans le code ci-dessous il il manque quel chose pour activée la scène a chaque foie que la LABEL1 change d'état . je n'arrive pas --[[ %% properties 389 ui.Label1.value %% globals --]] -- only one instance allowed if (fibaro:countScenes() == 2) then fibaro:abort() end -- initialstate account informatons -- please specify the login data below local streamingAccessKey = "xxxxxxxxxxxxxxxxxxx" local bucketKey = "xxxxxxxxxxxxxxx" -- the name of the datapoint local datakey = "VDLabel1" -- change to the label you wish to read and show on initialstate local mylabeltoread = fibaro:getValue(389, "ui.Label1.value") ------------------------------ -- do not change code below -- ------------------------------ local headers = {} headers['Content-Type'] = 'application/json' headers['X-IS-AccessKey'] = streamingAccessKey headers['X-IS-BucketKey'] = bucketKey -- not sure if this is good idea, Fibaro is using in their plugin -- but i think "Accept-Version: ~0" could be better headers['Accept-Version'] = '0.0.1' -- initialstate URL local posturl = 'https://groker.initialstate.com/api/events' -- main function function showVDLabelOnInitialState() local event = {} -- let's use local time event["epoch"] = os.time() event["key"] = datakey event["value"] = mylabeltoread local bucket = {} table.insert(bucket, event) if (tostring(json.encode(bucket)) ~= "{}") then --send bucket isData = net.HTTPClient({timeout = 2000}) isData:request(posturl, { options = { method = 'POST', headers = headers, data = json.encode(bucket), }, success = function(param) end, error = function() print("error") -- no no, don't abort here, sometimes initialstate reports error, so let's not break loop --fibaro:abort() end } ) else print('label without value? exiting now ...') fibaro:abort() end -- loop every 1 minute setTimeout(function() showVDLabelOnInitialState(); end, 5000) end fibaro:debug("loop started...") showVDLabelOnInitialState() Modifié le 7 août 2018 par 971jmd Lien vers le commentaire Partager sur d’autres sites More sharing options...
Messages recommandés