Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Question

Posted

Is there a LUA code that can make HC2 restart xx hours ?

FX

16 answers to this question

Recommended Posts

  • 0
Posted

no you can't I think.

  • 0
Guest Martial25
Posted

this code worked before but not anymore:

--[[

%% autostart

%% properties

%% globals

--]]

while true do

local currentDate = os.date("*t");

if ( string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "00:38")

then

os.execute("reboot");

end

fibaro:sleep(59*1000);

end

  • 0
Posted

It is for that I ask to make API to reboot

  • 0
Guest deraaij
Posted
It is for that I ask to make API to reboot

do a http POST on: /api/service/reboot will do the trick.

  • 0
Posted

fxpa,

You must use the api reference:

Please login or register to see this link.

but you must use POST Http request method (http 405 error with GET Method) to submits the HTTP request to the server and also logged into HC2 (use credentials).

I have not tried doing this in LUA...

[ Added: 2013-05-03, 21:11 ]

Shad, Martial25, fxpa,

use this LUA script

Please login or register to see this code.

replace with your HC2 IP, your id and password ... work very well

Please login or register to see this image.

/emoticons/default_icon_wink.gif" alt=";-)" />

  • 0
Posted

I will try tomorrow.

tx

  • 0
  • Inquirer
  • Posted

    It Works perfectly

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    • 0
    Guest Martial25
    Posted

    Thank You !

    It's work.

    Please login or register to see this link.

    • 0
    Posted

    Anything similar for soft shutdown?

    • 0
    Posted

    Anything similar for soft shutdown?

    • 0
    Posted
    fxpa,

    You must use the api reference:

    Please login or register to see this link.

    but you must use POST Http request method (http 405 error with GET Method) to submits the HTTP request to the server and also logged into HC2 (use credentials).

    I have not tried doing this in LUA...

    [ Added: 2013-05-03, 21:11 ]

    Shad, Martial25, fxpa,

    use this LUA script

    Please login or register to see this code.

    replace with your HC2 IP, your id and password ... work very well

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    Hi, We test the code. It is working successfully. How can we reboot the HCL, had u tested for HCL

    • 0
    Posted

    Change credentials to yours, base64 coded and set IP to controller address, port: 80

    Please login or register to see this link.

    • 0
    Posted
    Change credentials to yours, base64 coded and set IP to controller address, port: 80[/quote

    Hi,

    It is not working: can u brief the info on code

    • 0
    Posted

    You need authorization. To do that enter

    Please login or register to see this link.

    fill the field with your credentials in following manner: login:password (e.g. admin:admin). Now change credentials in virtual device.

    • 0
    Posted

    You need authorization. To do that enter

    Please login or register to see this link.

    fill the field with your credentials in following manner: login:password (e.g. admin:admin). Now change credentials in virtual device.

    Please login or register to see this code.

    [ERROR] 12:30:06: line 6: attempt to index global 'Net' (a nil value)

     

    What am I doing wrong?
    • 0
    Posted

    Net.FHttp doesn't work in scenes, only in virtual machines

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...