My electric blanket is plugged into a z-wave mains adapter and I have a usb stick (z-stick) in my home server which controls my z-wave devices. I have a small bash script to turn it on/off. It's a bit cold this time of year so I like to have my blanket come on a few times as I wake up to give me a bit of a boost. Here are my cron jobs on my home server:
# Weekday morning blanket schedule
# 4 min boost before lighting schedule begins
46 7 * * 1-5 blanket on for 4 minutes &>/dev/null
# 2 min boost before first smart-watch alarm
58 7 * * 1-5 blanket on for 2 minutes &>/dev/null
# 2 min boosts before each subsequent smart-watch alarm
8-38/10 8 * * 1-5 blanket on for 2 minutes &>/dev/null
My main bedroom light bulb is z-wave also. I have a similar system to make the light slowly come on in the morning as I wake up. The cron:
50 7 * * 1-5 for n in $(seq 1 99); do light $n; sleep 30; done; sleep 270; for n in $(seq 98 -1 0); do light $n; sleep 2; done
I also have OpenHab on my server so I can manually control the blanket and lights from both my Android phone and also my Pebble Watch.
Z-Wave or Insteon is the way to go for smarthome. Insteon is really old but very good, the switches can build relationships with one another without a central server. Word of warning, do not buy insteon bulbs, they fail regardless of power grid quality. All their other stuff kicks ass.
If I'm going on holiday or away for a few days or whatever, I disable the cron jobs. If we're just talking the odd day here and there where I'm not at home for random reasons or not following my typical schedule, I don't worry about the waste. The amount of electricity involved is so low, we're talking about pennies.
One approach for those who have Nest thermostats would be to use the Away API to turn things off if you haven't been detected all day (or maybe some other heuristic). That was the only device that I thought of off the top of my head with a presence sensor, but there may well be others.
That would be better, but this system works for me pretty well as I try to follow a strict schedule for getting up in the morning on week days.
I could however do with hooking it into my calendar so it doesn't run if I have an "Annual Leave" event on that day, or if it's a bank holiday. Just haven't got round to that yet.
I'm not sure it would be 1000x the work. Just need a command line tool to parse ics which I can point at my nextcloud calendar, and then wrap it in another bash script called "atworktoday" or something, so I can do something like:
50 7 * * 1-5 atworktoday && blanket on for 5 minutes
Would be nice if there was a tool which would allow me to do something like:
There must be loads of use cases for a tool which allows you to parse and filter ics. Even a tool which just converts ics to json would be pretty useful as we could then filter results with the excellent "jq" application:
ANNUAL_LEAVE=$(curl -s https://link-to-my-ics \
| ics2json --start $(date +%Y%m%dT000000Z) \
--end $(date +%Y%m%dT235959Z) \
| jq 'map(select(.summary|ascii_downcase|contains("annual leave")))|length')
if [[ "$ANNUAL_LEAVE" == "0" ]]; then
echo "At work today"
else
echo "On holiday, wahoo!"
fi
Oh right, yeah. I don't use the Pebble Smart Alarm. I tried to, but I don't believe it's any smarter than just picking a random time in a specified period. I mean, I know it claims to work based on when you're coming out of a deep sleep, but I saw no evidence that it actually did work that way when using it.
1000x is a real stretch depending on what data you have available. Not sure if this still works, but Google Home devices have a public API that gets you the alarms which have been set: https://rithvikvibhu.github.io/GHLocalApi/#assistant-assista.... True that this would require a fair bit more work, but personally I also find adding features to these sorts of systems a lot of fun.
It's 1000x considering the realtime data from smartwatch, which have no any API for that. So it includes decompiling smartwatches vendor's mobile app, or reverse engineering particular Bluetooth format the smartwatches use for sending the data to vendor's app.
Hi! This is a really cool project!
If you care about your privacy in the bedroom, you should take a look at what we are building at https://snips.ai (disclaimer: I'm a co-founder)
We do the first 100% on-device and private-by-design Voice AI platform which you can use for free and run on a Raspberry Pi, to make it possible to use your blanket without sharing your bedtime secrets with Amazon ;)
I’m more surprised that people still use electric blankets. Utterly dangerous things. Now you can connect your state of the art 1950s tech to the cloud.
Yeah, I would treat them like a candle. Fine if you're there watching it, but not something to leave alone. Although it's not too hard to build safe electric blankets that shut themselves off when they get too hot, as a consumer you don't really know what's inside.
Yes the heating elements are flexible and are easy to damage and they carry current at mains potential. Neither of those outcomes favour failing safe. Even the best quality unheated wires carrying current don't last that long mechanically speaking. Add heat and the decay happens quicker.
Humans are pretty good at warming a cold bed. Sucks for the first ten minutes though.
Kinda click bait title. The project actually integrates the smart power plug to Alexa, which the electric blanket is powered from. The electric blanket is used without any changes to it.
That's a lot of work to avoid buying an electric blanket with a timer. I mean, it's cool and all, but I would hope the lessons learned were worth the effort.
“The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.”
> That's a lot of work to avoid buying an electric blanket with a timer. I mean, it's cool and all, but I would hope the lessons learned were worth the effort.
Totally agree with you.
I guess it is rewarding to make this kind of work with success, moreover if, at the end, it costs less than the original one.
I hope the skils u've learnt will be reused in another project, maybe more "elaborated".
But, more seriously, I don't go to bed at the same time every night. I'd be surprised if most people do. I want to pre-heat the bed while I'm on the bus home from a night out.
The really useful blanket would know exactly when you going to go to the bed every time (analyzing the data from your smartwatch and other gadgets) and prepare accordingly. That's what 'smart things' are about, but that requires slightly more work than coupling the off-the-shelf voice recognition engine with thermostat.
That's impossible. Look at the Nest thermostat - trying to learn when people will be home. It doesn't work beccause most people live messy, noisy lives.
Even I don't know when I'm going to bed until just before I do so. I might go upstairs to brush my teeth, but then go back down to play more video games.
I might go into the bedroom to pick up a book - doesn't mean I'm going to sleep.
The idea of predictive analysis of human behaviour is almost nonsense. Even if it weren't, a quick shout to a robot, or a tap on a button, is quicker and cheaper.
The fact Amazon cannot be more stupid with its' recommended goods than it is doesn't set the fact you just cannot predict someone would want to buy laser printer cartridge in a month or so after he bought the printer.
You will be surprised how repetitive your patterns (like pulse, for example) are and how well they predict will you decide to play the game or to go to the bed. Maybe you just don't analyze these patterns thoroughly enough, so you have an illusion of unpredictability of your decisions.
And by the way, smart things aren't there to only predict. If your blanket, and all other devices - including your todo list app - would vote for the bed, especially if they formulate it with carefully crafted suggestive words in sweet voice, you better agree.
Not OP but ... If you turn off the downstairs lights && go upstairs && it's after $time ... ?
That would work mostly for me, perhaps including the TV and computer being off. That's going to cover 99% accuracy, probably as much as I'd get with a button.
i don't understand why anybody, especially a person with technical knowledge, would purchase and install a device that constantly listens to its surroundings and uploads conversations to the internet
it's scary what a third party can do through your smartphone, let alone all the IoT garbage connected to an Echo
I didn't either until I tried a few things; got a cube for streaming and it was obviously built-in. With a couple of power controllers ($10) it turned into a few practical things. First, I immediately changed that "Alexa" command into "computer."
"Computer, lights" - turns on lamps behind the couch. Better than craning my neck and struggling to find that cheap push-pin switch on a scary fragile glass lamp x 2.
"Computer, pause" - when my hands are coated in layers of an escaped burrito and I need few more ice cream scoops of congealed vegetables and cheese in my maw.
"Computer, set timer for 20 minutes" - for the bread baking, because I already used both microwave and oven timers for rice and vegetables.
"Computer, convert 1 liter to cups" - because imperial units and surprise recipe.
"Computer, switch inputs" - when I want to watch cable. Of course, I have to say it four times rapidly because of an awkward Sharp TV.
This one is a bonus feature, but I can say "computer" with a fake British accent and it still works.
I think that's a fair characterization. There's no single thing that I would be a huge problem if the Echo stopped working, but all of the little things together would add up to a major bummer.
For my family, one of the best features is the shopping list via the AnyList skill. We say "echo, add butter to my shopping list" and it gets added to the AnyList app in the correct category. Next time we are at the store, I pull up AnyList and can see my entire shopping list. For a single person, it might not be a big deal, but it's works very well for a family.
It's not bad enough Alexa is in your home listening to everything you say? You need to be wrapped in an Alexa-powered blanket? Jesus, how much fucking closer to 1984 can we get? The only difference is we WELCOME these devices into our home, there's not even some totalitarian regime forcing it on us. All so we can get the weather with a voice command (as if looking out the god damn window or flicking on a light switch is some horrible ordeal).
What's next, Alexa-powered ASMR...get lulled to sleep as an AI-generated voice whispers to you all the holiday deals you'll have waiting for you when you wake up? I wonder what else it will whisper once you're fast asleep.
If you must have the convenience, at least ditch the cloud and run your smart home entirely on your LAN.
Please don't post predictable/indignant rants about someone's whimsical side project. That's against the spirit of this site, despite how you and I dare say most people here feel about IoT and privacy.
50 7 * * 1-5 for n in $(seq 1 99); do light $n; sleep 30; done; sleep 270; for n in $(seq 98 -1 0); do light $n; sleep 2; done
I also have OpenHab on my server so I can manually control the blanket and lights from both my Android phone and also my Pebble Watch.