State value to set for "s7.1.DBs.DB1._2_0" has to be type "boolean" but received type "string"

Hi everyone,

I’m sending an initialization from Node-RED to ioBroker for a Siemens LOGO. The initialization is sent, but I keep getting this error:
State value to set for "s7.1.DBs.DB1._2_0" has to be type "boolean" but received type "string"
In my Node-RED function I map the incoming command ("auto", "off", "on") to the corresponding S7 state and then force the payload to a boolean:

if (msg.payload == "auto") {
  msg.topic = "s7.1.DBs.DB1._2_1";
}
if (msg.payload == "off") {
  msg.topic = "s7.1.DBs.DB1._2_0";
}
if (msg.payload == "on") {
  msg.topic = "s7.1.DBs.DB1._2_2";
}
msg.payload = true;
return msg;

My debug output (from Node-RED) shows something like this, which looks like a boolean to me:

object
topic: "s7.1.DBs.DB1._2_0"
payload: true
acknowledged: true
timestamp: 1767583290889
lastchange: 1767583290889
from: "system.adapter.s7.1"
_msgid: "70db13186a9f010f"

So I assume I’m sending a boolean, but ioBroker still claims it received a string.

Is there anything I should improve in the function to ensure the value is always treated as a boolean?

Thanks a lot!

Exactly which node are you sending that value to? Check in manage palette for the node package name.

I’m sending and receiving data using node-red-contrib-iobroker 1.2.0.

In the meantime I changed the datapoint type in ioBroker and Node Red from boolean to string, and now I no longer get any error entries in the log. Because of that, I don’t think this is a pure Node-RED issue — it seems more likely that the ioBroker adapter handles this differently (maybe a type conversion or feedback/ack behavior).

I’m going to try to discuss this with one of the adapter’s architects/developers.

What I still don’t understand: why should I use a string (or even the length of a string) for a purely digital signal where only true or false makes sense?