This an extension for the MagicMirror².
This Module is used to add one to many memo notes on your Magic Mirror.
Content is manageable through HTTP get requests.
- An installation of MagicMirror2
In your terminal, go to your MagicMirror's Module folder:
cd ~/MagicMirror/modules
Clone this repository:
git clone https://github.com/schnibel/MMM-Memo.git
To use this module, add it to the modules array in the config/config.js
file:
modules: [
{
module: 'MMM-Memo',
position: 'top_left',
classes: 'default everyone', // if using MMM-ProfileSwitcher module
config: {
// See 'Configuration options' for more information.
...
}
}
]
If you declare several modules in the config/config.js
file, you will get several memo notes on your MagicMirror2 profile.
The following properties can be configured:
Option | Description |
---|---|
memoTitle |
[MANDATORY] Title of the memo note. This title is also used to retreive memos from the persistence file. This is NOT case sensitive |
memoMaxItems |
[OPTIONAL] Integer used to define the maximum number of memo to display per note. If the number of memos is greater than the one specified here, a message (e.g. + 2 more memos ) will be displayed at the bottom of the note.Default value: 5 |
memoMaxMsgSize |
[OPTIONAL] Integer used to define the maximum number of characters to be displayed per memo. Default value: false (It will show all characters) |
memoDisplayDuration |
[OPTIONAL] Used to show since when memos have been created. Possible values: true or false Default value: false |
memoDisplayIfEmpty |
[OPTIONAL] Used to display (or not) an empty note if there is no memo inside. Possible values: true or false Default value: false |
memoDisplayId |
[OPTIONAL] Used to display (or not) a number before each memo. This number is necessary to remove a memo. Note that this unicode character is limited to 20 Possible values: true or false Default value: true |
memoDisplayHeader |
[OPTIONAL] Used to display (or not) the memoTitle at the top of the note. Possible values: true or false Default value: true |
memoDisplayNotification |
[OPTIONAL] Used to display (or not) the notification using the default alert module. See How to use section for more information on this property. Possible values: true or false Default value: false |
memoColorBackground |
[OPTIONAL] Used to define the color of the note. Possible values: See Colors for more information. Default value: Yellow |
memoColorHeader |
[OPTIONAL] Used to define the color of the header (if displayed). Possible values: See Colors for more information. Default value: Black |
memoColorFont |
[OPTIONAL] Used to define the color of the memo font. Possible values: See Colors for more information. Default value: Black |
memoColorWarning |
[OPTIONAL] Used to define the color of a WARNING note. Possible values: See Colors for more information. Default value: Red |
memoRotation |
[OPTIONAL] Used to rotate the note. Possible values: -10 or -8 or -6 or -4 or -2 or 0 or 2 or 4 or 6 or 8 or 10 Default value: 0 |
memoWidth |
[OPTIONAL] Value to specify the width of the note. Default value: 100px |
memoHeight |
[OPTIONAL] Value to specify the height of the note. Default value: 100px |
memoPadding |
[OPTIONAL] Value to specify the padding of the note. Default value: 20px |
format |
[OPTIONAL] Displays relative date format, for absolute date format provide a string like 'DD:MM HH:mm' All Options |
I'm using this module with my Jarvis installation from DomotiqueFacile.
When I speak to Jarvis, I say for example : "add FRUITS to the SHOPPING memo list", and Jarvis automatically sends a HTTP get request to the MMM-Memo module.
The available HTTP get requests are the following at the moment:
http://MIRROR_IP:MIRROR_PORT/AddMemo?memoTitle=SHOPPING&item=Fruits&level=INFO
NOTE : The level property is optional in the request. If not specified, the INFO
level will be set.
http://MIRROR_IP:MIRROR_PORT/AddMemo?memoTitle=phone%20numbers&item=Daddy%3A%20%2B33123456789&level=WARNING
NOTE : The level property is optional in the request. If not specified, the INFO
level will be set.
NOTE : Here is an example of a curl command with urlencode syntax
curl -G -v "http://MIRROR_IP:MIRROR_PORT/AddMemo?memoTitle=SHOPPING" --data-urlencode "item=Bonjour, êtes-vous allées dans votre boutique préférée ?"
http://MIRROR_IP:MIRROR_PORT/RemoveMemo?memoTitle=phone%20numbers&item=2
http://MIRROR_IP:MIRROR_PORT/RemoveMemo?memoTitle=phone%20numbers&item=ALL
http://MIRROR_IP:MIRROR_PORT/DisplayMemo?memoTitle=SHOPPING&item=2
Memo note is displayed using the default alert module,
so it is necessary to configure this alert module in your config/config.js
file if you want to see notifications.
NOTE : I saw a problem when more than one unique MMM-Memo module is defined in the config/config.js
file.
Indeed, the same notification is displayed several times (e.g. 3 times if you defined 3 MMM-Memo modules). I did not
deeply investigate to understand the root cause.
A workaround is to use the memoDisplayNotification
property by setting it to true
for ONLY ONE MMM-MEMO MODULE
Do not forget to have ONE memoDisplayNotification
set to true
if you want to see notifications.
http://MIRROR_IP:MIRROR_PORT/DisplayMemo?memoTitle=SHOPPING&item=ALL
Memo note is displayed using the default alert module,
so it is necessary to configure this alert module in your config/config.js
file if you want to see notifications.
NOTE : I saw a problem when more than one unique MMM-Memo module is defined in the config/config.js
file.
Indeed, the same notification is displayed several times (e.g. 3 times if you defined 3 MMM-Memo modules). I did not
deeply investigate to understand the root cause.
A workaround is to use the memoDisplayNotification
property by setting it to true
for ONLY ONE MMM-MEMO MODULE
Do not forget to have ONE memoDisplayNotification
set to true
if you want to see notifications.
Here are the available colors.
- Michael Teeuw for creating the awesome MagicMirror2 project that made this module possible.
- Paviro for creating the MMM-Syslog module that I used as guidance in creating this module.
- Taylored Marketing for colors definition.
- Creative Punch for the memo note CSS creation.
- Slamet PS for the Indonesian translation
- Snille for the Swedish translation
Enjoy... and do not hesitate to make comments or propose new functionalities.