Android alarm and openHAB2

restapi
Tags: #<Tag:0x00007f014c5e4c88>

(Eberhard Kahlenberger) #1

This is my first post here and because I learned a lot by reading through the posts here, I wanted to give something back.

For my wake up light I needed to make my android alarm available to openHAB. Unfortunately, I was not able to find a suitable android application. So I decided to develop a small android application which sends the android alarm on every change as seconds since 01/01/1970 to my openHAB installation.

I uploaded it to google play this morning:

I purposely kept it simple, but if there is any problem … I’m listening.
And btw: I’m a developer not a designer.

I hope it is usefull… It is for me, at least :wink:

Edit: changed the link to an english version


Alarm clock of squeezebox radio for OH
(Lucky) #2

It would be very difficult to get this accepted and understandable by many if it is not in English…


(Eberhard Kahlenberger) #3

Thanks for the hint … wrong language…


(Vincent Regaud) #4

Hello,

Can't download app
"Home Automation Alarm Sender" can't be downloaded. Try again, and if the problem continues, get help troubleshooting. (error while retrieving information from server. [DF-DLA-26])

Message from phone after pressing Install


(sceppi) #5

Same here, unable to download the app.

I must say: I like the idea of making the alarm time available to Openhab. This way I could make the lights in my bedroom slowly get brighter to wake-up.
It would be even better if this feature could just be standard integrated in the existing openhab app.


(Vincent Regaud) #6

It is, kind off, cron jobs… :face_with_raised_eyebrow:
But I agree, scheduling is a missing feature


(Eberhard Kahlenberger) #7

Thanks for the message. Although I could install the app after release I cannot anymore … I’m investigating the issue … I’m not a fan of google play right now :confused:


(Mueller Ma) #8

Nice idea, haven’t thought of that before.
What happens, when I have more than one timer on my phone?

Can you think of adding the feature to the officiall app?


(Eberhard Kahlenberger) #9

So, the android cdn presents me a HTTP error 400. As I did not program the google play store I contacted google developer support. This will take some time, I guess.
For now I created a release on the github repository: https://github.com/ekahlenberger/HomeAutomationAlarmSender/releases if anyone is interested in sideloading the app. I’ll wait till tomorrow and see if the issues with the google play store resolve themselves. I will upload another build (with just a new version) tomorrow and hope that’s it.

I have not really looked into the offical openHAB app yet. I really like the idea of a small, self contained, easy maintainable app for now. But I see no reason to not implement it there, besides that I personally feel not yet comfortable enough with android to mess around with somebody else’s work.


(Eberhard Kahlenberger) #10

It always sends the next alarm to openHAB as it responds to corresponding action intent. It should should just switch to the next alarm if the current is handled.


(Eberhard Kahlenberger) #11

Works for me now. It seems to me that the IARC-Rating was missing …


(Mueller Ma) #12

You don’t have to worry to break something. All changes are reviewed and tested :slight_smile:


(Eberhard Kahlenberger) #13

Right now I’m thinking about looking into the official openhab-android app sometime next week. Do you have any recommendations about the collaboration. Otherwise I would just only try to fork and create a pull request from there as soon as I got something working.


(Vincent Regaud) #14

This is good!
Only one caveat. The app sends an updated value when I update an alarm time
I think it should only send an update when the alarm goes off


(Eberhard Kahlenberger) #15

I chose another approach as I wanted to react before the alarm goes off (wake up light, early heating …). Therefore I needed the moment of the alarm beforehand. I’ve currently got a rule working which is calculating the remaining time and updating my wake up light accordingly.

I’m interested in another way to achieve this or more features if you could elaborate on your idea.


(Vincent Regaud) #16

I get it now.
The app sends the next active alarm time!
Of course that makes sense. Very good idea
I will certainly make use of that

In android, the alarms have a name. Could that be sent too so that OH could grab this and know what as well as when


(Eberhard Kahlenberger) #17

Unfortunately, I can’t read the alarm name. But I keep it in mind and try to find a way.


(Mueller Ma) #18

All of the connection stuff is implemented, so it shouldn’t be too hard:

sendItemCommand(getConnection().getAsyncHttpClient(), "item_path", "state");

EDIT:
My example is wrong getUsableConnection() returns a connection, but it may be null.


(Mike Lynch) #19

This is fantastic! I too am having some trouble installing it. :frowning: But I will keep trying. I love the idea of telling oHAB things about me so that it makes smarter decisions. Thanks for making the app!


(Eberhard Kahlenberger) #20

You’re welcome.

Did you get an error message or something? Which android version are you working with?