Read the statement by Michael Teeuw here.
Hi, there is a new Alexa Module
-
thanks @JoChef2. So its actually an interaction with the two modules and my config; to be honest read that calendarExt2 usage page lots of times. do not know how to accomplish to solve that misconfiguration; so would think about a way to solve it. Am not a coder and thats why asked here.
If I put the Calendarext2 on page0 on MMM-Pages (with no notifications) I can call the calendar from Alexa by stating an Alexa Routine to actually refresh the mirror (as it restarts it shows the first page which is the calendar) --> Tried that already and it works but would love to make it working the way I want to. So many test (try-error) coming :fearful_face:
If anyone think of something I can try would be really appreciated :thumbs_up_light_skin_tone:
@Sean can you throw any word here? Thanks so much; I’m quite confused…
-
Im reading a lot of documentation about all three modules in use (MMM-Pages, MMM-CalendarExt2 & Alexa Control).
That’s what i found in another thread about MMM-Pages & MMM-CalendarExt2; written by @Sean :I just looked inside MMM-Pages(edward-shen/MMM-pages) shortly, It has no feature to emit notifications about current page sequence to other modules. It has PAGE_NUMBER_IS but it is only as the response of QUERY_PAGE_NUMBER. So there is no way to recognize which page at that moment. So CalendarExt2 cannot know what scene to show.
And this from MMM-pages doc:
This module sends one notification, MAX_PAGES_CHANGED to assist display modules with how many pages they should display. However, this module does not enforce what page other modules should indicate. This is intentional, because any other module that needs a page change notification should be receiving from the notification system. Finally, if you want to know what page you're currently on, send a QUERY_PAGE_NUMBER notification. The module will respond with a PAGE_NUMBER_IS notification, with the payload of the current page number.
So will leave it for now unless @edward-shen can point me to the right direction here (or somebody else of course)
So thanks @JoChef2 nothing to do with AlexaControl.
il leave config and putting Calext2 in the first page in order to make that little trick I commented on earliers post…(refresh MM when changing page to Calendar’s one ) :face_with_cold_sweat:
-
@rubenix Hi, I think I have good news for you. I tested the MMM-CalenderExt2 and I had problems with my module, too. I found on the link I send you the solution. The only thing you have to do is add a notification. I added this to your config and I hope it works.
{ module: 'MMM-CalendarExt2', position: "middle_center", config: { rotateInterval: 0, updateInterval: 1000 * 60 * 60, calendars : [ { name: "Family", url: "mycalendar.ics", //obviously my correct ics address here }, ], views: [ { name: "VIEW1", mode: "month", position: "middle_center", locale: "es_ES", slotCount: 1, calendars: ["Family"], }, ], scenes: [ { name: "PAGE1", views:["VIEW1"], className: "fakeScene" }, { name: "PAGE2", views:["VIEW1"], }, { name: "PAGE3", views:["VIEW1"], className: "fakeScene" }, { name: "PAGE4", views:["VIEW1"], className: "fakeScene" }, { name: "PAGE5", views:["VIEW1"], className: "fakeScene" }, ], notifications: { "PAGE_INCREMENT" : { exec: "sceneNext", }, "PAGE_DECREMENT" : { exec: "scenePrevious", }, "PAGE_CHANGED" : { exec: "changeSceneById", payload: (payload) => {return payload} } }, }, },
-
Hey man!! many thanks will try it asap and tell you how it goes.
I found another solution to show my google calendar using an iframe (had to make it public tho and do not want this)So pretty good news if I make it to work.
Many thanks!!!
-
Yehaaaa. Got it working with no issues at all.
I think I tried before as per your link instructions but I think I put it without the notifications of page increment and page decrement. I made a fatal mix indeed…and thats why mirror was doing weird things…Thanks so much, I’ve been in touch with MMM-Page developer but yours it has been the best indication indeed.
I’ve been playing with MMM-Notification-Trigger as I needed for interact with a groove sensor to fire QUERY_PAGE_NUMBER and got it working too. Very productive weekened indeed :face_savouring_delicious_food:So now pages rotates by itself ; I can change them by AlexaControl and with a gesture too!!! Lovely
Thats what I wanted; reverting back calendar as private!!!Thanks so much @JoChef2 I owe you a beer:clinking_beer_mugs:
-
Hello again! I’ve another question…
I want to power off USB power at the same time I power off monitor from alexa module.I’ve seen on line 199 of node_helper.js the following:
exec("vcgencmd display_power 0", opts, (error, stdout, stderr) =>
Tried to add the command: echo ‘1-1’ |sudo tee /sys/bus/usb/drivers/usb/unbind (cut power from usb ports)
like that:exec("vcgencmd display_power 0 && echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind", opts, (error, stdout, stderr) =>
Command does not work (I think theres a syntax error) monitor powers off but usb power still on.
Command works from commandline.
Also tried to put it on a separate exec function without succeed.Can you give me a hand with this @JoChef2
Thanks!
-
Also created a couple of scripts (monitor_on.sh & monitor_off.sh) --> with 2 commands I mentioned before on them.
Both works from bash but cannot execute them from node_helper.js
any thoughts? sorry about asking but am not a coder & cannot find an answer anywere…Thanks!
-
@rubenix what do the scripts look like? if u replaced the vcgencmd strin with the scripts, they should work…
where are the scripts? they MUST be on the path, or have the full path specified in the command too
-
@rubenix Hi, I don’t really know why it doesn’t work. The syntax seems to be right. That’s the hole edit part around line 199. Maybe it helps. I tested this and it works great.
device.handler = function(action) { if(action === 1){ exec("vcgencmd display_power 1 && echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/bind", opts, (error, stdout, stderr) => { _this.checkForExecError(error, stdout, stderr); }); }if(action === 0){ exec("vcgencmd display_power 0 && echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind", opts, (error, stdout, stderr) => { _this.checkForExecError(error, stdout, stderr); }); } }
-
@JoChef2 its because the exec() is launching A program… but the program is NOT a shell (sh., bash etc), and only THEY understand the | and && syntax… vcgencmd does not… it executes what it knows ‘display_power 1’ ,and ignores the rest
now, you CAN execute a script directly as long as it contains the processor name at the front
#!/bin/sh or #!/bin/bashexec(“/home/pi/MagicMirror/modules/MMM-AlexaControl/scriptname”)
or the script has to be in the path environment varible.
(unlike windows, the ‘current directory’ is NOT included in the path (for security reasons))if the script does NOT contain the processor path&name
then you have to launch the shellexec(“/bin/bash -c “command string with pipe and logic chars””)