
bcrawfo2
Members-
Posts
30 -
Joined
-
Last visited
Everything posted by bcrawfo2
-
I think I have this fixed. Short button presses were sometimes just turning on the light on the GDO. I wrote my close garage door program to repeat the following 5 times....close the relay and then wait 30 seconds. I have another program that runs when the garage door is actually closed. The action on this is to send a notification...and also to stop the close garage door program. This way...I get positive feedback that the garage door closed...and I also get a few tries, just in case it doesn't work for some reason. This seems to be working so far.
-
I'm sure the garage door got the signal. I've gone to close after a failed auto-close and found that a button push opened the door. So...it's like the opener got a "close" and a "stop". When I went to close it manually....this was viewed as an "open". I had the relay set for .5 sec. I lowered it down to .2 sec and will see how that behaves. I have the relay set as Momentary A - triggered by either on or off. I have a program that watches the relay turning on and turns it off a few seconds later. I don't think this will cause a second relay hit...right?
-
I'm automating my garage door (closing after 5 mins). It's working well so far. Something like this: If garage door is open then wait 5 minutes call close garage door program I don't have 100% reliability on the closing. I was thinking of modifying the close garage door program...to close the door. Then wait a minute...then call another program to check the garage door again...with the THEN action being a notify that the close failed. Any better ideas?
-
Thanks. I'll give it a go in the morning
-
I've been happily using my son's table lamp as a nightlight by setting it to turn on at 7pm at 22%. The lamp was placed where nobody used the local control. We recently moved it where it gets used via local control. Tonight after bed, it became apparent that someone had turned it off, so we turned it on locally and it went to 100%. Any workaround for this? Do I write a program that says "if lamp is on and time is between 7pm and 5am, set lamp to 22%"? Am I setting myself for a race condition or something? Thanks for any input.
-
The problem with watching the arp is that you might not have an arp entry for the device. They do timeout. Then you say....I can ping it periodically. So...how frequently? What does that "active" check do to your battery life? Same with Bluetooth ping. What does pinging frequently do to you? My approach uses not extra battery and seems to be pretty quick recognizing change of state for me
-
Mine shows up pretty quickly. It could be the mix of apps I have cause a lot of traffic and thus make it connect quickly. Maybe that's why my iphone battery life is terrible. I used to have it text me as I came and went......I think it was a matter of seconds.
-
So...right now I'm not updating my ISY with this status...I'm more in an asterisk mode...but you can get the idea. Instead of running update_blf.sh...you would run a wget command to update your ISY variables. A rundown of this code. I have two wifi access points. One in my bedroom and one in the living room. On their main page....they show a list of connect users (including mac addresses). I take the output from that first page and concatenate them. I then make two passes thru it. First looking for my wife's MAC address. Then looking for my MAC address. If there is a change in status....I update a light on my asterisk phone and touch an operating system file (so other programs can understand phone status by looking for files in the /tmp directory). Let me know if you have any more questions. [root@racky isy]# more find_iphones_on_wifi.pl #!/usr/bin/perl use File::Touch; $kate_file = "/tmp/kate_iphone_"; $scott_file = "/tmp/scott_iphone_"; $count = 3; $errors = `/usr/bin/wget 192.168.101.2 -o /tmp/errors -O /tmp/bedroom.html`; open FILE, "/tmp/bedroom.html" or die "Couldn't open file: $!"; $output = join("", ); $errors = `/usr/bin/wget 192.168.101.3 -o /tmp/errors -O /tmp/living.html`; open FILE, "/tmp/living.html" or die "Couldn't open file: $!"; $output2 = join("", ); $output_joined = $output . $output2; process ("68:FF",$output_joined,$kate_file,"kate"); process ("74:E8",$output_joined,$scott_file,"scott"); sub process { $mac = shift; $output = shift; $file = shift; $user = shift; $cmd = "/etc/asterisk/update_blf.sh " . $user; if ($output =~ /$mac/) { if (-f ($file . "home")) { } else { touch ($file . "home"); $cmd .= " 1"; printf "$cmd"; system($cmd); } unlink ($file . "away"); } else { if (-f ($file . "away")) { } else { touch ($file . "away"); $cmd .= " 2"; system($cmd); } unlink ($file . "home"); } } [root@racky isy]#
-
I do something similar, but it requires a little work and changing of your thinking. I look a little more passively. I "screen scrape" the "associated clients" on my wifi for the iPhone's Mac address. I have two wifi access points and can do an "or" to check both of the, to see if I'm home Hope this helps Sent from my iPad using Tapatalk HD
-
ISY-99i, Vista 20P Panel, X10 - to activate Insteon Scenes
bcrawfo2 replied to AZAutomation's topic in ISY994
Not sure how much computing/programming resources you have available. But google ad2usb. It emulates a keypad and plugs into a computer I have perl code to decode the messages the ad2usb gets and then update iSy variables on arm and zone activity Ping me with any questions Sent from my iPad using Tapatalk -
Hopefully this is usable to you. Not much error checking yet. And...obviously need to store things like hostname, passwords, etc in variables. I put any faulted zones in an array. As we get "ready" messages from the panel, I move the arrays to old and older. Once I have a now, old, and older...I can look at the values and make sure the event actually happened. I really struggled with this logic. Once an even happens, I run a rest command to update the state variable in the ISY as well as update a SQL table. I have planned changes to pick up the LRR output to record who armed/disarmed. #!/usr/bin/perl -w use strict; use Switch; use DBI; my $database = 'house'; my $server = 'localhost'; my $user = 'insteon'; my $passwd = 'insteon'; our $DB = DBI->connect("dbi:mysql:$database:$server", $user, $passwd, {PrintError => 0} ); open (SERFH, "/usr/bin/tail -f /dev/ttyUSB0 |") || die "Can't tail device\n"; our @active_alarms = (0,0,0,0,0,0,0,0,0,0,0,0,0,0); our @last_alarms = (0,0,0,0,0,0,0,0,0,0,0,0,0,0); our @oldest_alarms = (0,0,0,0,0,0,0,0,0,0,0,0,0,0); our $previous_arm_status = "Unknown"; my $output; while () { switch ($_) { case /\[1/ { armed_status("Unarmed"); } case /\[.1/ { armed_status("Armed away"); } case /\[..1/ { armed_status("Armed home"); } case /\[............1/ { armed_status("Armed instant"); } case /\[...............1/ { armed_status("Armed stay"); } case /FAULT/ { $output =$_; $output =~ s/.*FAULT//; $output =~ s/\s//; $output =~ s/^0//; $output =~ s/"//; $output =~ s/\s.*//; chomp ($output); $active_alarms[$output] = 1; } } #switch } #while sub armed_status { my $now = localtime(); my $system_cmd; my $new_arm_status = shift; if ($previous_arm_status ne $new_arm_status) { sql_update(0,$new_arm_status); $previous_arm_status = $new_arm_status; } my $j = 0; foreach (@active_alarms) { if (($oldest_alarms[$j] == 1) and ($last_alarms[$j] == 0) and ($active_alarms[$j] == 0)) { print "Delete zone $j $now\n"; $system_cmd = "/home/isy/isy_rest --isy isy99-home-auto --username admin --password 123 /vars/set/2/" . $j . "/0 "; system ($system_cmd); sql_update ($j,0); } if (($oldest_alarms[$j] == 0) and ($last_alarms[$j] == 0) and ($active_alarms[$j] == 1)) { print "Add zone $j $now\n"; $system_cmd = "/home/isy/isy_rest --isy isy99-home-auto --username admin --password 123 /vars/set/2/" . $j . "/1 "; #print "$system_cmd\n"; system ($system_cmd); sql_update ($j,1); } $j ++; } @oldest_alarms = @last_alarms; @last_alarms = @active_alarms; @active_alarms = (0,0,0,0,0,0,0,0,0,0,0,0,0,0); } sub sql_update { my $node = shift; my $status = shift; my $query = sprintf "UPDATE alarm SET status='%s' WHERE zone='%s'",$status,$node; print "$query\n"; my $rows_affected = 0; $rows_affected = $DB->do($query); }
-
It's still very rough. I have some junk I need to remove. I struggled with the logic. Will try to have it cleaned and posted bu saturday
-
Interested where you go with this I just got an ad2usb last week I have perl code reading the ad2usb output then making rest calls to the iSy to set state variables based on zone changes I will probably make a page on my Linux box that an iSy network resource can call and drive my panel via the ad2usb
-
I have a three year old that goes around pushing my KPL buttons. I don't mind him turning on/off lights...but he leaves unused KPL buttons on. I created a scene that contains all of the unused KPL buttons as responders...but I can't find a way to run this every hour or so. Any thoughts or other creative solutions?
-
Just confirming the way I was thinking I had to do it. I steered away from the mutually exclusive buttons on the KPL due to the warnings the ISY gives me. "Warning: It is highly recommended that button groups are migrated/accomplished through scenes by adjusting respective On levels. By doing so correct status of the buttons are also reflected in ISY regardless of their groupings." I went ahead and set up using the mutually exclusive buttons, but as the warning says...the ISY view of those buttons is now wrong. I can mimic mutually exclusive buttons using my program, but that just seems labor intensive. I'll keep playing and post back for posterity. Thanks
-
Thanks for the reply oberkc. OK...I guess I can see it. If there are multiple controllers in a scene, each controller could have his own settings. So...instead of my three scenes (bright, movie, and off)...I could just have one scene with three different controllers. And...the controller level settings could take care of the levels. I can support that. But...what confuses me is... My use will have the three scenes with mutually exclusive buttons as KPL buttons (bright, movie, off)...if I invoke any of those scenes from the ISY...I have no way of turning off the buttons that don't apply. Example...if I tell ISY to turn on scene "bright"...it also turns on KPL buttons "Movie" and "Off". Am I forced to have three simple scenes (scn-bright-button, scn-movie-button, scn-off-button)...each with a single KPL button in it. Then a program that watches for the KPL-bright button...which turns scn-movie-button and scn-movie (which sets the lights as I desire). Then repeat this for my other setups?
-
This is a long one. I have a theater with a KPL which has three buttons (controllers) that are used to set scenes (bright, movie, off). My first question is....why can I set levels on the scene level and also the controller level? I know I can copy from the scene to the controller...but why would I want to do this? Also...why are other KPL buttons only shown under the controllers and not under the scene itself? This brings up my next problem. I have a KPL in a different location that has a button that monitors the status of the theater (responder for bright/movie...controller for off). If scene bright or movie are on, a button is lit. This KPL button is a controller for the off scene. This way, if I forget to turn off the lights in the theater, I can go to that KPL and push the lit button and the scene "off" gets used. Again...I have to set other KPL button levels (and now all light levels multiple times). Lastly...if I set status on a scene from a program...how do I update the KPL buttons? Thanks Scott
-
I'm just started configuring my motion sensors and want an email notification when they detect motion. I have the motion sensor timeout at 1min....I'd like to see when it's over (maybe in the GUI). I don't, however, want email after email after email while there is motion. I tried then send notification wait 10 but I believe the off event interrupts the wait. A solution I just came up with (and haven't yet tested) was to have the "on notification" program disable itself after the email. Then have the "off notification" enable the "on notification". But that seems a little convoluted. Cool product by the way. Glad I got the ISY.