The second thing you can do is have set hours ... doesn't mean you force yourself to be up at 9am ... but do make it regular, even if it is from 12pm to 3pm (or whatever) take it seriously. No TV (can't stress this enough), no running to the store, or the post office to take care of that quick thing.
Those two things really helped me a lot, hope it helps you out too.
This is something you learn to manage. The fuzzy line is there whether or not you work from home. If you are a programmer or other IT type you probably already have the ability to do _some_ work from home and possibly have to be on-call sometimes (or all the time -- which I've done before).
Even when working on call, or doing some work from home, you can still maintain the mindset, "This is my home. I'm at home now. Work can't touch me here." I have tried to maintain that separation while working mostly from home -- by even physically removing myself from my office outside work hours -- but, over a long period of time, I can't help but feel my personal life is my work. I can never fully separate myself from where I normally work.
However, it's not fair to say that everyone will have the same experience, there are a lot of factors: work load, expected duties, office communication, and even your office layout -- I was worn down the most when I didn't have a dedicated office. Personally, I can't wait to get back to an office setting.
I've tried to remain positive -- and have for the most part -- but after time, and especially when I have projects at work accumulating, it's extremely easy to feel trapped at work/home.
I'm not a naturally social person, so without being forced to interact with other people by work I'll tend to only talk to my wife and the daily Skype meeting with colleagues in the office.
That's probably not healthy.