johboh / hassalarm Goto Github PK
View Code? Open in Web Editor NEWAndroid app for integration with Hass.io as a sensor for the next scheduled alarm on the device
License: MIT License
Android app for integration with Hass.io as a sensor for the next scheduled alarm on the device
License: MIT License
I am running hass behind a reverse proxy, thus I don't need/want a port.
Currently if no one is specified it automatically appends 8123 as the port.
After restarting HA it loses the sensor identity of hassalarm until I either turn my alarm on/off, change the time or start the hassalarm app and tap 'save and test'.
As I'm often tinkering with the system after my gf's gone to bed and has set her alarm, this presents a problem.
Is there any way to tackle this?
My automations won't trigger even though my next alarm is being updated and my date & time is correct, what I think may be the issue is that my alarm times reports as 8:30 AM and my date & time sensor is reporting on a 24 hour clock without Am/Pm so they never truly match and the automation never fires. Is there a way I can fix this?
Hi,
First of all, thanks for this great app. It has been working flawlessly for me before, however since I moved my Home Assistant (Hass.io) to my Synology NAS it is not working anymore.
I created a new Long-Lived Access Token and updated the server address accordingly but got the following error:
Using long lived token
Entity ID is of type input_datetime
Request: POST /api/services/input_datetime/set_datetimeRequest headers: Authorization: Bearer
Request body: {"datetime":"2020-04-16 08:00:00","entity_id":"input_datetime.next_alarm_daan"}
Failure: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
The connection itself is working and also the Long-Lived Access Token works in Tasker.
Any idea what might be the problem here?
Thank you in advance for your help!
Kind regards,
Daniel
Hi,
Is it possible to also get the alarm label ?
Thanks for the great work !
I am not sure how you want to track this on github. I would suggest linking to this in your readme.
https://support.google.com/pixelphone/thread/6068458?hl=en (or write your own guide).
My OnePlus 8 Pro kills the background service after a few minutes rendering the app useless unless you grant it "special allowance".
I've been facing the issue as in #19. Ignored apps is a good fix. My challenge is to know which app to block. At the moment, the only way to do this is by acting on the moment it's been set up as "next alarm" to ignore it. However, I might not have a chance to check at that moment. I would love to understand for all the history of publishes, which app triggered which.
In short, the request here would be to store and show the app source of the alarm on the "Publish history".
For example, instead of:
@23-03-25 10:48:17 alarm @: 23-03-26 09:30
Show something like:
@23-03-25 10:48:17 alarm @: 23-03-26 09:30 by "com.sec.android.app.clockpackage"
Alternatively, this information could be shown on click, similar to the popup information when you click on errors.
At the moment, this would be only for information, so we can diagnose the source of the problematic apps to ignore. In the future, we could also change it so you could have a one click to add that app to the Ignore apps
list.
Are there any plans to make the app available outside of Google's walled garden – e.g. by providing the APK attached to its corresponding release tag here, or bringing it to F-Droid?
Hi,
First thanks you for your app, this is the best and easiest way to sync my alarm with HA. With 1 device it work great but... any solution to use it with more than one device ? Like this:
It would be great, and with this feature we can make automation depending the user.
Benjamin
The app broadcasts fine and hass updates the next alarm. I can manually trigger the automation, and it does what it's supposed to. But the value template does not seem to work?
I implemented it from the UI and edited until it looked correct (for easier editing in the future)
Here it is:
Restarted hass without luck.
Hey, so I just got the hassalarm installed and I'd like to see my next alarm in a card in HA card, is it possible? if yes, how?
"Next alarm: tommorow OR mon,tue,wed..... at 00:00"
Hassalarm does not determine the correct date / time for the upcoming alarm. In case of the settings below it says the next alarm is today (Saturday) at 15:33. I have no (in)-active alarm today or any alarm on that time
Alarms set:
Hassalarm version 1.1
Samsung A70
Android 9
Hi,
I´m still testing hassalarm on Samsung S10E and the next alarm value is triggered correct.
I´m using an automation based on your example, but if the alarm is triggered on my phone, the next_alarm is set to the next one, immediately.
These seems to happen so fast, that the automation is not triggered...
Can you add some delay or do you have any idea, how can I solve the problem?
Thank you!
Regards, Michael
Hi. A history of alarms would be cool; even if only 1.
I ask this because I'm hunting down an errant app that seems to be creating then immediately deleting an alarm.
A bit of backstory; I switched to this app after facing the same issue using the official Home Assistant app (where I have an automation that works with the Next Alarm sensor)
The clock state is perfectly synced when I recently opened the hassalarm but when I exit out of the hassalarm app it works fine for a minute or so and then I try and it doesn't sync. It's been 5 minutes now whilst my phone has a connection and it doesn't sync over.
i'm not able to submit an alarm scheduled if the schedule comes from google alarm clock app. when i tap the homeassalarm's icon the app close immediately but it is still running.
the only way to interact with the application is to disable the scheduled alarms in google alarm clock.
let me know what can i do to help in solving the issue
What's the expected behaviour if I disable all alarms on my phone? If I go into Hassalarm, it says "No next alarm scheduled", but it doesn't perform any successful requests to Home Assistant while in this state. So in Home Assistant, the alarm time stays as it was, as though I hadn't disabled it.
I'm not sure what the sensible thing to do here really is. Perhaps set the alarm time to an arbitrary date in the past or far future? Seems a bit inelegant, but would be an improvement on the current behaviour.
Can you add support for long lived access tokens? The new and preferred authentication method of hass.
First off, great work!!
Is it on purpose the update sent from the app is 5 minutes before the alarm?
Hi,
I tried your app and intergtration, however, i ran into some problems.
In Developer Tools -> States i can see the next alarm on my phone (correct value)
When entering the following test code in Developer tools -> Templates, i get empty string (a date in 1970):
{ states('sensor.date_time') }}
{{ state_attr('input_datetime.next_alarm', 'timestamp') }}
{{ state_attr('input_datetime.next_alarm', 'timestamp') | int | timestamp_custom('%Y-%m-%d, %H:%M', True) }}
Why does the input_datetime.next_alarm have the correct value in the states menu, but no value when testing the template? (neither when used in a automation)
Best regards,
Martin
I believe there is a bug, but I'm unsure if it is due to Hassalarm or HA.
I have two sensors: input_datetime.next_alarm - through Hassalarm -, and sensor.abelphone_next_alarm - through the app. They both sync my alarm time with HA and the times match, see pic 1.
However, I believe there is an error when converting it to a timestamp (see pic 2), they lead to different values. The required value is 7:05 (UTC), which for me is 8:05 (CET, Paris).
Hassalarm converted to timestamp and back reports: 1608277500 Is equivalent to: 12/18/2020 @ 7:45am (UTC)
App alarm converted to timestamp and back reports: 1608275100 Is equivalent to: 12/18/2020 @ 7:05am (UTC)
My first guess would be that since Hassalarm does not add the timezone, that should lead to mistakes. However this does not match with an offset of 40 minutes. Would you have an idea how this is caused?
I just set it up the first time, and feel like I did everything correctly according to the readme, but I'm not getting the proper alarm time and date in home assistant.
My configuration.yaml
# Sensors
sensor:
- platform: time_date # for Hassalarm
display_options:
- 'date_time'
# For Hassalarm
input_datetime:
next_alarm:
name: Nächster Wecker
has_date: true
has_time: true
My automations.yaml
(for webhook).
Note, I haven't created any automation to use the alarm yet.
- id: 'hassalarm'
alias: Webhook for Hassalarm
trigger:
platform: webhook
webhook_id: hassalarm-webhook-2323
action:
service: input_datetime.set_datetime
data_template:
entity_id: "{{ trigger.json.entity_id }}"
datetime: "{{ trigger.json.datetime }}"
The app reports "Published Successfully" and correctly shows what the next scheduled alarm is.
Any ideas? Thanks!
Thanks for the very useful app. Do you have suggestions to easily automate the synchronization, in case I forget to start up the app?
e.g.
thanks!
Hello,
I have something very strange, the app worked fine but stopped working for some reason on 19 december.
Now, if I try to replicate what's in the log in python on my laptop it doesn't work either ...
from requests import get,post
import json
import headerfiles as parameters
headers=parameters.headers
address_hass=parameters.address_hass
url='http://'+address_hass+':8123/api/services/input_datetime/set_datetime'
payload='{"entity_id": "input_datetime.next_alarm","timestamp": "1609911060"}'
test=post(url,data=payload,headers=headers)
test.text
This leads to '400: Bad Request' (same messages as on my phone).
However, if I change the payload to payload='{"entity_id": "input_datetime.next_alarm","datetime": "2020-01-06 06:31:20"}'
, it works fine.
So I'm wondering if something went wrong with using this timestamp payload?
regards
Stijn
I'm having an issue with the time format. I think there is an error with formatting it to UTC. I have updated to the latest version of the app. The issue was already there with the previous version.
Time of testing: 01:20 local time or 00:20+1 (GMT+1)
Alarm in phone: --- Value in HA:
01:50 / 00:50+1 --- 01:50+1 <-- Incorrect
02:50 / 01:50+1 --- 01:50+1
03:50 / 02:50+1 --- 02:50+1
04:50 / 03:50+1 --- 03:50+1
If the alarm is within the same hour (max 60 minutes from now), the format is not in GMT+1 but GMT+0 or UTC. This shouldn't be the case. The screenshot is when the alarm is set to 01:50 local time so HA needs to output Wed Dec 23 00:50:00 GMT+01:00 2020
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.