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