MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

Notification issued from MMM-MQTTbridge but nothing happens



  • As I posted elsewhere, after find the logs, I could get the errors removed, so now it posts the notification to REMOTE_ACTION, but nothing happens:

    It does receive the MQTT command, but nothing happens on the NOTI:

    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' }
    

    Same thing happens for MONITORON, DIM and UNDIM.

    The mqttdictionary file looks like this now:

    var mqttHook = [
        {
          mqttTopic: "bathroom/mirror",
          mqttPayload: [
            {
              payloadValue: "MONITOROFF",
              mqttNotiCmd: ["MONITOROFF"]
            },
            {
              payloadValue: "MONITORON",
              mqttNotiCmd: ["MONITORON"]
            },
            {
              payloadValue: "UNDIM",
              mqttNotiCmd: ["UNDIM"]
            },
            {
              payloadValue: "DIM",
              mqttNotiCmd: ["DIM"]
            },
          ],
        },
      ];
    var mqttNotiCommands = [
        {
          commandId: "MONITOROFF",
          notiID: "'REMOTE_ACTION'",
          notiPayload: "{action: 'MONITOROFF' }"
        },
        {
          commandId: "MONITORON",
          notiID: "'REMOTE_ACTION'",
          notiPayload: "{action: 'MONITORON' }"
        },
        {
          commandId: "DIM",
          notiID: "'REMOTE_ACTION'",
          notiPayload: "{action: 'BRIGHTNESS', value: '50')"
        },
        {
          commandId: "UNDIM",
          notiID: "'REMOTE_ACTION'",
          notiPayload: "action: 'BRIGHTNESS', value: '255'}"
        },
      ];
    
      module.exports = { mqttHook,  mqttNotiCommands};
    

    And the notification looks just like the one here in the documentation example here:

    this.sendNotification('REMOTE_ACTION', {action: 'RESTART'});
    

    The ipWhitelisting has been both tried with [(“127.0.0.1”,“localhost”,“my.ip.range.0/24”)] and also with just [].
    I can issue the commands MONITOROFF/MONITORON directly in the Remote-Control menu at /remote.html

    Any input from the developers on this? @Serge , @Bugsounet, @Jopyth 🙂

    Is it a MMM-MQTTbridge problem or a MMM-Remote-Control problem?



  • @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



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

    notiID: “‘REMOTE_ACTION’”,

    Try to remove double quotes here in config



  • @fribse resolved on GitHub.



  • And again, Serge sharp eyes found the errors. I was somply trying to hard to add quotes and stuff so it got messed up.
    The working config for receiving commands from Home Assistant looks like this now:

    var mqttHook = [
        {
          mqttTopic: "cmnd/bathroom/mirror",
          mqttPayload: [
            {
              payloadValue: "MONITOROFF",
              mqttNotiCmd: ["MONITOROFF"]
            },
            {
              payloadValue: "MONITORON",
              mqttNotiCmd: ["MONITORON"]
            },
            {
              payloadValue: "UNDIM",
              mqttNotiCmd: ["UNDIM"]
            },
            {
              payloadValue: "DIM",
              mqttNotiCmd: ["DIM"]
            },
          ],
        },
      ];
    var mqttNotiCommands = [
        {
          commandId: "MONITOROFF",
          notiID: 'REMOTE_ACTION',
          notiPayload: {action: 'MONITOROFF'}
        },
        {
          commandId: "MONITORON",
          notiID: 'REMOTE_ACTION',
          notiPayload: {action: 'MONITORON'}
        },
        {
          commandId: "DIM",
          notiID: 'REMOTE_ACTION',
          notiPayload: {action: 'BRIGHTNESS', value: '50'}
        },
        {
          commandId: "UNDIM",
          notiID: 'REMOTE_ACTION',
          notiPayload: {action: 'BRIGHTNESS', value: '255'}
        },
      ];
    
      module.exports = { mqttHook,  mqttNotiCommands};
    

Log in to reply