Closed SaschaSp closed 2 years ago
Hi,
as assumed already the mqttDictionary.js
does not suit your case cause it contains the old definition that was used to let the payload be passed as notification payload (payloadValue=''
).
I updated MMM-Temperature to version 0.0.7 which supports JSON in version 5 now. I am not sure if it is needed for your case but i suggest to update the module.
With the following mqttDitionary.js
everything should work again:
var mqttHook = [
{
mqttTopic: "Cotech",
mqttPayload: [
{
mqttNotiCmd: ["COTECH"],
},
],
},
];
var mqttNotiCommands = [
{
commandId: "COTECH",
notiID: "TEMPERATURE_VALUES_Cotech",
},
];
module.exports = { mqttHook, mqttNotiCommands};
Yes, youre right. Updated MMM_Temperature and remove payloadValue & mqttPayload from mqttDictionary.js
It`s working great again, thank you.
Values stay´s empty (na) displayed on MM after updating MMM-MQTTbridge
mqttDictionary.js
var mqttHook = [ { mqttTopic: "Cotech", mqttPayload: [ { payloadValue: "", mqttNotiCmd: ["COTECH"], mqttPayload: "" }, ], }, ]; var mqttNotiCommands = [ { commandId: "COTECH", notiID: "TEMPERATURE_VALUES_Cotech", }, ]; module.exports = { mqttHook, mqttNotiCommands};
notiDictionary.js
var notiHook = [ { notiId: "USER_PRESENCE", notiPayload: [ { payloadValue: true, notiMqttCmd: ["SCREENON"] }, { payloadValue: false, notiMqttCmd: ["SCREENOFF"] }, ], }, { notiId: "INDOOR_TEMPERATURE", notiPayload: [ { payloadValue: '', notiMqttCmd: ["Command 2"] }, ], }, ]; var notiMqttCommands = [ { commandId: "SCREENON", mqttTopic: "magicmirror/state", mqttMsgPayload: '{"state":"ON"}' }, { commandId: "SCREENOFF", mqttTopic: "magicmirror/state", mqttMsgPayload: '{"state":"OFF"}' }, { commandId: "Command 1", mqttTopic: "magicmirror/state", mqttMsgPayload: '{"state":"OFF"}' }, { commandId: "Command 2", mqttTopic: "magicmirror/state", mqttMsgPayload: '' }, ];
module.exports = { notiHook, notiMqttCommands };
Part from config.js
JS-Objekt
{humidity: 93, rain_mm: 98.700, wind_dir_deg: 262, wind_avg_m_s: 1.300, wind_max_m_s: 2.000, temperature_C: 7.555555555555556}
pm2 log
0|mm | MMM-Temperature: Updating sensor values 0|mm | [26.11.2022 13:03.07.649] [LOG] Sending temp update: [{"error":false}] 0|mm | [26.11.2022 13:03.07.654] [LOG] Removing values of sensor with name: Aktuelle Aussenwerte 0|mm | [26.11.2022 13:03.12.267] [LOG] 0|mm | [MQTT bridge] MQTT message received. Topic: Cotech, message: {"humidity":93,"rain_mm":98.7,"wind_dir_deg":306,"wind_avg_m_s":1.2,"wind_max_m_s":2,"temperature_C":7.555555555555556} 0|mm | [26.11.2022 13:03.12.291] [LOG] [MQTT bridge] MQTT message received. Topic: Cotech, message: {"humidity":93,"rain_mm":98.7,"wind_dir_deg":306,"wind_avg_m_s":1.2,"wind_max_m_s":2,"temperature_C":7.555555555555556} 0|mm | [26.11.2022 13:03.27.985] [LOG]