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 mqttNotiCommands not triggering

    Scheduled Pinned Locked Moved Utilities
    2 Posts 1 Posters 366 Views 1 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.
    • A Offline
      antsve
      last edited by antsve

      I’ve been pulling my hair the last few days sinces i cant for the life of me figure out where i went wrong and would appricitate some help.

      What i’m trying to acchive is that when PIR-sensor in Home-Assistant (HA) detects presence it send MQTT to home-assistant/MagicMirror2 with payload “USER_PRESENCE_TRUE” wich then should trigger mqttNotiCommands to send MM MQTT–> NOTI USER_PRESENCE: 1.

      The MQTT is recceived and printed in log but then nothing happens.

      2020-11-19 06:05:16.563] [LOG]    [MQTT bridge] MQTT message received. Topic: home-assistant/MagicMirror2, message: USER_PRESENCE_TRUE
      

      As I said I cant for the LIFE of me figure out where the typo or error is and would appriciate your help!

      my config:

      module: 'MMM-MQTTbridge',
      	disabled: false,
      	config: {
      		mqttServer: "mqtt://10.0.1.15: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
      	},
      

      mqttDicitionary.js

      var mqttHook = [
          {
            mqttTopic: "home-assistant/MagicMirror2",
            mqttPayload: [
              {
                payloadValue: "USER_PRESENCE_TRUE",
                mqttNotiCmd: ["USER_PRESENCE_TRUE"]
              },
              {
                payloadValue: "USER_PRESENCE_FALSE",
                mqttNotiCmd: ["USER_PRESENCE_FALSE"]
              },
            ],
          },
         ];
             
      var mqttNotiCommands = [
          {
            commandId: "USER_PRESENCE_TRUE",
            notiID: "USER_PRESENCE",
            notiPayload: '1'
          },
          {
            commandId: "USER_PRESENCE_FALSE",
            notiID: "USER_PRESENCE",
            notiPayload: '0'
          },
        ];
      
        module.exports = { mqttHook,  mqttNotiCommands};
      
      A 1 Reply Last reply Reply Quote 0
      • A Offline
        antsve @antsve
        last edited by

        Yey and behold, it works. Like magic, no config change. Kind of frustrating but lets put this post behind us.

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • 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