
builderb
Members-
Posts
437 -
Joined
-
Last visited
Everything posted by builderb
-
Best thing I've done lately for my 10yo son is to set up a private Minecraft server for him and his friends so they aren't out on the public servers, but can still play communally.
-
What kind of LED lights? What control module? Dimming and brightening are certainly doable on the ISY platform.
-
There are a lot of ways to skin this particular cat. It really comes down to 'what do I already have on hand'. And I don't know enough about the IO Linc, but can you hook multiple sensors to it?
-
Yep! Crude, but effective.
-
The light sensing part was no problem on the 'duino, but getting it onto the network to talk to the ISY for $5 is where I got stuck.
-
So, basically what Gary said. It's nothing terribly complicated. I wired up an old spare Pi to a photoresistor per this Adafruit guide: https://learn.adafruit.com/basic-resistor-sensor-reading-on-raspberry-pi/basic-photocell-reading Then I modified their Python script that reads the values per the following: #!/usr/bin/env python import RPi.GPIO as GPIO, time, os import httplib2 username='<ISYusername>' password='<ISYpassword>' host="http://<XXX.XXX.XXX.XXX>" rest="/rest/vars/set/" ISY_Integer = 1 ISY_State = 2 cur_value = "" isy_var_num = <ISYvar_number> DEBUG = 1 GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) def RCtime (RCpin): reading = 0 GPIO.setup(RCpin, GPIO.OUT) GPIO.output(RCpin, GPIO.LOW) time.sleep(0.1) GPIO.setup(RCpin, GPIO.IN) # This takes about 1 millisecond per loop cycle while (GPIO.input(RCpin) == GPIO.LOW): reading += 1 return reading def ISY(mhost,murl,muser,mpass): h = httplib2.Http(".cache") h.add_credentials(muser, mpass) resp, content = h.request(mhost + murl, "GET", headers={'content-type':'text/plain'} ) while True: prev_value = cur_value cur_value = RCtime(18) if cur_value < 1000 and prev_value >= 1000: # print("Light") value = 1 r = ISY(host,rest + str(ISY_State) + "/" + str(isy_var_num) + "/" + str(value),username,password) elif cur_value >= 1000 and prev_value < 1000: # print("Dark") value = 0 r = ISY(host,rest + str(ISY_State) + "/" + str(isy_var_num) + "/" + str(value),username,password) All I did was replace their loop that constantly printed the value with a loop that checks to see if the value has crossed a numerical threshold. I have defined my threshold as 1000 here. You'll have to adjust yours as necessary to suit your taste. Uncomment the print lines during testing if you want to run the script from the command line. If all is working, you'll see it print Light and Dark as you cover the sensor with your hand. Make it executable, and follow this guide to start this service at boot: http://raspberrywebserver.com/serveradmin/run-a-script-on-start-up.html If you've got the pi and some wire handy, the sensor and capacitor will set you back a couple bucks. Hope that helps.
-
I've got a super cheap photoresistor wired up to a RasPi that changes a variable on my ISY when it crosses a threshold.
-
ISY and Phillips Hue Integration Step-By-Step (For dummies...like me)
builderb replied to DualBandAid's topic in ISY994
Jeez, I don't even remember where I found those. They're in my notes from some searches I did a couple years ago. -
ISY and Phillips Hue Integration Step-By-Step (For dummies...like me)
builderb replied to DualBandAid's topic in ISY994
From above post: "Effects work similarly, in that it also gets passed as a json object, accepting none and colorloop as arguments. For example, {"effect" : "colorloop"} will start the bulb running through all the colors. Use a transition_time argument here to speed up or slow down the process. Replace "effect" with "alert", and "colorloop" with "select", and the light will blink in its current state." -
If you don't mind picking up a RasPi, it's not too difficult to use RRDTool or R to create pretty graphs that make spotting trends or anomalies much easier.
-
There is a dst flag associated with the datetime object in Python. Between that, and pyephem, I created a script that tracks those items, plus sun angles, etc. Basically my own version of NodeLink, since I'm having node issues with my ISY and the beta 5.x line. (FYI, beware the daylight_savings object. It only tells you whether, for a given location, DST exists or not, not whether is is DST time or not.)
-
$60 for a Raspberry Pi, $50 for a hard drive, Zoneminder is free. For a couple cameras, it's sufficient. I had 3 HD 5fps feeds going to a Pi 3 for a while, and it worked fine.
-
ISY and Phillips Hue Integration Step-By-Step (For dummies...like me)
builderb replied to DualBandAid's topic in ISY994
Forgive any errors, I'm writing this from my phone on lunch break. So, bri_inc gets passed as a json object just like bri. It accepts values between -255 and 255. For example, {"bri_inc" : "-50"} will dim the light by about 20% from its current brightness. You can also add a transition time, similar to a ramp rate in Insteon. You could use {"bri_inc" : "-50", "transition_time" : "300"} to have the change in brightness occur over 5 minutes (300 seconds). Effects work similarly, in that it also gets passed as a json object, accepting none and colorloop as arguments. For example, {"effect" : "colorloop"} will start the bulb running through all the colors. Use a transition_time argument here to speed up or slow down the process. Replace "effect" with "alert", and "colorloop" with "select", and the light will blink in its current state. To create a group, send a POST command to /api/<username>/groups/: { "name" : "<groupname>", "lights" : ["1", "5", "3"] } To find the group id number, send a GET command to /api/<username>/groups/. To modify a group, send a PUT command to /api/<username>/groups/<group_id_number>/: { "name" : "<groupname>", "lights" : ["1", "5", "3", "4"] } This would add Light #4 to the newly created group. Omit lights you way to remove from the group from the list. To delete a group, send a DELETE command to /api/<usernames>/groups/<group_id_number>/. -
ISY and Phillips Hue Integration Step-By-Step (For dummies...like me)
builderb replied to DualBandAid's topic in ISY994
Nice, well written resource. I'd suggest adding a part on how you actually go about creating groups, and adding and subtracting from them, as it's not well documented in the Hue API pages. Also, I didn't see any mention of the 'bri_inc' command which allows dimming and brightening. Finally, just for fun, I'd add in a bit on using effects. Both matching and offset color loop effects are quite popular in my house. -
I actually don't right now because I want it to run some programs when power returns so that I know things like my fish tank light are on. I may change this if I can get my UPS notifications pushed to the ISY somehow. On the to-do list.
-
Oh yes, enabling and disabling programs is quite powerful. I use it all the time. Using folder conditions is another really useful way to change from one program setup to another. A couple of things still on my agenda for these fan setups: using variables in place of the set points in my auto-on programs so that I can shift the set points to different values for home / away / summer / winter / morning / evening, etc. with a simple program. For instance, I'd still like them to come on when I'm not home, but probably at a couple degrees higher than when I'm home. The living room has a wood-burning stove, so during the winter I'd like the low speed to come on pretty early, and stay that way no matter how warm the LR gets. Changing those set points via variable will be much easier (and less confusing later on) than writing separate programs, or using folders. Also, I still need to figure out how best to implement a delay after an automatic state change, to avoid situations where the temperature is fluctuating just at the set point threshold, causing the fans to switch states every minute or so. I figure if the auto-on changes the fan state, it should wait at least 5-10 minutes before it will allow another change. I haven't done this yet because I suspect the solution will involve re-writing my programs to involve integer variables and state variables (yet another useful way to be selective about when programs run).
-
I'm not actually tracking manual vs. automatic modes. It would be relatively easy to have the button press change a variable too though, then have the timer change it back. You might even consider using an 8-button KPL, put the fan controls on the bottom four, and use one of the spare keys as an indicator / controller of the manual / auto distinction. Personally I don't really like the 8-button design, since it's not very intuitive to non-trained users. But, it's an option. I'm also more of a set-it-and-forget-it kind of guy. I'd rather fine tune the temperature set points for the fan and the length of the timer to where I'm not needing to worry about whether it's in manual or automatic mode. My first guesses for set points were not the best, but after some consultation with the family (and a notepad for tracking times when anyone felt too hot and needed to adjust the fan, which I could later check my temperature database to see what the temperature was when a complaint was registered), we rarely need the manual control. All I need to know is that within an hour of someone messing with the fan, it'll be back to normal. Now, with my speechifying done, here's some code. I'm no professional, and there's likely plenty of room for improvement, but this is a working system. I do have the four fan control buttons set up as mutually exclusive, per the guide here. I also have scenes set up with the four KPL fan control buttons as responders that I use to keep the buttons in sync with the fan motor speed. I have four programs that set the fan speed based on temperature, Fan Auto [High:Medium:Low:Off]. Then, I have a Fan Auto Disable on Press program that disables the four programs that set the fan speed based on temperature, waits, then enables them. I also have a Fan Auto Enable Disable program with no condition that I can call from a program to enable and disable the system (I'd tie this to your manual control plans). Fan Auto Disable on Press: Fan Auto Disable on Press - [ID 009A][Parent 0090] If Control (Old) 'LR-CeilingFan-Off' is switched On Or Control (Old) 'LR-CeilingFan-Low' is switched On Or Control (Old) 'LR-CeilingFan-Medium' is switched On Or Control (Old) 'LR-CeilingFan-High' is switched On Then Disable Program 'Fan Auto Off' Disable Program 'Fan Auto Low' Disable Program 'Fan Auto Medium' Disable Program 'Fan Auto High' Wait 1 hours Enable Program 'Fan Auto Off' Enable Program 'Fan Auto Low' Enable Program 'Fan Auto Medium' Enable Program 'Fan Auto High' Else - No Actions - (To add one, press 'Action') And here's the Enable Disable one: Fan Auto Enable Disable - [ID 0099][Parent 0090] If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Enable Program 'Fan Auto Off' Enable Program 'Fan Auto Low' Enable Program 'Fan Auto Medium' Enable Program 'Fan Auto High' Else Disable Program 'Fan Auto Off' Disable Program 'Fan Auto Low' Disable Program 'Fan Auto Medium' Disable Program 'Fan Auto High' One last note that probably won't apply to you, but I have a Hue bulb in the ceiling fan. This was something of a challenge, since you do not want to dim fan bulb with a Hue bulb in it. Plus you want the Hue bulb powered all the time. So, rather than using a scene to control the power supply of the FanLinc, I use the on/off buttons on my KPL to send a resource command to turn the Hue bulb on and off. Because of this, I used the fast on and fast off control commands to actually turn off the power to the FanLinc light if I needed to. Hope some of this is helpful! Let me know if you have any questions.
-
Hey no problem, happy to toss out ideas. My main goal is to make the automation features of my house invisible to most users. Thus, I care less about whether the fan is being controlled manually or automatically, and more about whether it's doing what the user expects. I also try to make it so a total stranger would be able to operate the expected basics without instruction (including the entertainment system). I try to keep those goals in mind as I plan my automation setup. I actually use the same concept with my motion detection lights too. For the most part, the motion sensor controls the light. But if someone manually turns it on or off, I assume they are doing so for a reason. The timer is my way of ensuring automated control resumes after an appropriate interval without any human interaction.
-
For my own setup, I automated the ceiling fans with temperature sensors, but made it so that pressing any of the buttons to change the fan state caused an override of the automated temperature control for a set time period. For instance, my living room fan has a 1 hour override if you manually select a button. The bedroom I set for 4 hours, on the theory that if you're sick, that's where you'll be.
-
If you find hex values like these, use the GC iConvert app to translate them into usable strings.
-
There are sites that post IR codes so you can just copy and paste them. I got all my Onkyo receiver commands that way. Search for 'discrete IR codes' online.
-
Click on the resource in question, the test button should become available.
-
When you test the resource in the network module, what response do you get?
-
Make sure you get the mutually exclusive button control set right too. I remember that causing me trouble during setup.
-
The hardest part of ZM is finding the stream addresses for your cameras, although if all your cameras are the same, if you do it once, you're good. This was an invaluable resource in stream-hunting. http://www.ispyconnect.com/sources.aspx Let me know how it goes, and what hardware you end up using.