Find Jobs
Hire Freelancers

Programador Lua

€8-30 EUR

Mbyllur
Postuar almost 9 years ago

€8-30 EUR

Paguhet në dorëzim
Eu tenho uma central de Domótica ( Fibaro HC2 ) que usa a linguagem de programação Lua, e tenho 3 cenários para atingir um único objectivo, a ideia era juntar tudo num. Cenário 1: --[[ %% properties 98 value 98 armed %% globals --]] local startSource = fibaro:getSourceTrigger(); if ( ( (tonumber(fibaro:getValue(98, "value")) > 0 and tonumber(fibaro:getValue(98, "armed")) == 0) and tonumber(fibaro:getValue(95, "value")) == 0 and fibaro:getGlobalValue("Dia_Noite") == "Noite" ) or startSource["type"] == "other" ) then fibaro:setGlobal("Auto_Manual_Hall", "Auto"); fibaro:call(95, "turnOn"); end Cenário 2: --[[ %% properties %% globals Auto_Manual_Hall --]] local startSource = fibaro:getSourceTrigger(); if ( ( fibaro:getGlobalValue("Auto_Manual_Hall") == "Auto" ) or startSource["type"] == "other" ) then fibaro:setGlobal("Auto_Manual_Hall", "Running"); setTimeout(function() fibaro:call(95, "turnOff"); fibaro:setGlobal("Auto_Manual_Hall", "Manual"); end, 60000) end Cenário 3: --[[ %% properties 98 value 98 armed %% globals --]] local startSource = fibaro:getSourceTrigger(); if ( ( (tonumber(fibaro:getValue(98, "value")) > 0 and tonumber(fibaro:getValue(98, "armed")) == 0) and fibaro:getGlobalValue("Auto_Manual_Hall") == "Running" ) or startSource["type"] == "other" ) then fibaro:killScenes(24); fibaro:startScene(24); end O primeiro cenário ao detectar movimento verifica algumas condições e se estas forem verdadeiras muda uma variável do sistema para 'Auto' e liga uma luz. O segundo cenário ao detectar que a variável == Auto vai mudar a variável para 'Running' e começa um temporizador de 60s para desligar a luz e mudar a variável para 'Manual'. O terceiro cenário ao detectar movimento enquanto a variável for igual a 'Running' vai reiniciar o temporizador de 60s, ou seja o segundo cenário. Como é de esperar este terceiro cenário já não irá utilizar os comandos para parar e começar o cenário com ID 24 porque o mesmo vai deixar de existir. Mas é um trabalho muito básico, caso alguém esteja interessado em o fazer por um preço acessível e com comentários no código para eu perceber o mesmo.
ID e Projektit: 7620413

Rreth projektit

Projekt në distancë
Aktive 9 yrs ago

Po kërkoni të fitoni para?

Përfitimet e ofertës për Freelancer

Vendosni buxhetin dhe afatin tuaj
Paguhuni për punën tuaj
Përshkruani propozimin tuaj
Është falas të regjistrohesh dhe të bësh oferta për punë
Avatari i Përdoruesit
________________________I AM READY TO WORK CAN HELP YOU VERY LOW BUDGET PLEASE CHAT ME____________________________________________
€8 EUR në 1 ditë
0,0 (0 përshtypje)
0,0
0,0

Rreth klientit

Flamuri i PORTUGAL
Portugal
0,0
0
Anëtar që nga maj 6, 2015

Verifikimi i klientit

Faleminderit! Ne ju kemi dërguar me email një lidhje për të kërkuar kredinë tuaj falas.
Ndodhi një gabim gjatë dërgimit të email-it tuaj. Ju lutemi provoni përsëri.
Përdorues të regjistruar Punë të postuara
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Po ngarkohet shikimi paraprak
Leja u dha për Geolocation.
Seanca e hyrjes ka skaduar dhe ke dalë. Hyr sërish.