Created At

Jul 15, 2018

Last Update

Jul 30, 2018

Platforms

HC 2

Views

2324

Download

335

Type Scene

FUNCTIONS

The scene checks the status of all battery devices and displays information about battery levels in the debug window. It will also inform you if the level drops below 20%

 

INSTALATION

  • Copy and paste whole code to the lua editor in HC2
  • Enter ID of your phone in variable phoneID, you can check it using: IP_address_of_your_HC/api/iosDevices, (in my case 16)
  • local phoneID = 16;

HOW TO USE

Manually - just press start button

Automatically – you need to add at the beginning of the code:

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

--scene will be performed every 19th at 10:20

if (t.day == 19) and (t.hour == 10) and (t.min == 20) then

 --remember to add "end" of the end of whole code

end

this will cause the scene to start automatically once a month at a given time.

 

RIGHTS

I allow code to be reuse or change. Also labels can be translated and adjust.

8 Comments,  Want to add comment please login
D963b0278da434449accd9cdbb018887

Hey, For autostart working you need to add %% autostart at the second line of the code, (just above %% properties) otherwise there is NO TRIGGER . Then Fibaro will autorun this scene always, and check the date if it is time to check the battery For best practices add sleep command before the last "end" fibaro:sleep(60*1000) --script waits for 60 sec before checking time again to see if the battery's need to be checked

1b3d3af63ca6fc0d2403ed0ce928f41b

Great!

2ddb8628c94e5548b4e975802ddb2a5a

Hello, when i modify the code ti works. I've changed the "+1" for each devices and let empty.

2ddb8628c94e5548b4e975802ddb2a5a

Hello, 4.18 for my software. I only copy/past the scene and ad the ID of my phone

1b3d3af63ca6fc0d2403ed0ce928f41b

@Francis Mory what software version on HC you have? Did you try to rewrite the scene?