top | item 21373931

Ask HN: What do you automate in your life and work?

244 points| gcj | 6 years ago | reply

Just curious about scripts and things you guys have automated

192 comments

order
[+] acidburnNSA|6 years ago|reply
Lots of home automation fun with Home Assistant (https://www.home-assistant.io)

* Self-hosted security system that e-mails me when triggered. It arms when everyone disconnects from the wifi and disarms when anyone in the home reconnects to wifi. Totally passive. Also arms at night when the kitchen lights have been out for 5 minutes after a certain time and disarms when motion patterns that can only be someone waking up are sensed.

* E-mails work and personal when smoke alarm goes off or when water is detected in basement

* E-mails pic from front door camera when doorbell pressed (yeah, like Ring, but with a ESP8266 monitoring my normal doorbell)

* Voice reminder on garbage day

* Northern loon call exactly at each sunset

* Ambient jungle noises and lights on when I wake up and it sees me

* Laundry timer + reminders

* Vacation mode random lights on/off

* Plays a Ship's bell chime on the hour, but only during daytime (ambiance)

* Tones when any outside door in the house opens. Optionally: random Seinfeld bass transitions

* Alert for power outage

* Alert if my mom's house temperature goes too low in winter when she's away (I've called the plumber to fix the furnace thanks to this)

* Turn on A/C if temperature above threshold at 4:00pm in anticipation of my return from work

Stuff like that. Loads of fun. Lots of fiddling.

[+] Balgair|6 years ago|reply
> Tones when any outside door in the house opens. Optionally: random Seinfeld bass transitions

Dear Lord yes, that is FUN! I'd love to see 'walk up music' like in MLB, but for anyone and changing randomly from time to time.

[+] zantana|6 years ago|reply
I like the your ambient noise approach. What are you using for sounds do you have your config online?

I am looking to make my house more reactive as well. One area where HA has been a godsend was integration with TV/Music/idle off. Whereas there wasn't one solution which would shut off the TV and stereo in my set up once they were in Harmony Hub I could add idle timeouts for them in HA.

Another was theater lighting when the TV starts. In the theme of ambience I am looking at switching the lights to something more colorful when paused.

[+] j7ake|6 years ago|reply
Sounds great. So do you need one raspberry pi per automation ? Or are you somehow linking all these diverse processes with one raspberry pi ?
[+] machiaweliczny|6 years ago|reply
Could you recommend some resources to get skilled with such suff? Also what tech stack you are using? (both hardware and software)
[+] deskamess|6 years ago|reply
Care to elaborate on the loon call!
[+] mister_hn|6 years ago|reply
Interesting, although I don't have the amount of time required to do these things.
[+] buzzerbetrayed|6 years ago|reply
Wow that is really impressive. Home assistant is something I’ve been meaning to get in to for a while, but the amount of time it seems like it would take to set all that up and maintain it seems daunting. Sounds fun though!
[+] lardissone|6 years ago|reply
Can you elaborate on the doorbell? Also where do you host your Home Assistant setup?
[+] swah|6 years ago|reply
Do you have a power adapter for the doorbell monitoring ESP?
[+] teekno|6 years ago|reply
> Ambient jungle noises

I like this.

[+] schappim|6 years ago|reply
Example 1 (custom hardware).

My wife and I run https://littlebird.com.au and ship 25K orders per year. We found that it was taking too long to fulfil each order using Australia Post.

So I built our own custom WebUSB postage scales and label printer. Creating a consignment is now 1-click.

This enabled us to take the fulfillment process down from 5 minutes to 5 seconds. Across 25K parcels this equals 11-months of work time.

Being a WebUSB based solution, they "just work" with anything running the Blink rendering engine, even Android phones.

You can see the WebUSB Scales and Label Printer in action here:

(30 sec video) https://vimeo.com/334547755/c387957a25

Longer demo:

https://vimeo.com/334563934/915a25eedc

Shopify liked the demo and I got to demo it to their CEO and various teams in Ottawa.

The minimum order quantities on the Postage Scale hardware was 100 units, so let me know if you'd like one :)

Example 2:

I've automated the lodgement of "Australia Post Inquiries" to get a refund when they miss their SLAs. The numbers add up quick over a year.

[+] radicalriddler|6 years ago|reply
Damn, I attended one of your Raspberry Pi workshops in Mount Kuring-gai about 3 years ago.

Unless I'm completely mistaken, who knows.

[+] barbs|6 years ago|reply
Excellent! Love the name - Checkout Chick :). Perfectly suits the little bird brand as well!
[+] joshschreuder|6 years ago|reply
Very cool.

I like the auto-lodgement, wonder if anyone's made an auto-lodgement for when Metro misses their monthly train SLAs :D

[+] geocrasher|6 years ago|reply
My typing. In my work I tend to type a lot of the same things over and over again. So I automate that with AutoHotKey. Ctrl+Tab becomes RightAlt. Two words become entire paragraphs. Even simple things like "You're welcome" are just 'ywyw' or 'tyvm' becomes "Thank you very much". I know it sounds silly, but while trying to avoid RSI's, the less typing the better.

I also use autohotkey to help me remember to Linux commands that I don't remember of are awkward to type. Like 'awk1' becomes "awk '{print $1 }'" and then I can modify it as needed.

This has worked extremely well for me for many years. Ymmv.

[+] rolleiflex|6 years ago|reply
I wonder if it would be possible to build an app that's effectively a self-installed keylogger given access to your entire stream of writing, and after a few days, it starts to recommend candidate strings for automation with Autohotkey.
[+] SN76477|6 years ago|reply
Autohotkey doesn’t get enough attention. Great software.
[+] tomjuggler|6 years ago|reply
Are you using wsl because AutoHotkey doesn't work on Linux...

Back when I was on Windows I used to have ctrl-c, ctrl-v mapped to F1 and F2 keys (using AHK). Why they don't have dedicated keys I don't know

[+] gorgoiler|6 years ago|reply
I have a folder on my mail server called “Dead”. If I move an email to that folder then all subsequent emails to the same address as the first one go into “Dead/Match”. It’s driven by procmail and a script.

When used with one-off email addresses you get a behavior that’s like unsubscribing, but without having to trust any “unsubscribe” links or processes, and also without having to edit any config files (it’s all driven from iOS Mail.)

1/ book your hotel using the email address $RANDOM@yourdomain

2/ receive booking conformation and enjoy holiday

3/ when you eventually get marketing spam, file it in Dead and never be bothered again.

[+] kdbg|6 years ago|reply
This might sound a little-bit stupid, but I automate locking/unlocking internet access on my phone and computer.

That is to say, every night my computers and phone will lock me out[0] at a set time. Then in the morning I have to log 30 minutes of exercise (tracked by my heartrate on fitbit) to unlock internet access.

I also have certain time-wasting sites like Reddit and Netflix locked out until I complete a sufficiently difficult problem on leetcode, projecteuler, or wechall

---

I was just finding it hard to keep myself going to bed at a decent hour when I have no constraints like a 9-5 job and to keep an exercise routine going. So this automation has helped me.

[0] My computers are basically totally locked, my phone keeps the phone, messaging, camera, and skype accessible

[+] nestorherre|6 years ago|reply
What do you use to lock/unlock your gadgets?
[+] girishso|6 years ago|reply
Interesting. Might be useful to me as well. What software(s) do you use for this?
[+] zakn|6 years ago|reply
Shopping for groceries. I made a website which lets my wife and I pick recipes and any "one off" items we need for the week. The code figures out which ingredients it should buy (preferring organic / sale items) and then calls the "APIs" of our local grocery store's website to make the purchase. We then just have to pick up the pre-packed groceries on our way home from work.

It costs $5 for the packing service, but it's worth it to avoid the burden of shopping. No more tedious math on which is the better deal. No getting lost trying to find avocado oil. And no lines. I wish I had done this years ago.

[+] Retric|6 years ago|reply
There are plenty of other ways to do this, but...

I have a CC specifically for reoccurring bills. It’s automatically paid off every month and just by looking at that one debit it’s easy to notice if something odd happens and then track down what changed. Plus by adding it all together I tend to trim what services I keep paying for.

[+] rsync|6 years ago|reply
I use cron to send myself birthday reminder emails:

  0 0 9 11 *      /usr/bin/mail -s "REMINDER: Nov 9 is Marks birthday" [email protected]
Or just annual reminders or warnings I want to heed:

  0 0 1 8 *       /usr/bin/mail -s "REMINDER: MAKE christmas St. Francis reservations NOW for good pricing..." [email protected]
Sometimes, instead of /usr/bin/mail, I use 'smsme' which is a small script that interfaces with twilio:

  /usr/local/bin/curl -X POST -d "Body=$msg" -d "From=$from" -d "To=$to" "https://api.twilio.com/2010-04-01/Accounts/$accountsid/Messages" -u "$accountsid:$authtoken"
(that's not the entire script, but you get the idea)
[+] xyst|6 years ago|reply
What’s wrong with reminder apps that are default with all smart phones?
[+] erikhayton|6 years ago|reply
I automate most things I do more than a dozen times.

Marketing for my wife's uncle was a pain, so we automated CL and FB posts to fire from Quickbooks Inventory on a schedule.

I'm full-time remote, so I have a spreadsheet that tracks my expenses from a google form, does currency conversions for my location and forex analysis to tell me the best day to pull money from an ATM, tells me how much I have to spend on food each morning...

There's a script I send quotes I like to, and it randomly sends me one from the list via Telegram every day at 6am.

I'm also a swing-trader who hates staring at charts, so my watchlist generates via news and sentiment, then I run TA on that watchlist to send me alerts if a signal is generated, then all I have to do is hit buy/sell on my inline keyboard and it sends off a market order; it auto-exits after a target or stop loss is hit.

Recently formed an agency with a few other automation devs who do similar stuff if you want to check it out: https://weautomatestuff.com

[+] 1zael|6 years ago|reply
Back when Tinder's API was more open, I had a Python script that would autoswipe everyone in the match queue. Then I'd go through all my matches, manually filter the ones I didn't like, and message the ones I did.

It was highly efficient, increased my conversation rate, but didn't really impact my end metrics ;)

[+] todd3834|6 years ago|reply
I live in a condo complex with a dog and no lawn. We learned after getting our dog that this place doesn’t want dogs going to the bathroom on any of the common area (makes sense but annoying to dog owners). We used to get a small patch of grass delivered every week but it was a hassle to swap each time. Also it was disgusting by the end of the week. Then I discovered porch potty. Got the version that is hooked up with a sprinkler system and a drain. Set up an auto timer so it gets completely flushed every night. Saves us a bunch of money and time. Highly recommend. https://www.porchpotty.com/
[+] shostack|6 years ago|reply
Nothing fancy or involved at all, but in my personal finance spreadsheet, I dynamically pull in Zillow's current estimate of my home value (which I take with a grain of salt obviously).

I also use IFTTT to pause my robovac if my doorbell rings.

Right now I'm working on a Mint scraper to automate the rest of my personal finance data entry, but running into headaches getting Selenium to work properly on Catalina.

[+] jmcqk6|6 years ago|reply
Do you need to scrape Mint when it's just using Plaid?
[+] fudged71|6 years ago|reply
There appears to already be a mint scraper on github
[+] erichocean|6 years ago|reply
Puppeteer is way better for scraping.
[+] gandalfgeek|6 years ago|reply
Not exactly a script, but if I really think about it the largest thing I've automated in my life is investing--- via index funds. No picking individual stocks, no rebalancing (Vanguard and others have "target date" funds that rebalance automatically).
[+] shostack|6 years ago|reply
If I recall, target date funds have taken quite a bit of flack for their fee-adjusted performance compared to a minimalist simple 2 or 3 fund fund portfolio approach.
[+] JMTQp8lwXL|6 years ago|reply
This is the smallest thing that will have the biggest impact on your life significantly decades from now. I like phrase "pay yourself first".
[+] buffaloo|6 years ago|reply
Don’t you just end up with a portfolio weighted with half below average stocks? Seems like you could beat this just by buying stuff you’ve heard of. I’m sitting her with my Apple phone, using Verizon internet, burning electricity from a publicly traded utility that probably won’t go broke next week, wearing my Nike shoes and drinking a Coke. That portfolio probably beats your index and requires zero brains or effort.
[+] anotherevan|6 years ago|reply
I read a lot of articles by saving them to Pocket and reading via my ereader. I wrote a little PHP browser based application that interfaces with the Pocket and hn.algolia.com APIs that helps me to follow up on articles in related forums such as Hacker News and track my reading habits.

Naturally I called it Pocket Lint.

[+] Antoninus|6 years ago|reply
Hire a cleaner once every 10-11 days to clean my apartment and do the laundry. Its surprising how much time you have if you don’t have to do dishes.
[+] lostcolony|6 years ago|reply
How do you not do the dishes for 10+ days?

That said, my wife and I do the same thing. Plus have a Roomba. All told it means everything stays clean and we're only on the hook for laundry.

[+] throw03172019|6 years ago|reply
My house is a mess after a week. How’d you come up with 10-11 days?
[+] kevinsundar|6 years ago|reply
What's the pricing like for something like this? Do you use a large service for this?
[+] majewsky|6 years ago|reply
[Not really automation, but I'm hijacking the opportunity to tell the story.]

I'm a terrible morning person and I noticed that I need much longer to get up and dressed and everything than it reasonably should take. On the order of "taking 1 hour to do stuff that can be done in 15 minutes". I seem to have ADHD (disclaimer: not formally diagnosed, just going off of symptom lists and descriptions from other people), and that in combination with morning drowsiness seems to make me really ineffective at this point.

So I wrote down a list of all the things that I need to do in the morning, together with an upper estimate of how long this is going to take. Think something like this:

  { "tasks": [
    { "label": "Make the bed", "duration": "60s" },
    { "label": "Morning wash", "duration": "3m" },
    { "label": "Get dressed", "duration": "2m" },
    ...
  ]}
I built an application for my desktop PC that just runs down this playbook and always shows the current task, together with a timer for the current task as well as the overall playbook, in comically large fonts to fill the screen:

  PREPARE BREAKFAST

  Current: 04:45/05:00
  Total: 16:45/59:30
There is no "Pause" button, only "Skip" for when a task is shorted than the alloted time. Also, the application can beep to signal "3-2-1-Over" at the end of each task, and each task can have a configurable beeping interval. The whole point of the system is to be breathing down my neck to stop me from procrastinating, and it works perfectly in that regard.

Since starting with this tool a few weeks ago, my morning routine has gotten a bit shorter, but I also get more stuff done at the same time. I have a slot for meditation, so I'm now doing that semi-regularly in the morning. (I still skip it too often. Maybe I should make that task unskippable.) I have a slot for preparing a packed lunch, so I don't have to eat out as much and save some money in the process. With the time saved, I've switched my commute from tram to walking. I'm still tweaking the playbook here and there, but it already feels great to arrive at work in the morning knowing that I've already done several positive things for my well-being, rather than the bare minimum as it used to be.

[+] gield|6 years ago|reply
I need this in my life. Is the source code public somewhere, or can you make it public?
[+] laurentdc|6 years ago|reply
I use a 20 line Python script to convert Outlook .ics calendars into billable hour count. It looks for a company name (the client) and calculates start and end time. All it needs now is to fill a .pdf invoice template and I can get rid of HR :D