Checked the code for MQTT.cpp and find the following (
https://github.com/domoticz/domoticz/bl ... e/MQTT.cpp - +- at Line 268)
...
else if (szCommand == "switchscene")
{
if (root["idx"].empty())
goto mqttinvaliddata;
if (!root["idx"].isInt64())
goto mqttinvaliddata;
idx = (unsigned long long)root["idx"].asInt64();
result = m_sql.safe_query("SELECT Name FROM Scenes WHERE (ID==%llu)", idx);
if (result.empty())
{
_log.Log(LOG_ERROR, "MQTT: unknown idx received!");
return;
}
}
else if (szCommand == "setuservariable")
{
result = m_sql.safe_query("SELECT Name FROM UserVariables WHERE (ID==%llu)", idx);
if (result.empty())
{
_log.Log(LOG_ERROR, "MQTT: unknown idx received!");
return;
}
...
If you look at the difference between both cases, you can see there is - except for the validation rules - an assignment missing: "idx = (unsigned long long)root["idx"].asInt64();"
So this is probably a bug.
Added description to the Bugs / Problems forum