mattdy / alarmpi Goto Github PK
View Code? Open in Web Editor NEWThe Raspberry Pi Smart Alarm Clock
Home Page: http://mattdyson.org/projects/alarmpi
The Raspberry Pi Smart Alarm Clock
Home Page: http://mattdyson.org/projects/alarmpi
Currently, if the OpenWeatherMap API is unavailable for any reason, then we end up making a request multiple times a second, once the Weather
cache has expired it will continue to attempt refresh every time Weather.getWeather()
is called.
It would be more sensible for a failed attempt to OWM results in the current cache being extended by a period of time (probably easier to make this fixed at 60s or so, rather than exponentially backing off), thus preventing spamming requests.
The loading of a manual_alarm setting in alarmpi.py
(on startup) does not take into account timezones, and passes a offset-naive datetime object into AlarmControl.manualSetAlarm()
, which then causes issues:
[2015-09-14 14:11:13,500] ERROR LcdThread: Error in LcdThread loop
Traceback (most recent call last):
File "/root/alarmpi/LcdThread.py", line 121, in run
message+=self.alarmThread.getMenuLine()
File "/root/alarmpi/AlarmThread.py", line 216, in getMenuLine
diff = self.nextAlarm - now
TypeError: can't subtract offset-naive and offset-aware datetimes
It should be possible to put the current timezone into the object by using datetime.fromtimestamp
, which would fix this issue.
As of November, OpenWeatherMap require a free account in order to use their APIs, as such all requests now require an APPID parameter to be included, or they will fail.
The request to OpenWeatherMap in Weather.py
should be updated to allow inclusion of an APPID parameter, which could either be configured dynamically through Settings
, or by inclusion in CalendarCredentials
or similar static configuration.
@mattdy I made a version of this project out of an old internet radio which closed it's streaming services about 10 year ago.
I re-used the built in LCD, rotary encoder and built in buttons and speaker, added an i2c stereo amp and hooked it all up to a raspi A+
For 8 or so of the last 10 years my wife was happily being awoken by the random choice of alarm sound (mostly recorded by the kids when they sounded funny and adorable (now just embarrasing for them to hear their younger selves and the most annoying alarm)) That bit still works but the googletts stopped working long ago as did the BBC streams that have moved to proprietary DRM system.
Anyway I was just looking to add a large illuminated dome (arcade style) button and maybe some Home Assistant integration when I looked up the original project here.
I was wondering if you made any advancements to this project over the last 10 years or if you even still use it ๐
It would be nice to have the option to specify a "minimum time" after an event finishes before another automatic alarm will be set.
For instance - if the "default wakeup time" is set to 0900, but we have an event finishing at 0700 (yay night shifts), then the automatic alarm will be set for 0900, whereas it would be nicer to set the alarm for a configurable "minimum time" after the event finished, or even just skip the day entirely.
There are several instances where Europe/London
is hard-coded as the timezone to use in configuring alarms etc. It would be nicer to make this configurable in some manner, most likely through Settings
.
However - the implications of putting an invalid timezone in here (ie: one not on this list) could be quite severe, so some kind of validation may be required before falling back to a sensible default?
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.