Progress on the green sprinkler system project!

I have made some progress on the green sprinkler system project.   I even shot some video recently!!!

 

Here is some testing of the water quality…. WHO PEED IN MY BARREL!!

 

Now for the big update!!! Built a battery from recycled 18650 laptop cells.  Hooked it to my pump.  Drained my rain barrel!!  Then charged the battery back up via solar!!!

Man I am feeling kind of green!

Like this guy?

Oh and I am the one that peed in your barrel

Oh %^&* you’re back too huh.

You do realize I am you, you are me right?

Man I had a long night last night.  Don’t do that deep %^&* on me.

Ok Ok.  Check out his (my video)

Time lapse in new printer enclosure

surprised-rainbow-faceSo awhile back I came across an instructables article regarding using some ikea lack tables to make a 3dprinter enclosure…..

I love ikea….

So this was the project.  http://www.instructables.com/id/3d-Printer-Enclosure-from-Upcycled-Furniture/

I went to ikea.  Got 2 lack tables and put them together…. I want my printer higher up.  ELEVATE TO THE LEVEL OF THE GODS!!! no.  just high enough I can watch it cause I like to watch it go back and forth while I make printer noises.

So I ordered a 3rd table.  Put it on top.  Sweet.  Much better.  I moved the printer into the enclosure this weekend (no sides put on it yet) and decided I needed to get the lighting in place.  So I took some neopixel strips I had laying around and hooked them up to an arduino.

13694706_1455593267790887_1215760066_nOk, so that’s now how I am leaving it 🙂  but it did look cool.   Now I can set the colors.  Plain white for printing.  I am trying to figure out how in octoprint to get a hook in to detect when it’s heating up.  That way I can turn the lights orange or red to indicate heating phase.

 

 

So I did a timelapse and a vid.   The vid of the whole rig setup

Here is the timelapse test print

 

I am working more on trying to get some good photo and video in with these projects too.  If you like the videos give a thumbs up and a subscribe.

Who’s That? What’s That? CCTV setup

Hello Hello again.   Recently I was chiming in on a thread on reddit regarding CCTV.  I mentioned how my cameras/cctv is setup.  Then I thought.

light-bulb-momentHey, you know would like to know this?

EVERYONE!!!!

 

 

Really.  Conversation totally happened in my head.  Told you Doctors it’s not too crowded up there.

Let’s begin!!

This all really started because of my 3dprinter…..

“How…. Huh…. But you…..”  I hear you saying it.  It makes no sense.  But Ill fix that little red wagon.

Aerial_Vista_Security_Camera_preview_featuredI love searching around on thingiverse.com it’s actually part of my daily sites to check.   So I came across this thing.   It’s a security enclosure for a raspberry pi and pi camera… WHAT?!?!?!

I know.  I thought the same thing.  I need that…..   So I started printing the parts.

2016-03-18 07.09.022016-03-18 07.48.26

Once I had it printed, I threw in my pi camera (NOIR).  The NOIR made it even better for being a security camera.  Ok, so cool.  How about software?

I was looking for some super simple camera software as there are tons of “security” camera projects out there for the pi.  I came across this one “MotionEyeOS.”   58732063Being built off the program Motion I decided to get in and test it out.  Flash the SD card and boot it up, gets an IP.   I just checked my dhcp leases on the router to find the ip, then gave it a static IP.

 

Once you have the IP just throw that ish in the browser!!  Configure your network settings ect.  But in the expert settings there is a switch.  Turn it on.

 

No seriously.  Turn it on.

2016-06-16 15_38_25-iseeall.noip.me - Remote Desktop Connection Manager v2.7

Yes I know.  The fast network camera page on the wiki looks like it kills alot of stuff.

 

The Differences

When you have Fast Network Camera enabled, you’ll notice that:

  • your motionEyeOS-based camera can reach a significantly higher frame rate, at a higher resolution
  • you can tweak many CSI camera-specific parameters directly from the UI
  • your browser will eat up less CPU at the same frame rate/resolution (it uses a pure MJPEG stream, rather than triggering every refresh from JavaScript)

On the other hand, this doesn’t come without some disadvantages:

  • no more motion detection
  • no more motion notifications
  • no more pictures or movies
  • no more overlaid text (date/time, camera name)
  • a significantly higher network bandwidth usage
  • you’ll need to forward port 8081 as well, if you want to access your camera from the Internet

 

No motion detection!?!?!   Are you crazy that’s why I am even reading this stupid page!!!!!!

 

EcstaticTightBuckeyebutterfly-size_restrictedCalm down.   Please calm down.  Can you even use that as a weapon?!?!   

Just let me finish before you use that thing!!!

So you enable fast network camera.  This lets you get some faster higher quality out of the camera.  Now here is the fun part.

I setup a VM of ubuntu and installed MotionEye.  Not MotionEyeOS but MotionEye.

BeQZIS7CEAAemgwOnce you have it running hit your motioneye server (http://<motioneyeserverip:8765)  and you will get another nice web interface.

In here, you will add a new camera, and set it up to point to your raspberry pi camera.

camsettingNow what is really cool here is you can setup a few cameras.  When I first set it up, I had 1 camera and then I found 9 traffic cameras and marina cams and what not from places all over the world and was able to plug them in.  Truly felt like a super villain being able to see everything!

Now that you have your cameras in motioneye we can now use the motion eye server to handle our motion detection.  See, I told you I would get there.

There are some cool setting here that you can do.  For example:

settings1

settings2

 

 

 

 

 

 

  • I have my video streaming setup so I can embed individual streams if I want into a web page, maybe a security camera sitemap page in openhab?
  • I have still images setup and capture when motion is detected.
  • I have Motion Detection configured that more than 5% of the frame has to change.
  • Then the fun part in Motion Notifications

I have a script configured on motion detection.


/usr/bin/notifycam.sh %t


This script is very simple.  It has 2 lines currently.  I honestly could knock it down to one.   Or I could add some additional code to handle different items for each camera.  The %t just passes in the camera ID.
57448311Ill go over that in a minute…. I SAID IN A MINUTE!!!!!!

On my Kodi media system in my office I installed this great add in called

Security Camera Overlay

It’s a very interesting add in.  You configure it for your security camera.  Well, I have mine connected to motioneye.

2016-06-16 20_46_26-ubuntudev1In MotionEye if you click on the Streaming Video there is a link in there called “Snapshot URL”

2016-06-16 20_48_34-KodiGrab that, you will need it to configure your Kodi system.

Put that snapshot URL in the Image URL field when configuring your add on.

 

 

 

 

2016-06-16 20_48_22-KodiOn the Behaviors tab, if your camera supports 16×9 I definitely recommend changing the Window width/height.  I have it refresh every half second and auto close after 4 seconds.

 

 

2016-06-16 20_37_41-KodiSo what does this look like?  LIKE THIS FOOL!!!!

It pops up right over Bob’s Burgers!!! refreshes a few times, let’s me see what’s going on and slides right back off.

 

Back to the script


/usr/bin/curl -g "http://xx.xx.xx.xx:8080/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22method%22:%22Addons.ExecuteAddon%22,%22params%22:{%22addonid%22:%22script.securitycam%22},%22id%22:%221%22})"
/usr/bin/curl --header "Content-Type: text/plain" --request POST --data "ON" http://xx.xx.xx.xx:8080/rest/items/PorchMotionDetected

Explanation:

Line1: sends a json packet to my Kodi install in my office telling activating the great addon Security Camera Overlay.  This makes it slide over whatever you are watching.

Line2: sends a “motion detected” packet to openhab.  In my openhab Items file there is a simple switch I can add all my rules around.

downloadIn writing this I learned something today.  I am going to make a couple modifications in the future.

The notifycam.sh file will be adjusted down to 1 line.

It will just make the call to openhab.

But it will look something like

<pre>/usr/bin/curl --header "Content-Type: text/plain" --request POST --data "ON" http://xx.xx.xx.xx:8080/rest/items/CameraMotion%1

That way I don’t have to recode the script when I add a camera. I just need to add a new item CameraMotion<ID> to openhab.

Then I can add all the camera’s to a gSecurityCam group and build some rules around state change in that group. Then openhab can send out the notifcations to pop up the stuff on my kodi and any other kodi system I wish, as well as send me notices through other openhab notifcations.

I hope this was long enough for you…

 

 

OpenHab Wall Switch

So recently I started thinking about my HA system when I have guests.  I have a small house (not a tiny house) just a small house.  When my parents visit they setup camp in the living room.

vYtvpWpWorking on getting PIR motion sensors to turn things on and off.  But with guests, I need a guest mode to disable the motion sensor…. and not because I tend to dance in front of the motion sensors.

 

 

89b1c00006954836a703dfc0457c8626But with the motion sensors disabled.  There still needs to be a way for the folks to control the lights.  So I started thinking.

What I came up with was physical buttons, pass something to mqtt, then to openhab.  Openhab rule to control “group” of lights aka living room.

So time to start proto typing some things.  First I wanted to see if I could somehow make it work without putting holes in the wall.   WAF = 10 on that one.

2016-06-12 17.31.52So I started by 3d printing a light switch blank panel.  It’s a rough print, but needed to see if I could make it deep enough to put some triple A batteries to run it.

Once I tested some depth I was happy.

Frank-GrimesNext to build build some electronics.

 

So I broke out the good old arduino uno.  This is my go to for initial builds even though I usually end up with a pro mini in the end.  The uno is a great test bed.

So it started out with Uno + Ethernet Sheild + 2 buttons.

2016-06-12 12.53.39-2

 

I ended up adding just a notifcation LED just so I know once it’s connected to MQTT since I am not watching via serial monitor now.   2016-06-12 17.34.42So what does this get us now?  Well.  It boots up.  You press one button, all the lights in the living room turn on.  Press the other and they turn off.  I know what you’re thinking.  So what?

One of the lights is a phillip hue light.  The other is controlled via z-wave.  So how did I do this.  Lets start with the item definitions in openhab.

//Group Definition
Group gLivingRoomLights

//Items
Switch Switch_LivingRoomStandingLight "Living Room Light"     <light> (gLivingRoomLights,gDashboard) { zwave="2:command=switch_binary" }
Switch LivingRoomTableLight   "Living bulb" (gLivingRoomLights,Switching) {hue="1"}

//Dummy ITEM that is set via mqtt
Switch LivingRoomLights "Living Room Lights" {mqtt="<[mqtt:switches/livingroomlights:state:default]"}

So in my items file, I have the 2 light items and a dummy switch.  Notice the 2 light items are in the “gLivingRoomLights” group.  This is important.

Now for the rules.


rule "Living Room Lights"

when
Item LivingRoomLights changed
then
if(LivingRoomLights.state==ON)
{
gLivingRoomLights.sendCommand(ON)
logInfo("All Living Room Lights","ON")
}
else
{
logInfo("All Living Room Lights","OFF")
gLivingRoomLights.sendCommand(OFF)
//off
}
end

So this rule is triggered when the Dummy Switch (LivingRoomLights) changes.  If the state was changed to ON then i send the “ON” command to the entire group.  Same for when I turn it off.  So to test it I used mqtt-spy and manually did it.  All is working.

k16232506

What’s next is I am going to work on shrinking said project down to using an arduino pro mini, 2 AAA batteries.  For the network transmission I am back and forth between 2 options.

  1.  esp8266 – using the esp is great, but it’s not very forgiving on power.   I know there are deep sleep modes, but they aren’t really good for what I need with multiple buttons.
  2. nrf24l01 – RF modules.  These little suckers are really easy on the power.  If I use these I have to build a rf->ethernet bridge.  But with these I think the power consumption is much simpler.

Either option I go with, I can use a pro mini and have 2 interrupts I can attach to buttons.

Down the road if I need more buttons, I can use a pro micro and get something like 14 interrupts and still be able to use deep sleep.

iphone-battery-iconIf I wanted to cut holes in the wall and run cable I wouldn’t be as concerned with the battery levels.

 

 

 

Want to see it being tested?

 

 

Find my Sh*T!!! – The lost iphone saga

Ok, we have all done it.  Where the hell is my phone?  Where’s the ipad?   Home alone trying to find it and you have no way of calling it because, well, no land line.

 

A week or so ago I finally replaced my Jurassic period thermostat with something a little newer.  I know, weird right.  I do all this stuff and I had a thermostat that was 1 step above this

old_honeywell_t87

So I got a 2gig CT100 with z-wave.
61cUaIUZOLL._SL1024_

 

 

55553046So as any self respecting geek would do.  As soon as I got it hooked up, I tied it in to my home automation system.

 

So I have basic items configured, mainly so I can see the temps ect.  But there is another thing we can do with this.  Got the idea from the thread

https://community.openhab.org/t/find-my-iphone-from-my-nest/5663

If you look you will see I have contributed and written a simple php service for finding an iphone 🙂

Here is the github for that simple php service https://github.com/brunkj/FindMyIphonePHPService
So I have my PHP service setup.  I have my home automation system.  I have my z-wave thermostat.  I have rythm.  I have style..  $%^& what’s wrong with me…..

So I created a simple rule


rule "Find iPhone via thermostat"
  when
    Item HVAC_CoolSetPoint changed to 69
  then
    sendHttpGetRequest("http://xx.xx.xx.xx/findmyiphone/?phone=jason")
    sendCommand(HVAC_CoolSetPoint, 75)
  end

 

Simple description.  Set the thermostat to 69.. hehe hehe 69….  {giggle} 61832143

 

 

 

 

 

 

 

 

Ok, I’m better.  Set to 69.  Openhab sees it’s now set to 69, realizes that’s way out of character and runs the rule “Find iPhone via thermostat” which sends the call to my php service, then sets the temp back to our standard 75.

I am implementing 1 additional rule for 68 degrees for the wife’s phone.

Whole Home Audio Rig

So a while back (let’s not talk about how long ago) I found the site of HazyMat

Multi-zone audio: a discussion of the options

He seemed to have found a great solution for doing some work on whole home audio.  This is something I have been trying to find a good solution for myself.

I decided to test this out myself using the XAP 800.  xap800_l

 

 

 

maxresdefaultI picked this thing up on ebay for $24 bucks.  So I did some testing and was able to do some audio routing via serial port which means I can use Openhab to control the audio matrix.  Not the same matrix.  But as I have shown before, the connectors might be a pain in the butt to try to wire everything up.

ClearOne XAP-800 Professional Audio Conferencing System Pic 4

Screw down terminals are great but not convenient if you have it mounted in a rack.  Which is what I wanted to do with mine.

So how do we make this better?  A patch panel!!!
19-inch_rackmount_Ethernet_switches_and_patch_panels

So I started looking around.  I could do a keystone jack patch panel.  But then doing rca keystone jacks were going to be way more expensive than I wanted to spend.  $24 bucks for the audio rig and Im looking at $100 bucks for the patch panel….. NOPE!

So here is what I decided to do.  Use a 2u blank rack plate.  Like this one.  72621Buddy 069of mine had one laying around.  So far $0.  I know what you are thinking.  “Hey genius you don’t have any holes…..”

 

I know.  I got it.  Relax.  I busted out the blue painters tape and made some markings for the holes.  IMG_0678

 

Now off to the drill press.  Few drillings later we have swiss cheese!!

IMG_0679Had a super cheap pack of RCA jacks show up.

81DOZmuhh9L._SL1500_
Initially I was planning on doing all my cable management through the middle, so I had red on top and black on the bottom.  But then because I had the top and IMG_0687bottom row offset from each other it didn’t make sense.  So I ended up swapping them around.  I then soldered speaker wire to the back of each jack.  It took a while, but it was worth it.  Wired up to the screw terminals I now had a nice pretty panel.

IMG_0937

 

So I wanted to get things labelled up.  But my label maker is junk.  The sticky tape just falls off.  So I could paint.  But then it looks messy.  So then it hit me.  Vinyl!!!

I was able to pick up a craft cutter for super cheap (<$35) and designed up some labels, ordered some white vinyl.

CUT!!!

IMG_0939A little transfer paper and a crooked eye and I now have some much nicer labels.

IMG_0943

 

Now it’s all mounted up in my rack nice and pretty.  I have my main computer in my office routed through the device as an input source, and then my main speakers as an output.  Then a media center raspberry pi routed as another input.  It’s now mixed with the audio from my main computer.  Both computers using the same speakers.

 

Is it hot in here? Home Automation AC addition

So my Super Villain lair is super secretly located in my converted garage… shhhh.

So we found out that Florida is a rough place to be a super villain.  It’s hot here.  So I needed a way to help keep my lair cool.  So many full moons ago my minions held a Staples store for ransom till they gave me an AC unit.
lx_140_set

 

This thing is huge.  It’s a 14000 BTU unit.  I have an exhaust vent that goes up through the ceiling and vents outside.  It is actually pretty good at cooling down my lair.  But it is another AC unit that can use up some power.  Since the Super-Wife is not a fan of paying giant power bills, I have to turn it off when I am not in the office.  This was one reason thy the remote was very handy.  But.  It’s 2016.  Hello!  Just a remote?  That’s it?  HA! Right!

I have worked on trying to automate this thing for awhile.  A while back I used the Arduino Infrared Library to read codes from the remote, and then blast them back out.  But it didn’t work… I thought maybe it was using revolving codes.  Nope.

As it turns out, HVAC units have a tendency with their remotes to not send simple codes like “On”, “Heat”, “Fan-High”, “Temp-Up”  as you might think.  TV’s and even some small wall mounts use basic NEC hex codes.  Not this monstrosity.  No no.  After working on this thing for weeks I found an article that spoke about maybe my buffer size for reading the code wasn’t large enough.  The current RecvBuff was set to 100.  I was filling up all 100 locations.

So I changed it in the IRRemoteInt.h file.  Set it WAY higher.  Turns out my remote was sending 228 pulses.

client-pulse

 

So I decided to try to decode some stuff.  Lets try changing the temp.  228 pulses and most of them are the same.  Turns out my HVAC remote sends FULL state code every time you push a button.  To test this theory.  I set my HVAC to 72 degrees.  Went into a different room with the remote, pressed temp up until I was at 74 degrees.  Back in the office, the display still says 72, remote says 74.  I press up, the HVAC screen jumps straight to 75.  Full state!!  So that’s good to know, but a pain in the ass as I would have to do some SERIOUS work to decode the blocks and find out what changes to what.  But I never really need to do anything other than turn it on and off.  So lets find something simple.

I now have the following arrays of values


unsigned int powerOn[227] = {3400,1700, 450,1250, 450,1300, 450,450, 400,450, 450,450, 450,1250, 450,450, 450,450, 400,1300, 450,1250, 450,450, 450,1250, 450,450, 450,450, 400,1300, 450,1250, 450,450, 450,1250, 450,1300, 450,450, 400,450, 450,1300, 400,450, 450,450, 450,1250, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,1250, 450,450, 450,450, 450,1250, 450,450, 450,450, 400,1300, 450,1250, 500,400, 450,450, 400,450, 450,450, 450,450, 450,400, 450,1300, 450,1250, 450,450, 450,1250, 450,450, 450,450, 400,450, 450,1300, 400,450, 450,450, 450,450, 450,1250, 450,1250, 450,1300, 400,500, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,400, 450,450, 450,450, 400,500, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,400, 450,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 500,400, 400,1300, 450,1250, 450,1300, 400,1300, 450,1250, 450,1300, 400,1300, 450,1250, 500}; // UNKNOWN 3659AD56
unsigned int powerOff[227] = {3400,1700, 450,1250, 450,1300, 400,450, 450,450, 500,400, 450,1250, 450,450, 500,400, 400,1300, 450,1250, 450,450, 450,1250, 450,450, 450,450, 500,1200, 450,1250, 450,450, 450,1250, 450,1300, 400,450, 450,450, 450,1250, 450,450, 500,400, 500,1200, 450,450, 400,450, 450,450, 450,450, 450,450, 450,400, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,450, 400,450, 450,450, 450,1250, 450,450, 450,450, 400,1300, 450,1250, 450,450, 450,450, 450,400, 450,450, 450,450, 400,450, 450,1300, 450,1250, 450,450, 450,1250, 450,450, 450,450, 400,450, 450,1300, 400,450, 450,450, 450,450, 400,1300, 450,1250, 450,1300, 400,450, 450,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,500, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,450, 450,450, 450,400, 450,500, 400,450, 450,450, 400,450, 450,450, 450,450, 400,450, 450,1300, 400,1300, 450,450, 450,1250, 450,1250, 450,1300, 400,1300, 450,1250, 450}; // UNKNOWN 6BF20402

243448-Don-t-Judge-Me.-I-Was-Born-To-Be-Awesome.-Not-PerfectWith those values set in my arduino code I can now turn my AC ON and OFF in my office.  Cool haha, get it?  cool?  Shut up.  Don’t judge me.

 

 

 

 

So I did that work, and that was the end of it.  I didn’t really do anything more with it.  I wanted to figure out a good way of interfacing to it.  Earlier this week I found the following article on the OpenHab community.

MQTT IR transmiter/receiver

This turned out to be just what I needed.   I didn’t even realize I needed this, but it made perfect sense.  In short, use a tiny esp8266 chip with an IR LED and MQTT.

You can get them even cheaper from China.

AliExpress.com Product – 2015 New version 1PCS ESP8266 serial WIFI model ESP-01 Authenticity Guaranteed,Internet of things $1.79 Each.

arduino_dust_sensor_ESP8266-1I had one already laying around…. but where the hell is that tiny bastard!?!?!?!

Like finding a needle in an electronic haystack.  But I found it.

 

 

Threw in the code, built a programming jig for it.  Programmed it and BOOM!!! MQTT messages turning on my AC.  Nice!!!

069But that’s not home automation genius!

I know!

I’m getting there.  Geeze!!! Some freaking people am I right?

So time to hook this up in OpenHab.  I already have an MQTT broker configure in OpenHab for my OwnTracks setup.  So we need an Item created first.  So I setup a new Items file called “HVAC.items”


Switch Office_ac "Office AC" {mqtt="&gt;[mqtt-home:esp8266/02/sender/RAW:command:ON:ON],&gt;[mqtt-home:esp8266/02/sender/RAW:command:OFF:OFF]"}

Next let’s add to the sitemap.


Switch item=Office_ac

f1afa6d8e96b6f69bb5c73776177af24Try to keep up, I know it’s crazy difficult with all those configs and what not..  I need a drink.

Sweet.  Now I have a simple on/off switch for my AC.

……still just a remote jackass.

Really..

 

Really…..

1234931504682 (1)

 

 

 

 

C’mon.  Can’t we be friends?

I mean, you can be pinkie pie.

FANMADE_Pinkie_Pie_and_Rarity_friends_forever

Ok cool.

So for the AUTOMATION part, (I’m not bitter), we create a new rules file.  HVAC.rules


rule "Turn On AC"
when
Time cron "0 17 15 * * ?"
then
Office_ac.sendCommand(ON)
end
rule "Turn off AC"
when
Time cron "0 30 22 * * ?"
then
Office_ac.sendCommand(OFF)
end

So now, each evening around the time I start my crazy battle with traffic home (see here), my AC in my office will turn on then turn off each evening at 10:30.

So where do I go from here?  Well, the next step is to use my previously mentioned OwnTracks setup to see precisely when I leave from work and if I pass through a location which indicates my trip home, it will turn on the AC.  This way, it doesn’t matter if I leave work early or late, my AC will know and have an hour to cool down the Lair before I get home.

 

baby-its-cold-outside-14192655214ng8k

 

 

 

 

 

 

 

 

Traffic (actual cars) Woes

So in the last 2 weeks I have been put to the test of patience and road rage.

giphy

Last week there was a guy that decided to take his dog for a walk on the over pass and decided to stop and contemplate jumping.  This closed down a 3 lane highway and the 2 joining lanes completely in morning rush hour.  Diverted traffic was diverted to a 1 lane exit.  I sat in traffic for 3.5 hours!!!! At that point I called the office and said “i’m working from home, it will take me hours to get there and 30 minutes to get home.”

That was pretty rough.

This past week was obviously not as bad.  But 4 out of 5 days this week my normally 45-50 minute commute was 90 minutes.

So normally I spend 4hrs 10min on the road commuting in the morning and roughly 5 hours in the evenings (traffic gets worse)

But this week was almost 7 hours in the morning and 5 in the evening.

12 hours……

I don’t think you heard…. 12 HOURS!!!!! Just driving!!! It’s stupid.

traffic-zzz

 

Man I could get a lot of work done driving a tesla!

 

 

 

So I had this dream this week, very strange I know, and some of the details I am omitting here because well… some of it was quite sexy…. but that’s not the part I am hiding.  There was another device in my dream that I have thought about making before and in my dream I had it done.  But it had a new feature…. it told me if my drive to work was going to be longer than usual……

I know I know.  “Just watch the news you jackass!”  I can hear you all saying that.  However I cut the cable many many many moons ago.  I don’t get the news.  Two.  Well, my past brain problems have led me to a life where I don’t watch the news often because the news is generally bad and I find myself a much happier well adjusted member of society if I don’t watch the news in the morning.  But I got side tracked.

So after the wife telling me
Untitled

I decided to look into this thing that my brain was hinting at.  So I spent some time looking for mapping/navigation api’s.  I found out that TomTom has one.  Pretty good to, you can tell it what kind of vehicle you have, and if you want traffic to be taken in to account and all kinds of stuff.  So I got an api key and started coding against it.  Pretty neat.  68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f343034323534372f746f6d746f6d2e706e67

But then I found this.  This turned out to be pretty interesting by itself since I currently use a dashing dashboard for a few things internally.

I set it up for myself in dashing and it works nicely.  So we are close, but not quite what I am looking for.

So I decided to keep working, and thinking, and eating chips.

Wait.  No chips.  Just working and thinking.

I decided what I needed was 2 fold.

  1.  Traffic time must be in my Home Automation system so I can create rules based on the time.
  2. The times must be stored somewhere so I can get a new idea of “average” drive time.

I got it.  Create an item in Openhab.  Update said item periodically.  I already have openhab mysql persistance enabled.  This will work.  I will be able to run data reports based on time of day (aka MORNING during the week) and see what the average/no accident drive time is and over time even see how much time an accident add’s to my trip on average.

So now in my openhab I have the following ITEM configured in my home.items file.

Number WorkDriveTime "Drive Time [%s minutes]"

and in my home.sitemap file

 Text item=WorkDriveTime

I have a cronjob that runs every 5 minutes that just fires off a php file to get the tomtom info, convert seconds to minutes, round it off and update openhab.

My simple php file is here.


<?php
$string = file_get_contents("https://api.tomtom.com/routing/1/calculateRoute/28.3852,-81.5639:33.8121,-117.9190/json?routeType=fastest&traffic=true&travelMode=car&key=YOURAPIKEY");
$json = json_decode($string, true);


$DriveTime = round($json["routes"][0]["summary"]["travelTimeInSeconds"]/60);

if ($DriveTime != 0) {
sendOpenHabUpdate("WorkDriveTime",$DriveTime);
}


function sendOpenHabUpdate($item, $data) {
 $openhabserver = "http://192.168.2.90:8080/rest/items/" . $item;
$options = array(
'http' => array(
'header' => "Content-type: text/plain\r\n",
'method' => 'POST',
'content' => (string)$data,
),
);

$context = stream_context_create($options);
$result = file_get_contents($openhabserver, false, $context);

return $result;
}


So with this now running in my crontab I have my database slowly updating with drive times.

Oh. If you want to get a key for TomTom yourself just go to http://developer.tomtom.com/

So what do I have in store for this. Well, there is another value that comes back in this specifically related to “delay from traffic” so I may add this in as another number item to track. But the plan is to know before I leave the house if I should take a regular coffee or a giant coffee to get me through the morning commute. download

Green Sprinkler System Project (part 1)

So I don’t know why, but I have over the last year or so really gotten into doing things with renewable resources (mainly solar).   Well, lets say interested in.  I have a couple of solar panels I play with but nothing crazy.

So one day I get this crazy idea in my head.  I need a rain barrel.   But for idea_lightbulbwhat!?!?!  I had no real need for a Rain Barrel.  But this suddenly consumed me.  I NEEDED a rain barrel.  I checked craigslist and found an ad for someone getting rid of one.  Just needed to pick it up.   DONE!.
Now I had my barrel.  Now we need some water collection.   I looked around.  Rain collection can get expensive.  I saw collection systems over $100!!!!  That was crazy! That’s too much!!!

Much

 

I came across this Instructable – Rain Barrel and Diverter

This was right up my alley.   A couple bucks later I had a bunch of PVC and one saturday (when my step-dad was in town) we threw it together in no time.  Tested it out….  yes, I sprayed my waterhose on the roof to test it.  What’s it to you!?!?  pee_hose

So then when I regained my proper maturity level we waited for a storm.

 

Hahah b%^&*es I live in FL.  It rains like every 17 minutes during the summer.  So that night my son and I being the geniuses we are,  well, he was just following me, went outside with the flashlight to see how our water collection was doing.   Very surprisingly with just one section of gutter we were getting alot of water fast.   Before morning the barrel was full.

Here is what my setup currently looks like.  2015-05-30 18.08.34

 

 

 

 

 

This works surprisingly well.  However, I haven’t gotten to the point.  What am I doing with a 55 gallon drum of water.   Well, nothing…. yet.   Well, we used it a couple times as a sprinkler for the kids over the summer.

IMG_0603I built a little test rig to test out some sprinkler heads, and the kids and dog just ran around in it.   But it worked with my little pump I got from harbor freight.

 

 

image_11850This is the one I have. Water Pump.  I got this little pump specifically for a couple reasons.

  1.  Cheap.  This little guy was 40 bucks.
  2.  12v.   Why does that matter?  Because I want to power it off a 12v battery.

 

I’m sure at this point you are thinking “OK there guy.  So you have a bunch of water, you have a pump that can run off a battery and you have some sprinkler heads.   So what are you getting at…… ”

You hear that?  That was the click of it all coming together.  I am making a self sustaining green sprinkler system.   Rain Barrel to collect the water.   Battery charged from a solar panel to power the pump.  Easy right?  No.  No.  No.

Getting in to researching solar and batteries has forced me to start working on a charge controller circuit for the battery to avoid over charging or over discharging.   Why not buy it?   Harbor Freight has some.  You are right, but I am cheap and just buying stuff would make for this to be a really boring blog.   I would just upload receipts all day.  No spank you.  This is more fun!

IMG_0602So where am I in this whole ordeal?  Well, not as far along as I would like to be.  But I recently was able to test the actual pressure of my pump.  It claims a max of 50psi.  Which is close to the pressure to your house.   But I needed to see some numbers and here they are!  That’s actually higher than I expected considering how rough this pump sounds these days.  I tested a few times and always 30psi or higher.  This is actually really good news.  This means I should have a decent water pressure for my sprinkler heads.   I do not have a large front yard, but I am still looking at 5-6 heads to get the coverage.  In the next week or so I will be modifying my test rig to support 5 heads and see if I can run all 5 or if I need to split it into zones.  I am not opposed to doing the zones split, but it would be easier not to.

 

So that’s where I am.  The plans as I finish this are below.

  • add additional barrels
  • micro-controller to control when to turn on and off the pump
  • that same micro-controller will read a custom sensor I am building to determine water level to report back to my HA system.
  • HA system will handle the scheduling of watering using advanced rules.  ex: is rain expected in the next 12 hours?  has it rained in the last 12 hours?  If either of those, no need to water.   Is there enough water in the tank to run the pump?

 

 

Some projects and upgrades

So I have a few things on order coming from china for some various projects.

I figured since I haven’t posted much lately I will post some pre-project dribble.

Phoenix Connectors – Aliexpress

phoenix connectors I have these coming to be able to connect audio up to my ClearOne XAP800.   ClearOne XAP-800 Professional Audio Conferencing System Pic 4 xap800_l

The XAP800 is going to be added to my Home Automation system to be able to control/mix/route audio from various sources to various destinations.  If you want to read more about what this can do check out my buddy here.

http://hazymat.co.uk/2015/04/multi-room-audio-options/

 

3d Printer Upgrades

Its funny.   The whole time I have had my printer I have been constantly wanting to upgrade.  Maybe because I built my printer from a kit and know each piece.  I look at upgrades thinking, this will help just a tiny bit more.  This will make it a tiny bit better.  But also, I enjoy these projects.  So I have what I can only hope are my last big round of updates.  Nevermind.  I just thought of one more.  Bowden extruder…. but that’s for another post.

Motor Coupler – Aliexpress
The motor coupler is going be to used to connect my 5mm drive shaft to my below 8mm threaded rods.

Lead Screws w/ Copper Nut – Aliexpress
Replacing my current threaded rods and nuts with some nice thick Lead screws and longer copper nuts should add some additional stability and durability in that I won’t have to replace the nuts regularly like I do now.

Aluminum Build Plate – Aliexpress
The aluminum build plate will replace my glass bed.   I have hard it does well for heat distribution but also I need it for the below proximity switch.

Induction Proximity Switch – Amazon
I am going to get rid of current auto level setup.   I am going to the inductive sensor so there is no longer going to be a swinging arm.  This will hopefully improve start up time, and keep better accuracy.

shoppingUT82quJXalbXXagOFbXSReprap-Prusa-i3-3D-printer-parts-Anodized-Aluminum-BUILD-PLATE-for-Heated-Bed-3D-Printer-RepRap.jpg_640x64061fxf9nPCFL._SL1100_

 

Random

20 555 Timers – Aliexpress
ne555I have these 555 timers coming because I plan to use them on a small solar charge controller project I need for my Green Sprinkler system Project.

 

100 Optocouplers – Aliexpress
111781498246_1A couple weeks back I designed and tested a small circuit that will detect when the 12v accessory line in my car is turned on and off.  Using these optocouplers I will be able to use this signal to either power on my raspberry pi in my car, or to tell it to turn off.  This is going to be useful so that the pi doesn’t turn off as soon as I get home, but will be signaled to turn off in about an hour.  This will give enough time for sync jobs to run, backups and any config changes I want to do.

So there it is.  Some of my up coming projects

  • Big Printer upgrade
  • Solar Charge Controller
  • CarPi Power circuit deally (i need a better name)
  • Green Sprinkler System
  • Home Automation Audio Router

juggling-businessman-image

This guys has his shit way more together than I do.  Look at him!  He’s wearing a suit….  I barely wear pants!!!!