MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    1. Home
    2. sdmydbr9
    3. Topics
    S
    • Profile
    • Following 1
    • Followers 2
    • Topics 9
    • Posts 36
    • Best 2
    • Controversial 0
    • Groups 0

    Topics created by sdmydbr9

    • S

      Drunk AI
      Showcase • • sdmydbr9

      1
      0
      Votes
      1
      Posts
      161
      Views

      S

      Recently I came across this awesome module MMM-OpenAI, I have posted earlier with a short demo and YouTube link for the full demo. and I decided to do something fun, I was not expecting it to turn out this way, I have detailed the step by step instructions in the GitHub to set this up, Iam not from a technical background therefore the codes are not really polished and there maybe issues but I tried by best to be thorough in the instructions as much as possible, I’m sure someone else will come up with better idea to implement this, here is the link Drunk AI repo
      At the moment it’s quite slow and it will get faster will more enhancements

      Detailed instructions:
      Drunk-AI

      This is an integration of OPENAI chatgpt in the magicmirror. Demo below watch the full demo here ([https://youtu.be/eDcc7zqAFwE]) This is the initial version, I am not from a technical background therefore if the codes and scripts are little off the charts or there is a way to enhance it feel free to send PR. I admit this is quite messy and little long process to set up but in the end its worth it.

      Download the shortcuts linked below and configure it with the api key from MMM-RemoteControl
      more info here ([https://github.com/Jopyth/MMM-Remote-Control.git])

      ios shortcuts link

      ([https://www.icloud.com/shortcuts/8a0e7600808d45eb9616dae8105653ef])

      EDIT THE DOWNLOADED SHORTCUT with your magicmirror ip address AND REPLACE apikey in the text with your api key from MMM-RemoteControl. you need to run this shortcuts every time you want to interact with the chatgpt, or you can use the default telegram commands but that is without voice input, hotword detection will be added soon. When you run this shortcuts, the mirror with update with jarvis animation and text saying “say something”, you have to speak in the microphone after you see Say something and if the audio was captured successfully, it will update with the spoken text. the listening duration is set to 4 seconds by default, you can adjust this by editing the transcript.py in the MMM-Chat module mentioned below. Install and configure MMM-Chat from here ([ https://github.com/sdmydbr9/MMM-Chat]) Install MMM-NotificationTrigger ([https://github.com/MMRIZE/MMM-NotificationTrigger.git]) Add the following lines to the config { module: 'MMM-NotificationTrigger', config: { triggers: [ { trigger: 'SHOW_ALERT', fires: [ { fire: 'MY_COMMAND', exec: (payload) => `python3 /home/pi/MagicMirror/modules/MMM-11-TTS/main.py "${payload.message}"` } ] } ] } }, Install MMM-OpenAI from here ([https://github.com/MMRIZE/MMM-OpenAI.git])

      Add the following in your config

      { module: "MMM-OpenAI", position: 'top_right', config: { defaultChatInstruction: "Your name is Marvin and you are a paranoid android that reluctantly answers questions with sarcastic responses.", stealth: true, // <- This is needed to hide default module view. postProcessing: function (handler, responseObj) { if (responseObj.error) return // When the error happens, just do nothing. let method = responseObj.options.method let alertPayload = { title: responseObj.request.prompt, imageUrl: (method === 'IMAGE') ? responseObj.response.data[0].url : null, message: (method === 'TEXT') ? responseObj.response.choices[0].text : ((method === 'CHAT') ? responseObj.response.choices[0].message.content : null), timer: 2 * 1000 } handler.sendNotification('SHOW_ALERT', alertPayload) } } }, Clone the following respository ([https://github.com/sdmydbr9/MMM-11-TTS]) in your modules folder and install it according to instruction edit the main.py and add your api key and voice id, a voice id as already set by default, you can add any voice id, refer elevenlabs api doc for more details. Disclaimer: Even though the quality of the output of their voice is far superior to GOOGLE TTS, the character limit is very limited, 10,000 characters per month per account, I hope they will offer more in future, or you can opt for a paid account and get around 30,000 characters as well as voice cloning features, clone any voice you want, for example clone the voice of jarvis and transform your magicmirror into jarvis. just add the voice ID in the main.py and youre good to go. Disclaimer 2: The above module works in my test but it is not very efficient since the script will first downlaod the audio from the api request and convert it using fmpeg and play the audio as output. Depends on fmpeg. Install it if you dont have it installed using apt This whole implementation maybe possible to be implemented in a single module, I hope someone will try to make this in a single module and less messy
    • S

      Chatgpt+google STT + elevenlabs api
      Showcase • • sdmydbr9

      8
      1
      Votes
      8
      Posts
      580
      Views

      S

      @soldatino okay, I think it’s because you are using a different username it’s breaking. I will try to add the config options to set the files path in the coming days, for now just check you nodehelper of MMM-Chat.js line 21 and let me know if that helps. You will have to set it to your correct absolute path. Cheers.

    • S

      SOLVED Notifications help
      Troubleshooting • • sdmydbr9

      7
      0
      Votes
      7
      Posts
      171
      Views

      S

      @sdetweil
      Got it thanks

    • S

      SOLVED Need help creating a module.
      Requests • • sdmydbr9

      6
      0
      Votes
      6
      Posts
      154
      Views

      mumblebaj

      @sdmydbr9 Awesome. Glad we could help

    • S

      UNSOLVED Compliment from calendar event
      Troubleshooting • • sdmydbr9

      5
      0
      Votes
      5
      Posts
      176
      Views

      S

      @MMRIZE

      { classes: "default scheduler", module: "compliments_plus", position: "middle_center", disabled: false, config: { module_schedule: {from: '0-59/10 * * * *', to: '5-59/10 * * * *'}, updateInterval: 30000, remoteFile: null, fadeSpeed: 4000, random: true, mockDate: null, classes: "compliments_plus thin large pre-line", // the beginning of the day period morning: 5, noon: 12, afternoon: 15, evening: 18, night: 22, midnight: 1, compliments: { "AQI_1" : [ "<i class=\"fa fa-leaf lime\"></i> Air Quality Good", ], "AQI_2" : [ "<i class=\"fa fa-leaf yellow\"></i> Air Quality Fair, mask on", ], "AQI_3" : [ "<i class=\"fa fa-leaf orange\"></i> Air Quality Moderate, mask on", ], "AQI_4" : [ "<i class=\"fa fa-leaf orangered\"></i> Air Quality Poor, need air purifier", ], "AQI_5" : [ "<i class=\"fa fa-leaf redrf\"></i> Air Quality Unhealty, dont breathe", ], "25-12-...." : [ "<i class=\"fa fa-snowman\"></i> Marry Christmas!" ], "01-01-....": [ function() {return "<i class=\"fa fa-glass-cheers\"></i> Happy New Year! " + moment().format("YYYY")} ], "..-..-....": [ function() {return moment().locale(config.language).format("dddd, D MMMM")} ], } }, },

      The config for the module

    • S

      Module status
      Troubleshooting • • sdmydbr9

      4
      0
      Votes
      4
      Posts
      279
      Views

      S

      @sdmydbr9 said in Module status:

      I am not able to get the state command because I couldn’t find any so my set up is incomplete.

      so, your statement is that the MMM-RemoteControl module does not provide a mechanism to determine if a module (by name) is hidden or not

      sorry, don’t know about the internals of MMM-RemoteControl

    • S

      Google tts
      Troubleshooting • • sdmydbr9

      1
      0
      Votes
      1
      Posts
      96
      Views

      S

      Has the google tts module stoped working or is it just me. I’m having trouble getting it to work. Here is my debug

      1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 2 info using npm@6.14.11 3 info using node@v10.24.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle magicmirror@2.13.0-develop~prestart: magicmirror@2.13.0-develop 6 info lifecycle magicmirror@2.13.0-develop~start: magicmirror@2.13.0-develop 7 verbose lifecycle magicmirror@2.13.0-develop~start: unsafe-perm in lifecycle true 8 verbose lifecycle magicmirror@2.13.0-develop~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/MagicMirror/node_modules/.bin:/home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games 9 verbose lifecycle magicmirror@2.13.0-develop~start: CWD: /home/pi/MagicMirror 10 silly lifecycle magicmirror@2.13.0-develop~start: Args: [ '-c', 10 silly lifecycle 'DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js' ] 11 info lifecycle magicmirror@2.13.0-develop~start: Failed to exec start script 12 verbose stack Error: magicmirror@2.13.0-develop start: `DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js` 12 verbose stack spawn ENOENT 12 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18) 12 verbose stack at ChildProcess.emit (events.js:198:13) 12 verbose stack at maybeClose (internal/child_process.js:982:16) 12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) 13 verbose pkgid magicmirror@2.13.0-develop 14 verbose cwd /home/pi/MagicMirror 15 verbose Linux 5.10.17-v7l+ 16 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 17 verbose node v10.24.0 18 verbose npm v6.14.11 19 error code ELIFECYCLE 20 error syscall spawn 21 error file sh 22 error errno ENOENT 23 error magicmirror@2.13.0-develop start: `DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js` 23 error spawn ENOENT 24 error Failed at the magicmirror@2.13.0-develop start script. 24 error This is probably not a problem with npm. There is likely additional logging output above. 25 verbose exit [ 1, true ]

      I have zero knowledge to debug this issue, someone please look into this and let me know of a solution if there is any.
      Thanks

    • S

      i cant figure out what i did wrong, fresh installation of raspberry pi os on raspberry pi4 ..
      Troubleshooting • • sdmydbr9

      6
      0
      Votes
      6
      Posts
      237
      Views

      ?

      Hi, I have deprecied MMM-AssistantMk2 and will still in a very old version.
      Maybe using MMM-GoogleAssistant / MMM-Assistant2Display can help for a modern assistant

    • S

      mmm assistant mk2
      Troubleshooting • • sdmydbr9

      112
      0
      Votes
      112
      Posts
      5123
      Views

      D

      @mcretu Hi . Lost in the Post.
      I think you refer to youtube not being displayed.
      If that is the case, as @Bugsounet keeps saying (he said it to me about this…), red the wiki. It’s all there.

      you need to change the config.js in config as follows:
      https://github.com/bugsounet/MMM-Assistant2Display/wiki/Configuration

      Assistant2Display need electron special configuration for web link displaying and Youtube functionality start of the config.js configuration file var config = { address: "localhost", electronOptions: { webPreferences: { webviewTag: true } }, port: 8080, ... address should be localhost for playing YouTube video electronOptions is need if you want to display the link and Cast module
    • 1 / 1