MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. Serge
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 1
    • Followers 1
    • Topics 10
    • Posts 64
    • Groups 0

    Serge

    @Serge

    9
    Reputation
    563
    Profile views
    64
    Posts
    1
    Followers
    1
    Following
    Joined
    Last Online

    Serge Unfollow Follow

    Best posts made by Serge

    • MMM-MQTTbridge

      TOPIC MOVED. PLEASE FOLLOW THE LINK BELOW FOR THE MODULE UPDATES, INQUIRIES, ETC
      [MMM-MQTTbridge] A module to publish and receive MQTT messages.



      MMM-MQTTbridge

      https://github.com/Tom-Hirschberger/MMM-MQTTbridge

      MMM-MQTTbridge allows you to integrate your MagicMirror into your smart home system via MQTT protocol and manage MagicMirror via MQTT messages by converting them into MM Notifications and vise verse - listen to your MM’s Notifications and convert them into MQTT mesages.

      So, this module for MagicMirror do the following:

      • Listens to MQTT messages from your MQTT broker and, if mqtt-message arrives, module sends MM Notifications based on the pre-configured mqtt-to-notification Dictionary rules.
      • Listens to the MM Notifications within your MagicMirror environment. If Notification arrives, module sends MQTT message based on the preconfigured notification-to-mqtt Dictionary rules.

      module_logo

      DOWNLOAD

      Tom-Hirschberger/MMM-MQTTbridge

      CONFIG STRUCTURE

      For better understanding, we have divided config into 3 sections:

      1. General configurations in config.js;
      2. “NOTIFICATION to MQTT” dictionary rules;
      3. “MQTT to NOTIFICATION” dictionary rules;
      GENERAL SECTION
      {
      	module: 'MMM-MQTTbridge',
      	disabled: false,
      	config: {
      		mqttServer: "mqtt://:@localhost:1883",
      		mqttConfig:
      		{
      			listenMqtt: true,
      			interval: 300000,
      		},
      		notiConfig:
      		{
      			listenNoti: true,
      			ignoreNotiId: ["CLOCK_MINUTE", "NEWS_FEED"],
      			ignoreNotiSender: ["SYSTEM", "NEWS_FEED"],
      		},
      		// set "NOTIFICATIONS -> MQTT" dictionary at /dict/notiDictionary.js
      		// set "MQTT -> NOTIFICATIONS" dictionary at /dict/mqttDictionary.js
      	},
      },
      

      GENERAL part

      • mqttServerset you server address using the following format: “mqtt://”+USERNAME+“:”+PASSWORD+“@”+IPADDRESS+“:”+PORT. E.g. if you are using your broker without username/password on localhost with port 1883, you config should looks “mqtt://:@localhost:1883”.

      MQTT part

      • listenMqtt - turn on/off the listening of MQTT messages. Set to false if you are going to use only NOTI->MQTT dictionary to save CPU usage;
      • interval - interval for MQTT status update, default is 300000ms.
        (topics for subscription are taken from mqttDictionary.js

      NOTIFICATION part

      • listenNoti - turn on/off the listening of NOTIFICATIONS. Set to false if you are going to use only MQTT->NOTI dictionary to save CPU usage;
      • ignoreNotiId - list your NOTIFICATION ID that should be ignored from processing, this saves CPU usage. E.g. [“CLOCK_MINUTE”, “NEWS_FEED”],
      • ignoreNotiSender - list your NOTIFICATION SENDERS that should be ignored from processing, this saves CPU usage. E.g. [“system”, “NEWS_FEED”]

      NOTIFICATIONS to MQTT DICTIONARY SECTION

      Should be set within ~/MagicMirror/modules/MMM-MQTTbridge/dict/notiDictionary.js

      If payloadValue is empty, the actual payload of the notification will be used as MQTT payload.
      If payloadValue is specified and matches the payload received via the notification, mqttMsgPayload will be used as MQTT payload.

      var notiHook = [
        {
          notiId: "CLOCK_SECOND",
          notiPayload: [
            {
              payloadValue: '10',
              notiMqttCmd: ["Command 1"]
            },
            {
              payloadValue: '20',
              notiMqttCmd: ["Command 2"]
            },
            {
              payloadValue: '30', 
              notiMqttCmd: ["Command 1"]
            },
          ],
        },
      ];
      var notiMqttCommands = [
        {
          commandId: "Command 1",
          mqttTopic: "myhome/kitchen/light/set",
          mqttMsgPayload: '{"state":"OFF"}'
        },
        {
          commandId: "Command 2",
          mqttTopic: "myhome/kitchen/light/set",
          mqttMsgPayload: '{"state":"ON"}'
        },
      ];
      

      MQTT to NOTIFICATIONS DICTIONARY SECTION

      Should be set within ~/MagicMirror/modules/MMM-MQTTbridge/dict/mqttDictionary.js

      If payloadValue is empty, the actual payload of the MQTT message will be used as notification payload.
      If payloadValue is specified and matches the payload received via MQTT, notiPayload will be used as notification payload.

      var mqttHook = [
          {
            mqttTopic: "dahoam/test",
            mqttPayload: [
              {
                payloadValue: "ASSISTANT_LISTEN",
                mqttNotiCmd: ["Command 1"]
              },
              {
                payloadValue: "",
                mqttNotiCmd: ["Command 2"]
              },
            ],
          },
          {
            mqttTopic: "dahoam/test2",
            mqttPayload: [
              {
                payloadValue: "",
                mqttNotiCmd: ["Command 2"]
              },
            ],
          },
        ];
      var mqttNotiCommands = [
          {
            commandId: "Command 1",
            notiID: "ASSISTANT_LISTEN",
            notiPayload: 'BLABLABLA-1'
          },
          {
            commandId: "Command 2",
            notiID: "ASSISTANT_LISTEN",
            notiPayload: ''
          },
        ];
      

      TESTED ENVIRONMENT

      • Raspberry Pi 3 B+;
      • Clean Updated Upgarded Raspbian Buster;
      • MagicMirror ^2.10.1;
      • mqtt-broker eclipse-mosquitto run in docker on the same RPi;
      • mqtt-client on Windows10.

      CREDITS

      • @Thomas Hirschberger
      • @bugsounet
      • @sergge1
      • @DanielHfnr

      https://github.com/Tom-Hirschberger/MMM-MQTTbridge

      posted in System
      SergeS
      Serge
    • RE: User Friendly Magic Mirror?

      @tripalreno4 here is how to make the user-friendly web interface to connect you RPi to WiFi network.
      https://lemariva.com/blog/2019/02/raspberry-pi-cups-printer-server-using-docker. Follow until CUPS installation.

      After installation, your RPi will create its own wifi access point (AP) if no known wifi identified by RPi.
      When AP created, User connects to it, goes to
      http://192.168.27.1 and enter his wifi credentials using simple web interface (scan->select->enter password).
      Worked for me.
      I have made some visual adjustment and it looks like:
      alt text

      posted in General Discussion
      SergeS
      Serge
    • RE: config.js in JSON format

      @lavolp3
      @sdetweil
      @Sean
      here is a short video of what is done at the moment.
      https://youtu.be/6w6Uovy9hbE

      So what I have:

      1. Webserver which is based on the asws webserver. Updated version for MagicMirror is here. Changes made to cmd/asws.go file only.
        Download git

      2. build docker container from it (go to asws directory and run " docker build -t asws_new ."

      3. Clone to home/pi/www sample web-interface for MagicMirror clock module settings. It is bases on free SB Admin 2 bootstrap template.
        Git includes js/settings.js which is necessary for make everything works. Git is here: https://github.com/sergge1/www

      4. Run with a folloing command a docker container build in point 2 above: sudo docker run -d --restart unless-stopped -e DEBUG=true -p 80:80 -v $(pwd)/www:/www asws_new

      Sample config.js from video is located at www/config.js

      screenshot below:
      photo-2019-10-24-18-04-49

      posted in Feature Requests
      SergeS
      Serge
    • MMM sensor+WS2812b and MM CONFIG RESET button

      This app was made to add some kind functionality to Magicmirrors run on RPis.

      App allows you to:

      • control LED strip by sensor and also
      • rreset MagicMirror’s config.js file with a hardware button connected to Raspberry (so config should be set to default values). The operation will be confirmed by three red light blinks.
        Here is short video (press on pic)
        Raspberry

      Installation

      1. Download and install the latest ws2812b library to your Raspberry:
      • sudo pip install rpi-ws281x
      1. Clone the repository : git clone https://github.com/sergge1/MMM-senorled
      2. Enter the repository: cd MMM-senorled/
      3. Edit parameters in configuration section of the *.py file: numbers of LED and GPIO pins
        5 Run the app with: sudo python sensorbtnled.py

      Hardware used:

      LED strip WS2812b https://www.aliexpress.com/item/32820628563.html

      Buttons https://www.aliexpress.com/item/33060639491.html

      Movement sensor RCWL-0516 https://www.aliexpress.com/item/32816228153.html

      Option Description
      SHUTOFF_DELAY Delay in seconds for sensor state change, e,g, how long the LED will light after no movement detected. The default value is 5.
      PIR_PIN GPIO pin number to which the sensor is connected. The default value is 11.
      LED_COUNT Number of LEDs connected to the strip. The default value is 160.
      LED_PIN GPIO pin number to which the LED data line is connected. The default value is 21
      LED_BRIGHTNESS Britness of LED lights. 0 is no light, 255 is the maximum brightness. The default value is 255.
      copy [] set of files which should be rewritten. The default value is ['/home/pi/MagicMirror/config/config.js.sample', '/home/pi/MagicMirror/config/config.js.sample'].
      writePin GPIO pin to which hardware button is conected (Other button pin is connected to any GND. The default value is 3.

      and here is description and GIT
      [card:sergge1/MMM-senorled]

      Any ideas and comments are appreciated.
      As well as your direct pull requests to the project on the github page.

      posted in System
      SergeS
      Serge
    • RE: LED display shines through

      @Sean said in LED display shines through:

      VA

      sorry for misunderstanding.
      I kept in mind and thought about VA but typed PLS.
      Of course the diff in IPS and VA is visible especially in dark color, due to the higher contrast in the last one.
      You are right.
      Late response speed is not an issues for MM projects I think.

      posted in Hardware
      SergeS
      Serge
    • RE: My magic mirror project

      @mmcghee I am using 5v 12a ac/dc power supply inside the frame.
      It is used for power of RPi, sound amplifier with 2 speakers, 2.5m of ws2812b LED strip. Also I have built in mic and pir sensor and Bluetooth module (external). Also 3 physical buttons: power off everything, RPi reset and turnoff LED strip.

      posted in General Discussion
      SergeS
      Serge
    • RE: MMM-MQTTbridge

      @wishmaster270 done.

      posted in System
      SergeS
      Serge

    Latest posts made by Serge

    • RE: MMM-MQTTbridge

      @wishmaster270 done.

      posted in System
      SergeS
      Serge
    • RE: Home Assistant integration

      @fribse mmm-googleassistant maintained by Mr.@bugsounet works well)

      posted in General Discussion
      SergeS
      Serge
    • RE: MMM-Remote-Control: default hidden

      @DigiDadbod that module’s behaviour is correct. It saves all the changes for the current run. Restarting means all settings are ready from the config.js so the MM starts with default setting, not changed by RC

      posted in Utilities
      SergeS
      Serge
    • RE: "No Signal" message when PIR sensor is triggered

      @steverichab with mmm-remotecontrol you can “hide” all modules. So you will get a clear black screen without “no signal” message.

      posted in Troubleshooting
      SergeS
      Serge
    • Telegram chat for MagicMirror builders

      Have not found Telegram chat for MM.
      Only italian community identified.

      So have created for global chatting.

      t.me/magicmirrorglobal

      posted in General Discussion
      SergeS
      Serge
    • RE: Notification issued from MMM-MQTTbridge but nothing happens

      @fribse resolved on GitHub.

      posted in Troubleshooting
      SergeS
      Serge
    • RE: MMM-MQTTbridge doesn't seem to report USER_PRESENCE correctly?

      @fribse resolved on github, the reason is that for Boolean values the payloadValue should be set up as 1 or 0 for true/false.

      posted in Troubleshooting
      SergeS
      Serge
    • RE: Notification issued from MMM-MQTTbridge but nothing happens

      @fribse said in Notification issued from MMM-MQTTbridge but nothing happens:

      notiID: “‘REMOTE_ACTION’”,

      Try to remove double quotes here in config

      posted in Troubleshooting
      SergeS
      Serge
    • RE: Notification issued from MMM-MQTTbridge but nothing happens

      @fribse said in Notification issued from MMM-MQTTbridge but nothing happens:

      0|mm | [MQTT bridge] MQTT message received. Topic: bathroom/mirror, message: MONITOROFF
      0|mm | [2020-10-16 09:23:53.728] [LOG]
      0|mm | [MQTT bridge] MQTT -> NOTI issued: ‘REMOTE_ACTION’, payload: {action: ‘MONITOROFF’ }

      Seems that mqttbridg isseued the predefined noti so the problem is with nite receiving by remcontrol or with noti processing by remote control.
      Send as well console log here

      posted in Troubleshooting
      SergeS
      Serge
    • RE: MMM-MQTTbridge doesn't seem to report USER_PRESENCE correctly?

      @fribse please send here as well console log. Also, could you please wait and check wat is happening when FALSE is sent by user_presence for the second time.
      E.g. it would help full to see behaviour : false, true, … false

      posted in Troubleshooting
      SergeS
      Serge