MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-MQTTbridge

    Scheduled Pinned Locked Moved Unsolved System
    44 Posts 14 Posters 16.3k Views 15 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      chimera
      last edited by

      This is perfect!!! Thanks so much! I run OpenHAB and utilise MQTT quite heavily. However I don’t like MQTT persistence, as it doesn’t work for me in OpenHAB. I run MMM-MQTT module in MM, but the problem with that is, when MagicMirror starts up it doesn’t display MQTT topic payload, as many MQTT updates I get are on intermittent basis (eg: swimming pool temperature, only updates if it changes, garden sprinkler last run, only updates when it’s run etc) So I’ve used this with MMM-Pages (I have several MM screens) and the 2nd page has mostly OpenHAB related info that I want to display. So I use the Notification ‘PAGE_CHANGED’ with payload = 1 (as pages start from 0) to publish an MQTT message of openhab/magicmirror/requestmqtt = ON. This is tied to a switch item in OpenHAB, and a rule in OpenHAB detects when the switch gets turned on, and in turn publishes a list of latest home automation data out to MQTT, which gets picked up and displayed on Magic Mirror. Prior to this, I would have a lot of items with “updating…” and had to wait until the device sent its latest information to MQTT.

      This covers all bases and more. I can see this becoming a very powerful little module!

      Thanks again!

      1 Reply Last reply Reply Quote 0
      • SergeS Offline
        Serge
        last edited by

        @chimera said in MMM-MQTTbridge:

        eg: swimming pool temperature, only updates if it changes, garden sprinkler last run, only updates when it’s run, etc

        As far as I understood you, you need to issue some NOTI during the MM/Module startup, right?
        How would be the best option to do that? One possible solution is to have a file with the list of topics (e.g. “swimmingpool/temp/status”, “gardenspirnkler/run/status”) to which MQTTbrdige will send the mqtt-messages at startup.
        Will this solve your problem with the integration of MM to your smart home?

        1 Reply Last reply Reply Quote 0
        • SergeS Offline
          Serge @oberpiller
          last edited by Serge

          @oberpiller said in MMM-MQTTbridge:

          Is it possible to get variables (from “arrays”) into the mqttMsgPayload variable of NotiDictionary.js?

          nope. I will think about it.
          should it work somehow like that:
          In notiMqtt dict should be specified whether we are using variable or not and, if yes, use it:

          var notiMqttCommands = [
            {
              commandId: "Command 1",
              mqttTopic: "myhome/kitchen/light/set",
              useVariables: true, //added new setting to the dict to 
              mqttMsgPayload: ARTICLE_INFO_RESPONSE //if useVriables=true, put here the variable name. If useVariable=false or not stated - mqttMsgPayload will send "ARTICLE_INFO_RESPONSE" in its payload.
            },
          ];
          
          
          SergeS 1 Reply Last reply Reply Quote 0
          • SergeS Offline
            Serge @Serge
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • S Offline
              shinebright
              last edited by

              When i publish 1 message, it’s receiving it multiple times for some reason. Do i need to be worried?
              screenshot

              SergeS 1 Reply Last reply Reply Quote 0
              • SergeS Offline
                Serge @shinebright
                last edited by

                @shinebright should produce one note per each mqtt message, check your settings once more or try to install on clean mm setup.

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  shinebright @Serge
                  last edited by

                  @Serge got it thanks! i’ll give that a try. awesome module by the way, i managed to change some of your codes along with the compliments module. Now I’m sending messages from my phone to update the mirror compliments and the kids think the mirror is replying back to them. :)

                  SergeS 1 Reply Last reply Reply Quote 1
                  • SergeS Offline
                    Serge @shinebright
                    last edited by

                    @shinebright what you had changed? Could you tell soi can add it as an option for the next releases

                    1 Reply Last reply Reply Quote 0
                    • F Offline
                      fribse
                      last edited by

                      Hi @Serge
                      I’ve finally received the mirror itself, so now the MagicMirror is finally getting finished.
                      One of the things was to update the MM itself, as well as a few modules (screencast).
                      After doing that, I don’t see any mqtt status messages going out, and it doesn’t react on incoming either.
                      I’ve checked the username/password, still correct, and the IP hasn’t changed either?

                      SergeS 1 Reply Last reply Reply Quote 0
                      • SergeS Offline
                        Serge @fribse
                        last edited by Serge

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 3 / 5
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy