getting a value from a JavaScript object, working in Node red for home automation, a service I'm using delivers data as an object but I only need a Boolean for MQTT.
{
"command": "action.devices.commands.OnOff",
"params": {
"on": true,
"online": true
}
}
here is the object in question that the service outputs and I don't quite understand what key to use to return the value of "on". in the picture i tried what i think should have worked but it never seems to work.
I have gotten errors such as
TypeError: Cannot read properties of undefined (reading 'on')
and other rigamaroo about how something cannot be a boolean