Imagine you are on holiday and your electricity breaks down. Then all your food etc my turn bad. In this case it would be nice to get a notice. This means also that the router will go down…
So my Idea is to connect a phone and then have a backup battery for the rpi, and then make the phone text me if the power goes out. In addition I have my door phone, so if someone ring my doorbell when I am not home I can make the phone call me and when i pick up my personal phone I can talk to the one that are on my door.
Also if my mum or friends drop by they can send and sms with a given code and then it can open the door lock.
Since it seems hard to run spotify on rpi, i can then also use the phone to play spotify, since i can then have this connected to my stereo.
Door locking, dont know if the security class implementation has matured to be ready for this? Search for “security class implementation” in the forum…
Also if my mum or friends drop by they can send and sms with a given code and then it can open the door lock - This would require dependencies for communicating with either a API both directions with a dedicated number, or a more complex phone/microcontroller with a sim-card solution communicating with openHAB.
Would probably be less complex to have a fallback solution with 3g/4g usb dongle connected to your internet router than building complex connections to a mobile phone.
Spotify playback via a cell phone, sounds like a hacky configuration. I use Sonos myself that already have a binding. But I believe i’ve seen blog posts about playing Spotify on the Pi. What about Mopidy? https://www.mopidy.com/
Still, myself I would avoid tangling too much up to the Pi running openHAB…
Using spotify on a phone and connected to the stereo(3.5mm stereo) is something heaps of people do and in my experience .
How is that a hacky configuration? So I can be on my laptop, phone or whatever and I can select songs there and then spotify will automatically play it on that phone that are connected to the stereo. yes sonos is nice, but a bit pricy…
So my idea was to only have openhab on the pi, especially since the soundcard on the pi is not the best…
If you already have battery backup, why not have your network on the battery backup as well?
Look into the Tasker plugin for Android. It can receive the SMS and communicate with openHAB over the REST API, as well as so much more.
To my knowledge just plugging in a phone via USB to a computer isn’t going to do much for you for communication. I think the best you can do is have something on the phone drop a file and something on your computer poll the folder for new files. Of course this means setting up something like Tasker or your own custom code on the phone.
It would indeed be a whole lot easier to get a 3G/4G modem like @fuglestad suggests.
I assume you mean you cannot open the door automatically. You should always have a manual way to override/implement your automation.
I will look into it, but one of the reason to use a phone was the ability to use spotify and also make a phone call when someone rings the doorbell and I am not home. I was hoping simple at commands would be possible through usb on an android phone.
Yes I can open the door by key or sendcommand(doorLock,On) command
A smart phone isn’t a modem. It is a whole computer in its own right so without some extra software written for both it and the computer it is plugged into a USB link between the two will not do any more than plugging two laptops together with a USB cable.
I just assumed you were working with a stock phone, not a rooted one. Once rooted a whole world of opportunities open up. But my statement still stands that you need software on the computer, in this case adb.
I never tried to run a self contained adb command or script, I’ve always done it interactive. Can you just pass it a command or a script like you can do with ssh or bash?
Let me propose a totally different approach for the notification on power down.
When things get bad, you should assume they’ll be even worse than you envisionned.
So instead of trusting that backup power will still work, and that all the pieces of the system will be functional (rasp pi + communication), you should assume that everything went dark. Dark as in “not an electron moves in your toys” dark.
I would agree that running Spotify on a phone, and then trying to control that client from OpenHAB is a bit of a hack. Obviously possible… but perhaps a lot of extra steps that will just cause issues. You should consider a SqueezeBox setup… you can easily integrate this with OpenHAB, and there is a Spotify plugin, so you can access all your local music, as well as Internet Radio, etc. Your Spotify client and server could be on the Pi, but a Pi 2 would probably be better as this is starting to be a fair amount of stuff running (there is a distro with all the SqueezeBox stuff ready to go for the Pi).
As for the notification, from the inside, I would say an older USB GSM modem plugged into the Pi would be the surest approach to get a power outage SMS notification. You’d need to look for some software for handling the incoming and outgoing SMSes, but this would mean that the Internet everywhere could be down, and your text would still go through as it is only using the mobile network. Although MUCH easier, any API service like Twilio requires the Internet to be working between you and the service provider.