Created At

Jul 15, 2018

Last Update

Jul 30, 2018

Platforms

HC 2

Views

998

Download

167

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.

7 Comments,  Want to add comment please login
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?

2ddb8628c94e5548b4e975802ddb2a5a

Hello, it doesn't work for me, here is the message : lua:27 attempt to concatenate a nil value