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!
