Find Jobs
Hire Freelancers

Programador Lua

€8-30 EUR

Closed
Posted almost 9 years ago

€8-30 EUR

Paid on delivery
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.
Project ID: 7620413

About the project

Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
User Avatar
________________________I AM READY TO WORK CAN HELP YOU VERY LOW BUDGET PLEASE CHAT ME____________________________________________
€8 EUR in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of PORTUGAL
Portugal
0.0
0
Member since May 6, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.