A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
  • [npm library] @bugsounet/internet

    3
    1 Votes
    3 Posts
    479 Views
    ?
    it’s just my personal npm libraries :) I have 3 more … but i have to Make readme file (too lazy actually) :p
  • [npm library] @bugsounet/screen

    1
    1 Votes
    1 Posts
    171 Views
    ?
    @bugsounet/screen I created this library if you want to manage for screen in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-Assistant2Display single node routine for managing your screen Installation npm install @bugsounet/screen Sample with screen contructor const Screen = require("@bugsounet/screen") this.config = { delay: 10 * 1000, turnOffDisplay: true, ecoMode: true, displayCounter: true, detectorSleeping: true, governorSleeping: true, rpi4: false, linux: false } var debug = true this.screen = new Screen(this.config, callback, debug, detectorControl, governorControl) this.screen.start() setTimeout(() => { this.screen.state() } , 5 * 1000) setTimeout(() => { this.screen.stop() } , 15 * 1000) function callback(noti, value) { if (noti == "SCREEN_TIMER") console.log ("Turn off in", value) else console.log("Screen Notification:", noti) } function detectorControl(noti) { console.log("detectorControl Notification:", noti) } function governorControl(noti) { console.log("governorControl Notification:", noti) } constructor of screen Screen(screenConfig, callback, debug, detectorControl, governorControl) screenConfig {} delay - Time before turns off the display. (in ms). turnOffDisplay - Should the display turn off after timeout? ecoMode - send a notification to hide all module after timeout? displayCounter - send a notification with count-down before sleeping detectorSleeping - send a notification to manage detector when screen is off governorSleeping - send a notification to manage governor when screen is off rpi4 - rpi4 support (use dpms) linux - linux support (use dpms) callback (notification,value) SCREEN_TIMER - Display the count down before sleeping mode (require displayCounter) SCREEN_SHOWING - return notification for showing modules or other (require ecoMode) SCREEN_HIDING - return notification for hiding modules or other (require ecoMode) SCREEN_STATE - return object with actual screen state object value: running: return true if screen main script with count down is running locked: return true if screen function is locked power: return true if your display is On { running: true, locked: false, power: true } detectorControl [optional] require @bugsounet/snowboy or compatible require detectorSleeping and only work with activate() or start() function SNOWBOY_START - return notification for start your detector SNOWBOY_STOP - return notification for stop your detector governorControl [optional] require @bugsounet/governor require governorSleeping and only work with activate() or start() function GOVERNOR_WORKING - return notification to change your governor to working configuration GOVERNOR_SLEEPING - return notification to change your governor to sleeping configuration debug if you want debuging information, just set to true Functions activate(): activate main screen script with count down (use it with first use) it force turn on display when escape the script (ctl + c) start(): start screen script with count down stop(): stop screen script reset(): reset count down wakeup(): wake up the screen lock(): lock the screen (start/stop/reset/wakeup will be ignored) unlock(): unlock the screen wantedPowerDisplay(wanted): comparate actual screen state and apply it if not set. wanted value is boolean: true: turn on screen false: turn off screen setPowerDisplay(set): like wantedPowerDisplay() but you force to apply it set value is boolean: true: force turn on screen false: force turn off screen state(): return state of screen in object Notes turnOffDisplay work only with activate() or start() function you can use only wantedPowerDisplay() or setPowerDisplay() without main script !
  • [npm library] @bugsounet/cast

    1
    0 Votes
    1 Posts
    251 Views
    ?
    @bugsounet/cast I created this library if you want to cast youtube in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-Assistant2Display single node routine for casting YouTube (or other ?) in webview tag Installation npm install @bugsounet/cast Sample with cast contructor const Cast = require("./index.js") this.config = { castName: "MagicMirror_Cast", port: 8569 } var debug = true this.cast= new Cast(this.config.cast, callback, debug) this.cast.start() setTimeout(() => { this.cast.stop() } , 30 * 1000) function callback(noti, castLink) { if (noti == "CAST_START") console.log("Open this link:", castLink) if (noti == "CAST_STOP") console.log ("Cast End") } /** Note: Open the castLink in a webview tag **/ /** needed useragent= "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.4.0) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.1 TV Safari/538.1" **/ constructor of cast Cast(castConfig, callback, debug) castConfig {} castName - Name of your device for reconize it in Cast apps port - server port callback (notification, castlink) CAST_START - return the url for start casting in a webview frame CAST_STOP - return end of casting debug if you want debuging information, just set to true Functions start() : start cast listener stop() : force stop cast server Notes Actually only YouTube works but may be other (in another update…)
  • [npm library] @bugsounet/governor

    1
    0 Votes
    1 Posts
    230 Views
    ?
    @bugsounet/governor I created this library if you want to set a CPU governor in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-Assistant2Display single node routine for setting you prefered CPU governor Installation npm install @bugsounet/governor Sample with governor contructor const Governor = require("@bugsounet/governor") this.config = { useCallback: true, sleeping: "powersave", working: "ondemand" } var debug = true this.governor = new Governor(this.config, callback, debug) this.governor.start() function callback(governor) { console.log(governor) } constructor of governor Governor(governorConfig, callback, debug) governorConfig {} useCallback- return callback confirmation (false by default) sleeping- set your prefered governor on sleeping mode working- set your prefered governor on working mode Available governor: conservative ondemand userspace powersave performance callback {} callback return object with status: { "actived" : true, "wanted" : "ondemand", "actual" : "ondemand", "error": null } actived: confirm with true if governor is set wanted: your wanted governor to set actual: your actual governor error: display error if detected debug if you want debuging information, just set to true Functions start() : start governor with working setting working(): start governor with working setting sleeping(): start governor with sleeping setting
  • [npm library] @bugsounet/pir

    1
    1 Votes
    1 Posts
    242 Views
    ?
    @bugsounet/pir I created this library if you want use a pir sensor in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-Assistant2Display single node routine for PIR sensor read Installation npm install @bugsounet/pir In the ending of installation, if you use electron you can do electron rebuild step. Do you want to execute electron rebuild ? [Y/n] Your choice: Sample with pir contructor const Pir = require("@bugsounet/pir") this.config = { gpio: 17, reverseValue: false } var debug= false this.pir = new Pir(this.config, callback, debug) this.pir.start() setTimeout(() => { this.pir.stop() } , 5000) function callback(status, err) { console.log("[PIR:CALLBACK] Status: " + status) if (err) console.log("[PIR:CALLBACK] " + err) } constructor of pir Pir(pirConfig, callback, debug) pirConfig {} gpio - BCM-number of the sensor pin. reverseValue - reverse presence detector value. callback (status,error) callback return with event status: PIR_INITIALIZED: Pir constructor is initialized PIR_STARTED: Pir start detection confirmation PIR_STOP: pir stop detection confirmation PIR_DETECTED: pir user presence detected PIR_ERROR: pir error callback error return with PIR_ERROR if error detected, it will return it with error value debug if you want debuging information, just set to true Functions start() : start pir stop() : force stop pir
  • [npm library] @bugsounet/snowboy

    1
    0 Votes
    1 Posts
    413 Views
    ?
    @bugsounet/snowboy I created this library if you want use snowboy in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-GoogleAssistant, MMM-Snowboy, MMM-AssistantMk2 Dependencies For listening keyword, you have to use a mic, so snowboy need some dependencies to use it sudo apt install libmagic-dev libatlas-base-dev sox libsox-fmt-all build-essential Installation npm install @bugsounet/snowboy In the ending of installation, if you use electron you can do electron rebuild step. Do you want to execute electron rebuild ? [Y/n] Your choice: Sample with new Snowboy contructor /** sample code for using snowboy library **/ /** @bugsounet **/ const Snowboy = require("@bugsounet/snowboy").Snowboy var config = { debug: true, snowboy: { audioGain: 2.0, Frontend: true, Model: "jarvis", Sensitivity: null }, micConfig: { recorder: "arecord", device: "plughw:1", }, } this.snowboy = new Snowboy(config.snowboy, config.micConfig, (detected) => { detect(detected) }, config.debug ) this.snowboy.init() this.snowboy.start() function detect(detected) { console.log("Make your script if " + detected + " is detected") } constructor of Snowboy Snowboy(snowboyConfig, micConfig, callback, debug) SnowboyConfig AudioGain - set the gain of mic. Usually you don’t need to set or adjust this value. Frontend - set pre-processing of hotword detection. When you use only snowboy and smart_mirror, false is better. But with other models, true is better to recognize. Model - set the name of your detector. Available: “smart_mirror”, “jarvis”, “computer”, “snowboy”, “subex”, “neo_ya”, “hey_extreme”, “view_glass” Sensitivity - Override default sensitivity value for applied model defined in Model. Value could be within a range from 0.0 to 1.0. Default sensitivity values for preconfigured models are: smart_mirror: 0.5 jarvis: 0.7 computer: 0.6 snowboy: 0.5 subex: 0.6 neo_ya: 0.7 hey_extreme: 0.6 view_glass: 0.7 alexa: 0.6 null will set default sensitivity. micConfig recorder - record program, rec, arecord, sox, parec is available. On RaspberryPi or some linux machines, arecord is better. On OSX, rec is better. If you prefer to use pulse audio, parec would be available also. device - recording device (microphone) name of your environment. (e.g. “plughw:1”) Find proper device name by yourself. (arecord -l will be help on Raspberry Pi or linux platform) callback if snowboy detect a keyword, it return it with his name debug if you want debuging information, just set to true Functions init() : initialize the constructor start() : start listening and waiting for your keyword stop() : force stop listening
  • Get Error "undefined symbol" in own module

    3
    0 Votes
    3 Posts
    1k Views
    S
    @bjorndegroot the last post was 2 years ago
  • Download CSV from MM Module

    download csv file
    3
    0 Votes
    3 Posts
    843 Views
    L
    Thank you @sdetweil. I will take a look at it Thanks Again
  • Hide/show module from another module

    4
    0 Votes
    4 Posts
    647 Views
    S
    @sergiozf you can pass a string as part of the hide, to prevent any other module from showing that does not provide that same string on show
  • MM crashes when I try to start my own module.

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    S
    @vredevol getDom() MUST return AT LEAST an htmlElement add return document.createElement(‘div’) see my sample module https://github.com/sdetweil/SampleModule
  • Filter events on Calendar Module

    3
    0 Votes
    3 Posts
    1k Views
    A
    Where do you paste that code? config.js?
  • Monitor external program...

    5
    0 Votes
    5 Posts
    662 Views
    S
    start the external program with pm2, it will keep it running
  • Send socket notification to node helper on click?

    2
    0 Votes
    2 Posts
    419 Views
    ?
    @laszlocsaba imgObj.onclick = ()=> { this.sendSocketNotification("CLICKED", somePayload) } I think you might have some confusing with using this. If you are using ES6 style arrow function, you can easily bind.
  • My first written module

    12
    0 Votes
    12 Posts
    3k Views
    BKeyportB
    Ah, the heck with it. It’s released!
  • Send data from a local web page to a magic mirror module

    4
    0 Votes
    4 Posts
    773 Views
    S
    @sergiozf where is it getting the data from? Can it websocket send to mm module too? Use the node ws library https://www.npmjs.com/package/ws Listen and receive in the node helper. Send up to the module
  • How can i pass query / parameters from URL to module

    Solved
    12
    0 Votes
    12 Posts
    4k Views
    A
    Hi, testing completed, today i uploaded new release to github. MMM-Navigate - V1.3 released Regards AxLED
  • "Npm start" doesn't work

    17
    1
    0 Votes
    17 Posts
    5k Views
    M
    Mac mini…
  • 0 Votes
    1 Posts
    552 Views
    U
    Hi everybody! I currently have an event on my local MQTT server which provides me with the event that sun has risen or has set. This has different consequences around my house, specifically when the sun sets: curtains go down, ambiental lights go on (this last one obviously depending on whether we are home or not), staircase gets illuminated, etc. I have a magic monitor (on display here) which I want it to be coordinated as well: whenever the sun sets, the theme should set to be a dark theme, otherwise during the day it should be a white(ish) theme. I have currently overwritten some values in my CSS so that during the majority of the day it displays the light theme, but now I would like to go a step further and implement this so that after the sun sets, the screen is no longer so bright. Now comes my question: how would you begin to do this? Has anybody already done this before? Can I use some existing implementation to read out MQTT and perform an operation based on such an event? I can program comfortably (actually pretty new to nodejs!) but I’m just curious as to where to begin. Hopefully you can help me more. Thanks and greetings.
  • API for Map image

    3
    0 Votes
    3 Posts
    616 Views
    S
    @Temisola1 See https://forum.magicmirror.builders/topic/12376/mmm-tomtomtraffic
  • Module UI Design

    4
    0 Votes
    4 Posts
    1k Views
    S
    @Temisola1 what do you mean inherit the master? you don’t need to create any new tags… (the forum doesn’t like < , so I will skip it for this discussion) head fddfd /head body div p>some text table tr td td td /tr /div the part that starts with div, thru end div, you can insert into the wrapper div innerHtml head and body are controlled by MM there are default classes in ~/MagicMirror/css/main.css you can add more by adding them to ~/MagicMirror/css/custom.css you can also have a css file local to the module folder, and include it with the getStyles() method response (and those can be overridden in the custom.css) Give it a try, you’ll get it pretty quick