[GA-RECIPE] MMM-Pages
-
Hi,
Here is a recipe allowing you to change page, display a specific page, the hidden pages and stop the rotation with MMM-GA and MMM-Pages.
This recipe works with MMM-GA V2 and V3./** MMM-Pages **/ /** vocal control **/ /** Thanks @bugsounet **/ /** 10/06/2021 **/ var recipe = { transcriptionHooks: { "PAGE_INCREMENT": { pattern: "page suivante", // "next page" command: "PAGE_INCREMENT" }, "PAGE_DECREMENT": { pattern: "page précédente", // "previous page" command: "PAGE_DECREMENT" }, "PAUSE_ROTATION": { pattern: "pause rotation", command: "PAUSE_ROTATION" }, "RESUME_ROTATION": { pattern: "reprend rotation", command: "RESUME_ROTATION" }, "SHOW_HIDDEN_PAGE": { pattern: "affiche les paramètres", // I have juste one page hidden, you can have several command: "SHOW_HIDDEN_PAGE" }, "LEAVE_HIDDEN_PAGE": { pattern: "quitte les paramètres", command: "LEAVE_HIDDEN_PAGE" }, "HORLOGE": { pattern: "affiche l'horloge", // I grouped the module by theme in the same page command: "HORLOGE" // to name them easly, first page : big horloge, weather of the day and MMM-Saint }, // 2nd page : 3 Calendar, Alarm, MMM-Traffic... "PLANNING": { // 3th page : 3 weather modules (rain probability, forecast per day and 5 days forecast) pattern: "affiche le planning", // 4th page : 4 news modules command: "PLANNING" // for example }, "METEO": { pattern: "affiche la météo", command: "METEO" }, "INFORMATION": { pattern: "affiche les informations", command: "INFORMATION" } }, commands: { "PAGE_INCREMENT": { moduleExec: { module: (param) => { this.sendNotification("PAGE_INCREMENT"); } }, }, "PAGE_DECREMENT": { moduleExec: { module: (param) => { this.sendNotification("PAGE_DECREMENT"); } }, }, "PAUSE_ROTATION": { moduleExec: { module: (param) => { this.sendsocketNotification("PAUSE_ROTATION",""); }, }, }, "RESUME_ROTATION": { moduleExec: { module: (param) => { this.sendNotification("RESUME_ROTATION", ""); }, }, }, "SHOW_HIDDEN_PAGE": { moduleExec: { module: (param) => { this.sendNotification("SHOW_HIDDEN_PAGE","admin"); // You can have several hidden pages, just change the payload with }, // the same name of your hidden page in the MMM-Pages config in config.js file }, }, "LEAVE_HIDDEN_PAGE": { notificationExec: { notification: "LEAVE_HIDDEN_PAGE", payload: "admin", }, }, "HORLOGE": { moduleExec: { module: (param) => { // Home_page is my page 0 indicated in the MMM-Pages config in config.js file }, }, }, "PLANNING": { notificationExec: { // you can have as many pages as you want, just edit the payload with number page notification: "PAGE_CHANGED", payload: 1, }, }, "METEO": { notificationExec: { notification: "PAGE_CHANGED", payload: 2, }, }, "INFORMATIONS": { notificationExec: { notification: "PAGE_CHANGED", payload: 3, }, }, }, } exports.recipe = recipe
Copy / paste this code into a .JS file and modify it according to your wishes.
Save your recipe file, it should locate in recipes directory.
Then, you can configure your config.js}, recipes: ["ExtRadio_fr.js", "with-MMM-pages1.js"], }
I thank Bugsounet, without its modules and tutorial I would not have been able to make this recipe.
Enjoy
-
thanks! this will work with Jarvis, now i can changes with it too.
-
This post is deleted! -
This post is deleted! -
@calcu Nice !
-
@ Graingallet
Have trouble with changing back to home page 0 how would i go about it here is my config file.{ module: 'MMM-pages', disabled: false, config: { modules: [["clock", "newsfeed", "compliments", "MMM-GoogleAssistant", "MMM-Detector", "MMM-Globe"], ["weather_plus", "MMM-OpenWeatherMapForecast", "MMM-HTMLSnippet"], ["MMM-CalendarExt2", 'MMM-MyWastePickup'], ["MMM-NowPlayingOnSpotify"], ["MMM-Todoist"], ["MMM-AVStock"]], fixed: ["MMM-page-indicator", "MMM-GoogleAssistant"], hiddenPages: { "admin": ["clock", "MMM-NowPlayingOnSpotify", "MMM-CalendarExt2"], "test": [] }, } },
and recipe
/** MMM-Pages **/ /** vocal control **/ /** Thanks @bugsounet **/ /** 10/06/2021 **/ var recipe = { transcriptionHooks: { "PAGE_INCREMENT": { pattern: "next page", // "next page" command: "PAGE_INCREMENT" }, "PAGE_DECREMENT": { pattern: "previous page", // "previous page" command: "PAGE_DECREMENT" }, "PAUSE_ROTATION": { pattern: "pause my rotation", command: "PAUSE_ROTATION" }, "RESUME_ROTATION": { pattern: "resumes my rotation", command: "RESUME_ROTATION" }, "SHOW_HIDDEN_PAGE": { pattern: "show parameters", // I have juste one page hidden, you can have several command: "SHOW_HIDDEN_PAGE" }, "LEAVE_HIDDEN_PAGE": { pattern: "exit settings", command: "LEAVE_HIDDEN_PAGE" }, "CLOCK": { pattern: "displays the clock", // I grouped the module by theme in the same page command: "CLOCK" // to name them easly, first page : big horloge, weather of the day and MMM-Saint }, // 2nd page : 3 Calendar, Alarm, MMM-Traffic... "CALENDAR": { // 3th page : 3 weather modules (rain probability, forecast per day and 5 days forecast) pattern: "display work calendar", // 4th page : 4 news modules command: "CALENDAR" // for example }, "WEATHER": { pattern: "display the weather", command: "WEATHER" }, "INFORMATION": { pattern: "display information", command: "INFORMATION" }, "SPOTIFY": { pattern: "display music", command: "SPOTIFY" }, "PHOTOS": { pattern: "display my pics", command: "PHOTOS" }, "TO_DO_LIST": { pattern: "display to do list", command: "TODOLIST" }, "STOCKS": { pattern: "display my stocks", command: "STOCKS" }, "MAIN_PAGE": { pattern: "main page", command: "MAIN_PAGE" }, }, commands: { "PAGE_INCREMENT": { moduleExec: { module: (param) => { this.sendNotification("PAGE_INCREMENT"); } }, }, "PAGE_DECREMENT": { moduleExec: { module: (param) => { this.sendNotification("PAGE_DECREMENT"); } }, }, "PAUSE_ROTATION": { moduleExec: { module: (param) => { this.sendsocketNotification("PAUSE_ROTATION",""); }, }, }, "RESUME_ROTATION": { moduleExec: { module: (param) => { this.sendNotification("RESUME_ROTATION", ""); }, }, }, "SHOW_HIDDEN_PAGE": { moduleExec: { module: (param) => { this.sendNotification("SHOW_HIDDEN_PAGE","admin"); // You can have several hidden pages, just change the payload with }, // the same name of your hidden page in the MMM-Pages config in config.js file }, }, "LEAVE_HIDDEN_PAGE": { notificationExec: { notification: "LEAVE_HIDDEN_PAGE", payload: "admin", }, }, "CLOCK": { moduleExec: { module: (param) => { // Home_page is my page 0 indicated in the MMM-Pages config in config.js file }, }, }, "MAIN_PAGE": { notificationExec: { notification: "PAGE_CHANGED", payload: 0, }, }, "WEATHER": { notificationExec: { notification: "PAGE_CHANGED", payload: 1, }, }, "CALENDAR": { notificationExec: { // you can have as many pages as you want, just edit the payload with number page notification: "PAGE_CHANGED", payload: 2, }, }, "INFORMATIONS": { notificationExec: { notification: "PAGE_CHANGED", payload: 3, }, }, "SPOTIFY": { notificationExec: { notification: "PAGE_CHANGED", payload: 3, }, }, "PHOTOS": { notificationExec: { notification: "PAGE_CHANGED", payload: 4, }, }, "STOCKS": { notificationExec: { notification: "PAGE_CHANGED", payload: 5, }, }, "TODOLIST": { notificationExec: { notification: "PAGE_CHANGED", payload: 4, }, }, }, } exports.recipe = recipe
i try adding a MAIN_PAGE command but GA just sit not changing page.
Thanks,
-
payload : "0",
For main page
Because in your sample it’s eq to null value
And developer of this module don’t think to add null value to main page
In a long time I have solve it with “0” (string value) -
thanks that worked
-