Repository navigation
Description
Environment
System Information
- SYSTEM: manufacturer: Raspberry Pi Foundation; model: Raspberry Pi 5 Model B Rev 1.0; virtual: false; MM: v2.35.0
- OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.12.75+rpt-rpi-2712
- VERSIONS: electron: 41.1.0; used node: 22.21.1; installed node: 22.21.1; npm: 10.9.4; pm2: 6.0.14
- ENV: XDG_SESSION_TYPE: tty; MM_CONFIG_FILE: undefined
WAYLAND_DISPLAY: undefined; DISPLAY: :0; ELECTRON_ENABLE_GPU: undefined - RAM: total: 8059.06 MB; free: 6885.11 MB; used: 1173.95 MB
- OTHERS: uptime: 931 minutes; timeZone: Europe/Berlin
Which start option are you using?
node --run start
Are you using PM2?
Yes
Module
None
Have you tried disabling other modules?
- Yes
- No
Have you searched if someone else has already reported the issue on the forum or in the issues?
- Yes
What did you do?
Configuration
{
module: "MMM-ValuesByNotification",
position: "top_right",
//header: "Sensors",
config: {
debug: true,
animationSpeed: 0,
updateInterval: 90,
valuePositions: "tivu",
classes: "environment",
naValue: "na.na",
valueFormat: "Number(${value}).toFixed(1)",
transformerFunctions: {
zisterneAddPercent: (value) => {
return value+"l ("+(Number(value/1600)*100).toFixed(0)+"%)"
},
rountToInt: (value) => {
try {
return Math.round(parseFloat(value))
} catch {
return value
}
},
toKiloValue: (value) => {
if(value >= 10000){
value = Math.round(value/10000)
return value+"k"
} else {
return value
}
},
},
groups: [
{
items: [
{
valueTitle: "Dach",
notification: "KNX_DACH_TEMP",
reuseCount: 50,
values: [
{
valueIcon: "fxemoji:thermometer",
valueUnit: "°C",
},
]
},
{
notification: "KNX_DACH_LIGHT",
reuseCount: 1000,
naValue: "na",
valueFormat: "{value}",
valueTransformers: ["rountToInt", "toKiloValue"],
values: [
{
valueIcon: "fa-sun-o",
valueUnit: "Lux",
},
]
},
]
},
{
items: [
{
valueTitle: "Südseite",
notification: "TEMPERATURE_C_ESPNORD",
reuseCount: 4,
values: [
{
valueIcon: "fxemoji:thermometer",
valueUnit: "°C",
},
]
},
{
notification: "HUMIDITY_ESPNORD",
reuseCount: 4,
values: [
{
valueIcon: "fa fa-tint",
valueUnit: "%rH",
},
]
},
]
},
{
items: [
{
valueTitle: "Büro",
notification: "TEMPERATURE_C_ESPBUERO",
reuseCount: 4,
values: [
{
valueIcon: "fxemoji:thermometer",
valueUnit: "°C",
},
]
},
{
notification: "HUMIDITY_ESPBUERO",
reuseCount: 4,
values: [
{
valueIcon: "fa fa-tint",
valueUnit: "%rH",
},
]
},
]
},
{
items: [
{
valueTitle: "Schlafen",
notification: "KNX_OG_SZ_TEMP",
reuseCount: 180,
values: [
{
valueIcon: "fxemoji:thermometer",
valueUnit: "°C",
},
]
},
{
notification: "KNX_OG_SZ_TEMP_SET",
reuseCount: 100000,
values: [
{
naValue: "(na.na",
valueUnit: "°C)",
valueIcon: "mdi:home-thermometer",
valueFormat: "\"(\"+Number(${value}).toFixed(1)"
},
]
},
]
},
{
items: [
{
valueTitle: "Bad",
notification: "KNX_OG_BAD_TEMP",
reuseCount: 180,
values: [
{
valueIcon: "fxemoji:thermometer",
valueUnit: "°C",
},
]
},
{
notification: "KNX_OG_BAD_TEMP_SET",
reuseCount: 100000,
values: [
{
naValue: "(na.na",
valueUnit: "°C)",
valueIcon: "mdi:home-thermometer",
valueFormat: "\"(\"+Number(${value}).toFixed(1)"
},
]
},
]
},
{
items: [
{
valueTitle: "Nähen",
notification: "KNX_OG_GALERIE_TEMP",
reuseCount: 180,
values: [
{
valueIcon: "fxemoji:thermometer",
valueUnit: "°C",
},
]
},
{
notification: "KNX_OG_GALERIE_TEMP_SET",
reuseCount: 100000,
values: [
{
naValue: "(na.na",
valueUnit: "°C)",
valueIcon: "mdi:home-thermometer",
valueFormat: "\"(\"+Number(${value}).toFixed(1)"
},
]
},
]
},
{
items: [
{
valueTitle: "Kinder",
notification: "KNX_OG_KINDER_TEMP",
reuseCount: 180,
values: [
{
valueIcon: "fxemoji:thermometer",
valueUnit: "°C",
},
]
},
{
notification: "KNX_OG_KINDER_TEMP_SET",
reuseCount: 100000,
values: [
{
naValue: "(na.na",
valueUnit: "°C)",
valueIcon: "mdi:home-thermometer",
valueFormat: "\"(\"+Number(${value}).toFixed(1)"
},
]
},
]
},
{
items: [
{
valueTitle: "Wohnzimmer",
notification: "KNX_EG_WZ_TEMP",
reuseCount: 180,
values: [
{
valueIcon: "fxemoji:thermometer",
valueUnit: "°C",
},
]
},
{
notification: "KNX_EG_WZ_TEMP_SET",
reuseCount: 100000,
values: [
{
naValue: "(na.na",
valueUnit: "°C)",
valueIcon: "mdi:home-thermometer",
valueFormat: "\"(\"+Number(${value}).toFixed(1)"
},
]
},
]
},
//ZISTERNE
{
valueFormat: "{value}",
classes: "zisterne",
items: [
{
notification: "ZISTERNE_VALUES",
reuseCount: 15,
jsonpath: "rounded",
naValue: "na",
values: [
{
valueTitle: "Zisterne",
valuePositions: "ti[v]",
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-0.svg",
valueUnit: "l",
valueTransformers: ["zisterneAddPercent"],
thresholds: [
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-100.png",
type: "gt",
value: 1550,
},
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-90.png",
type: "gt",
value: 1395,
},
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-80.png",
type: "gt",
value: 1240,
},
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-70.png",
type: "gt",
value: 1085,
},
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-60.png",
type: "gt",
value: 930,
},
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-50.png",
type: "gt",
value: 775,
},
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-40.png",
type: "gt",
value: 620,
},
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-30.png",
type: "gt",
value: 465,
},
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-20.png",
type: "gt",
value: 310,
},
{
valueImgIcon: "modules/MMM-ValuesByNotification/icons/wassertank/wassertank-10.png",
type: "gt",
value: 155,
},
]
},
]
},
]
}
]
},
classes: "pageC"
},
What did you expect to happen?
Maybe the new way to parse the config is the problem. I am not that deep in the core to check what happens during the start.
What actually happened?
Hi and sorry for the big config but i do not want a small detail being responsible for my current problem.
After the update to 2.35 my transformerFunctions do not work anymore.
The idea is to provide transformer functions in config->transformerFunctions which are small javascript functions which then can be called later in values either single or after each other.
Everything works as expected since years but after the upgrade to 2.35 the transformerFunctions are empty ({}) and can not be called later.
I am not sure what is the reason for this and i am very sure that my module is a edge case in the Mirror world.
Additional comments
No response
Participation
- I am willing to submit a pull request for this change.
Activity
khassel commentedon Apr 11, 2026
Hi Tom,
will take a look because I did the rewrite of the config stuff ...
Tom-Hirschberger commentedon Apr 11, 2026
Thanks.
I will try to provide a smaller example to reproduce tomorrow.
I think other modules like the Calender-Ext ones provide similar mechanisms. Maybe they are affected, too
khassel commentedon Apr 11, 2026
I did the following with mm
v2.34.0This looks like the problem was already there with
v2.34.0...Which mm version was the last one working?
Can you do the same simple logging on your side to confirm this so far?
Tom-Hirschberger commentedon Apr 11, 2026
That's interesting. I am running on 2.34 at the moment and do not have any problems.
At least things get formatted.
Tom-Hirschberger commentedon Apr 11, 2026
I only have my mobile at the moment but will try to provide similar information with 2.34 in my setup tomorrow.
khassel commentedon Apr 11, 2026
Can you check the
/config/endpoint, e.g. http://localhost:8080/config/ ? For mm v2.34.0 and mm v2.35.0 please.The strange thing is that everything of the config is displayed except the one property
Tom-Hirschberger commentedon Apr 12, 2026
Hi again.
I just tested both config endpoints. Neither in 2.34 nor 2.35 the transformerFunctions are present in the endpoint result.
But i added:
to the start function of my module right after the config is send to the node_helper.js with the socket notification.
In 2.34 the functions are stored correctly in the object in 2.35 they are missing.
sdetweil commentedon Apr 12, 2026
Looks like requirefromstring() is the culprit
In MMM-Config I had to use transformer functions in the JSON parse and stringify to keep the functions (parameter 2)
khassel commentedon Apr 12, 2026
yes:
will provide a fix
sdetweil commentedon Apr 12, 2026
From mmm-config
khassel commentedon Apr 12, 2026
I think I have a solution for this but before providing a PR to this repo I'm interested if it works on your side @Tom-Hirschberger
Can you please test if it works when you manually add these changes ? Thanks!
Tom-Hirschberger commentedon Apr 12, 2026
Works like a charm.
My transformers work and i can see them in the config endpoint
config endpoint must handle functions in module configs (#4106)