Find Jobs
Hire Freelancers

Programador Lua

€8-30 EUR

Stengt
Lagt ut nesten 9 år siden

€8-30 EUR

Betalt ved levering
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.
Prosjekt-ID: 7620413

Om prosjektet

Eksternt prosjekt
Aktiv 9 år siden

Ønsker du å tjene penger?

Fordeler med budgivning på Freelancer

Angi budsjettet og tidsrammen
Få betalt for arbeidet ditt
Skisser forslaget ditt
Det er gratis å registrere seg og by på jobber
Brukeravatar
________________________I AM READY TO WORK CAN HELP YOU VERY LOW BUDGET PLEASE CHAT ME____________________________________________
€8 EUR om 1 dag
0,0 (0 omtaler)
0,0
0,0

Om klienten

PORTUGALs flagg
Portugal
0,0
0
Medlem siden mai 6, 2015

Klientbekreftelse

Takk! Vi har sendt deg en lenke for at du skal kunne kreve din gratis kreditt.
Noe gikk galt. Vær så snill, prøv på nytt.
Registrerte brukere Publiserte jobber
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Forhåndsvisning innlasting
Tillatelse gitt for geolokalisering.
Påloggingsøkten din er utløpt og du har blitt logget ut. Logg på igjen.