Please login or register.

Login with username, password and session length
Advanced search  

News:

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

Poll

Do you see a possible use for Flags in HG?

Yes
No
Maybe

Pages: 1 2 3 [4] 5

Author Topic: Fun with Flags  (Read 1122 times)

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 264
  • Posts: 9387
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: Fun with Flags
« Reply #45 on: February 06, 2019, 06:59:03 PM »

To make it easier for the newbies attached is the program just download it and rename the file  to Advanced_Smart_Lights.hgx
Then from HG configuration/programs/lights click on actions (bottom right) and then import program.
Although this may not do away with the need of flags for some it most definitely reduce the number you need.
« Last Edit: February 06, 2019, 07:01:15 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

Dave Mc

  • Jr. Member
  • **
  • Helpful Post Rating: 1
  • Posts: 24
Re: Fun with Flags
« Reply #46 on: February 06, 2019, 07:51:41 PM »

There is no need to learn any coding for bkenobi's Advanced Smart lights you simply install it. then click on the x10 module and select Advanced Smart lights just like you do now for the smart lights addon only this gives you more options. bkenobie should have been a bit clearer on the install process for the newbies here.
this is what the Advanced Smart lights looks like.

Thanks for the additional information I will give this a try.  And bkenobie thank you for the coding you did.  I suspect it was many hours of work to put that together.
Logged

alzy

  • Hero Member
  • *****
  • Helpful Post Rating: 5
  • Posts: 355
Re: Fun with Flags
« Reply #47 on: February 07, 2019, 08:54:06 AM »

I use several flags w/AHP. One is a Away/Home flag. When I leave the house I set it and that sets up
a lighting senario  that makes the house looked lived in and also sets the thermostat  back. When I come home I reset it and the lights are back to manual control and the heat comes back up.
Logged

brobin

  • Hero Member
  • *****
  • Helpful Post Rating: 47
  • Posts: 509
Re: Fun with Flags
« Reply #48 on: February 07, 2019, 09:42:47 AM »

I use several flags w/AHP. One is a Away/Home flag. When I leave the house I set it and that sets up
a lighting senario  that makes the house looked lived in and also sets the thermostat  back. When I come home I reset it and the lights are back to manual control and the heat comes back up.
I do the same thing with my Stargate. Arming the alarm sets a flag for 'Armed Away' or 'Armed Stay' and disarming clears them. The change of state or presence of the flags adjust lighting, HVAC and other conditions.  In the days of landlines, the 'armed away' flag would also set up call forwarding to my mobile phone.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 264
  • Posts: 9387
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: Fun with Flags
« Reply #49 on: February 07, 2019, 09:57:20 AM »

In HG you can watch the status of the security system away or home so that becomes the flag.  It even has the option to run a specific program when armed, when triggered, or when disarmed.
You can even arm/disarm this with a x10 security RF remote or timer if you wish.

Many if not all end users needs can be handled without the need for flags.
However some may need additional coding which is what makes Flags attractive to anyone not wishing to code.

Users, keep posting how you use flags or why you think you may need them! This will help everyone learn some of the hidden gems of HG if it already is capable of doing things you need.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

alzy

  • Hero Member
  • *****
  • Helpful Post Rating: 5
  • Posts: 355
Re: Fun with Flags
« Reply #50 on: February 07, 2019, 10:32:25 AM »

Thanks for the incites into HG's capabilities! For me the concept of flags makes the transition to HG just easier.
« Last Edit: February 07, 2019, 10:59:50 AM by alzy »
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 264
  • Posts: 9387
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: Fun with Flags
« Reply #51 on: February 07, 2019, 11:44:07 AM »

Thanks for the incites into HG's capabilities! For me the concept of flags makes the transition to HG just easier.
I believe there are uses for flags for newbies unfamiliar with HG. They do make for a fast conversion over from AHP.
However once you have every thing moved over one should try to eliminate using them as much as possible as you slowly learn HG. It will help remove the clutter as well as possible issues with Amazons Alexa (if you use it ) and the Echo Bridge as Flags are seen if named.
With users posting how they use flags now, HG solutions can be shown. As well it may give others ideas for their HA setups.
Sharing Ideas & Solutions is what makes this forum and every ones HA setups great. ;)
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 17
  • Posts: 1670
Re: Fun with Flags
« Reply #52 on: February 07, 2019, 12:01:47 PM »

Like I've mentioned in the past, I write code for my needs.  I document it in the code which is how many people do things.  I am not releasing a product, I am simply making available something I wrote for myself in case the code helps others (either as is or as a base for another project).  If someone wants to improve upon it, that's great.  I based the code on Gene's original Smart Lights code.  After I released this update (ASL), he improved his code possibly based on/inspired by my update.

As for documenting any further, that's not going to happen.  I wrote this code several years ago and when complete, I installed it and set the coding aside.  It has plenty of documentation for my needs already.  A new user doesn't need to look at the code so it's not needed anyway.  And, once installed, the parameter fields all have sufficient comments to make it work without anything else.

There are several other useful (to me) codes I put on my github repository too.  This was primarily for me to backup in case of system loss but also to share with others.  None of these will be updated to provide documentation either as, just like ASL, they have documentation within the code and are in no need of an update.

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 264
  • Posts: 9387
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: Fun with Flags
« Reply #53 on: February 07, 2019, 12:11:43 PM »

As for documenting any further, that's not going to happen. 
I don't believe that is needed! ASL fields are labelled so there is little doubt what it does or what to type in, unlike Smart Lights.  #:)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

Dave Mc

  • Jr. Member
  • **
  • Helpful Post Rating: 1
  • Posts: 24
Re: Fun with Flags
« Reply #54 on: February 10, 2019, 08:22:51 PM »

I have been looking at ASL but not finding conditions.  In the example I gave earlier I am looking for a way for a motion sensor to trigger a light to come on for 10 minutes then turn off.  The condition is that this should occur only between 10:00 pm and sunrise.  With my limited knowledge of HG it appears that I need to enter a custom cron expression in the Cron event Wizard.  Hopefully I will be able to copy and paste something or a couple of things from the HG Helper Class Reference to make this happen.

The conditions in AHP smart macros are easy to understand.  Maybe this exists in HG and I am just not finding it.
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 17
  • Posts: 1670
Re: Fun with Flags
« Reply #55 on: February 11, 2019, 01:08:57 AM »

Unless you are willing to write some of your own code, it is unlikely that you will find something that matches 100% of your needs.  The solution I have suggested gets you 95% of your needs.

Use ASL for you motion sensing needs.  It is designed to turn the lights on if it's dark and motion is detected.  You will need to set up the solar altitude code or use one of the other sources of to get sunrise/sunset.  If you need a custom time rather than sunset/sunrise, you could easily change it to that time (hard coded).  Then, you can use a Scheduler event (crontab expression) to turn the light on at sunset and off at 10pm (or whatever you desire).

The framework is there, you just need to tweak it to get exactly what you want.  Of course, you could choose to go another route but you will be a lot farther away than 95% IMO.

Dave Mc

  • Jr. Member
  • **
  • Helpful Post Rating: 1
  • Posts: 24
Re: Fun with Flags
« Reply #56 on: February 11, 2019, 02:57:17 AM »

Unless you are willing to write some of your own code, it is unlikely that you will find something that matches 100% of your needs.

Thank you for the clarification.  In that case adding flags to HG isn't going to help.  I think what would be useful is a drop down selection for conditions.

Update:  I should have said adding flags without adding conditions isn't going to help.
« Last Edit: February 11, 2019, 03:10:21 AM by Dave Mc »
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 17
  • Posts: 1670
Re: Fun with Flags
« Reply #57 on: February 11, 2019, 08:10:37 AM »

FWIW, making my code do what you want should be easy since I had it set up that way at one point. It wasn't with HG, but the same functional code in the AHP SDK using an AutoIt script.

Like I said, the framework is there.

alzy

  • Hero Member
  • *****
  • Helpful Post Rating: 5
  • Posts: 355
Re: Fun with Flags
« Reply #58 on: February 11, 2019, 10:11:20 AM »

So HG doesn't support conditions without special code?
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 17
  • Posts: 1670
Re: Fun with Flags
« Reply #59 on: February 11, 2019, 10:53:45 AM »

Wizard scripts should be able to accomplish most things.  If you want to do more complex logic, you need a framework that supports it.  Unless ITTT is supported, you will have to write code no matter what HA software you select.  Even then, ITTT is simply graphical representation of code and is actually harder to maintain IMO than just writing a few lines.

Visual programming is a very good introduction for young programmers so they can quickly get up to speed with the programming side and learn logic.  It's not a very good approach for real code for a few reasons that I don't want to get into.  Lego did it right in getting kids playing with actual robots.  Gates did it pretty successfully getting people useful OS and applications.  The ground inbetween is where HA falls IMO.  That requires some kind of scripting language that can be easily learned and used cross platform (Python is an excellent example).
Pages: 1 2 3 [4] 5
 

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