Read the statement by Michael Teeuw here.
MMM-Assistantmk2
-
This is the case of MMM-pages during onIdle or onActivate operation in MMM-Assistantmk2.I want to run sendNotification (“PAGE_CHANGED”, 2); but I don’t know how.
-
@fri4end
Try this;onIdle: { timer: 1000 * 30, // in 30sec after last Assistant Query, command "PAGE_1" will be activated. command: "PAGE_1" }, onActivate: { //When you wakeup Assistant, command "PAGE_2" will be activated. timer: 0, command: "PAGE_2" }, command: { "PAGE_1": { notificationExec: { notification: "PAGE_CHANGED", payload: 1 } }, "PAGE_2": { notificationExec: { notification: "PAGE_CHANGED", payload: 2 } } },
I didn’t test, but this could be a help to understand.
-
@sean
I’ve tested it,
You will be redirected to another page instead of 1, 2. -
@fri4end said in MMM-Assistantmk2:
You will be redirected to another page instead of 1, 2.
What does it mean? These commands just emit notification
"PAGE_CHABGED"
with payload1(or 2)
, if it doesn’t work as your expectation, give me details more. -
@sean
Here’s what it says
{ module: "MMM-AssistantMk2", position: "bottom", config: { useScreen: true, youtubeAutoplay: true, responseAlert: false, alertError: false, pauseOnYoutube:false, deviceLocation: { coordinates: { latitude: 37.57, longitude: 126.98 }, }, profiles: { "default": { lang: "en-EN" } }, notifications: { ASSISTANT_ACTIVATED: "HOTWORD_PAUSE", ASSISTANT_DEACTIVATED: "HOTWORD_RESUME", }, onIdle: {
timer: 1000 * 30, // in 30sec after last Assistant Query, command “PAGE_1” will be activated.
command: “PAGE_1”
},onActivate: { //When you wakeup Assistant, command "PAGE_2" will be activated. timer: 0, command: "PAGE_2"
},
command: { "PAGE_1": { notificationExec: { notification: "PAGE_CHANGED", payload: 0 } }, "PAGE_2": { notificationExec: { notification: "PAGE_CHANGED", payload: 1 } } }, } },
-
@fri4end
So, onIdle or onActivate doesn’t work? or not your expectation? -
This post is deleted! -
@sean
No, onIdle and onActivate operate normally
We checked the status using the notification viewer module.Manual operation below
Below, when onActivate
I think the payload return is incorrect. -
@fri4end
Ah, I got it.And I’ve found what was wrong. Wait a min. I’ll patch for it. I assumed each payload should be object type. -
@fri4end
fixed.git pull
and try again.