Please login or register.

Login with username, password and session length
Advanced search  

News:

The Buster PiX10Hub is here! Created by the Community, for the Community.:)% #:)

Author Topic: "EvolSmartLight.hgx" Automatic module shut off after time,motion,or light level  (Read 341 times)

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 989

This is a great program to turn off modules after they are turned on!
« Last Edit: October 28, 2020, 04:35:14 PM by mike »
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 20
  • Posts: 1872

This is available via the package manager in HG.  There is no reason to share a copy here when there is source available to install easily within the interface.  Might also be nice to site the author (noliono) when posting their work so it doesn't come across as though you were taking credit.   ???

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 989

Just wanted to add a small tweak I made to noliono's downloadable program.  He ended the program with:

      if (elapsed.TotalSeconds > timeout) {
        Program.Notify(mod.Instance.Address + " " + mod.Instance.Name + "<br>switched OFF.");
        mod.Off();
      }

I added a few more PLC off commands to try to be more robust:

      if (elapsed.TotalSeconds > timeout) {
        Program.Notify(mod.Instance.Address + " " + mod.Instance.Name + "<br>switched OFF.");
        mod.Off();
        Pause(1);
        mod.Off();
        Pause(1);
        mod.Off();
      }
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.