Skip to content

slametps/MMM-PrayerTime

Repository files navigation

MMM-PrayerTime GitHub license

This an extension for the MagicMirror2. It will display prayer time (in local time) and also recite Adzan/Adhan. Your mirror will be your helpful assistant to do sholat on time.

Screenshot

Screenshot Screenshot Screenshot Screenshot

Installation

  1. Navigate into your MagicMirror's modules folder
  2. execute git clone https://github.com/slametps/MMM-PrayerTime.git
  3. if this module does not run correctly, try npm install async

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: 'MMM-PrayerTime',
		position: 'top_left',	// This can be any of the regions. Best result is in the top_left/top_right.
		config: {
			apiVersion: '1.0', // please, leave unchanged. reserved for future use.
			lat: false, // latitude of your position (city)
			lon: false, // longitude of your position (city)
			timezone: false, // please refer to http://php.net/manual/en/timezones.php
			timeFormat: 24,
			method: 5,
			playAdzan: ['fajr', 'dhuhr', 'asr', 'maghrib', 'isha'],
			notDisplayed: ['midnight', 'sunset'],
			useUpdateInterval: true,
			updateInterval: 86400 * 1000, // How often do you want to fetch new praying time? (milliseconds)
			animationSpeed: 2.5 * 1000, // Speed of the update animation. (milliseconds)
			language: config.language,
			showAdzanAlert: true,
			showTomorrow: true,
			vertical: true, // set false for horizontal view
			alertTimer: 15000
		}
	}
]

Configuration options

The following properties can be configured:

Option Description
apiVersion 1.0 (reserved for future use)
lat
REQUIRED
latitute of your position (city)
You can use google maps to get this info
Default value: false
lon
REQUIRED
longitude of your position (city)
You can use google maps to get this info
Default value: false
timezone
REQUIRED
Local timezone.
Possible values: refer to http://php.net/manual/en/timezones.php
Default value: true
timeFormat 12/24 time-format.
Possible values: 12, 24
Default value: config.timeFormat or 24
method
REQUIRED
method to identify various schools of thought about how to compute the timings
Possible values: 0-7 (0-Shia Ithna-Ashari, 1-University of Islamic Sciences,Karachi, 2-Islamic Society of North America (ISNA), 3-Muslim World League/MWL, 4-Umm al-Qura,Makkah, 5-Egyptian General Authority of Survey, 7-Institute of Geophysics, University of Tehran)
Default value: 5
methodSettings Create your own calculation method,
The methodSettings parameter accepts comma separated values in the following order: FajrAngle,MaghribAngleOrMinsAfterSunset,IshaAngleOrMinsAfterSunset
Refer to https://aladhan.com/calculation-methods
Method option must be: 99
Example value: 15,null,12
Default value: false
school 0 for Shafi (or the standard way), 1 for Hanafi. If you leave this empty, it defaults to Shafii.
Default value: 0
adjustment Number of days to adjust hijri date(s)
Example value: 1 or 2 or -1 or -2
Default value: false
tune Same as methodSettings, create your own calculation method,
The methodSettings parameter accepts comma separated values in the following order: FajrAngle,MaghribAngleOrMinsAfterSunset,IshaAngleOrMinsAfterSunset
Refer to https://aladhan.com/calculation-methods
Method option must be: 99
Example value: 5,3,5,7,9,7
Default value: false
midnightMode 0 for Standard (Mid Sunset to Sunrise), 1 for Jafari (Mid Sunset to Fajr). If you leave this empty, it defaults to Standard.
Default value: 0
latitudeAdjustmentMethod Method for adjusting times higher latitudes - for instance, if you are checking timings in the UK or Sweden.
Possible values: 1 - Middle of the Night, 2 - One Seventh, 3 - Angle Based
Default value: 3
playAdzan List/array of the prayer time name to play Adzan.
Possible values: ['fajr', 'dhuhr', 'asr', 'maghrib', 'isha', 'imsak', 'sunrise', 'sunset', 'midnight']
Default value: ['fajr', 'dhuhr', 'asr', 'maghrib', 'isha']
notDisplayed List/array of the prayer time name not to be displayed.
Possible values: ['fajr', 'dhuhr', 'asr', 'maghrib', 'isha', 'imsak', 'sunrise', 'sunset', 'midnight']
Default value: ['midnight', 'sunset']
useUpdateInterval Using internal update interval or triggered by MMM-ModuleScheduler to fetch and update new praying time? if false, add new schedule entry in MMM-ModuleScheduler:
{notification: 'PRAYER_TIME', schedule: '1 0 * * *', payload: {type: 'UPDATE_PRAYINGTIME'}}
Possible values: true, false
Default value: true
updateInterval How often to fetch new praying time? (milliseconds)
Default value: 86400000 (1 day)
animationSpeed Speed of the update animation. (milliseconds)

Possible values:0 - 5000
Default value: 2500 (2.5 seconds)
language module language. Can be different from MM.
Default value: config.language or 'en'
showAdzanAlert Display alert when enterigng praying time?
Possible values: true, false
Default value: true
showTomorrow Display tomorrow praying time?
Possible values: true, false
Default value: true
vertical Display vertically?
Possible values: true, false
Default value: true
alertTimer How long alert will be displayed? (milliseconds)

Possible values:0 - 60000
Default value: 15000 (15 seconds)
telegramAlert Send a notification to your Telegram Bot,
The telegramAlert is a multidimensional array: [ Status, [["chat_id_1", "chat_id_2", ...], 'bot_token'] ]
Refer to https://core.telegram.org/bots/api#sendmessage
Refer to https://www.shellhacks.com/telegram-api-send-message-personal-notification-bot/
Example value: [ true, [["123456789", "987654321", ...], '4334584950:AAEPmjlh94N62Lv9jGWEgOftlxxAfMhB1gs'] ]
Default value: [false]

Dependencies

The MIT License (MIT)

Copyright © 2016-2017 Slamet PS

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.