@loxdus ich verstehe dein Problem nicht.
aus shellies/Essen/color/set wird im mqtt Adapter so etwas wie mqtt.0.shellies.Essen.color.set was dann ein ganz normaler Datenpunkt ist den du wie jeden anderen auch verändern oder auslesen kannst. Also setState etc.
Wenn du statt dessen die / Schreibweise nutzen willst musst du den MQTT-Adapter per SendTo ansteuern:
// Beispiel für SendTo von https://github.com/ioBroker/ioBroker.mqtt
// Test ob ich das zum Anlegen von neuen MQTT-Topics etc. nutzen kann
/*
* @param {string} MQTT instance Specify MQTT instance to send message through (may be either server or client)
* @param {string} action Action to use (always 'sendMessage2Client' for sending plain messages)
* @param {object} payload
* @param {string} payload.topic Topic to publish message on
* @param {string} payload.message Message to be published on specified topic
*
*/
sendTo('mqtt.0', 'sendMessage2Client', {topic: 'znil/Tests/Testnachricht', message: '42'});
oder als Blockly:
e398b32c-f3f9-45db-b9cf-e6080eb50339-image.png
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="J?x:?:X,wGc,%bY0vKl5">mytopic</variable>
<variable id="EfK(Ux@N1_KqYqVyJ=Kx">myMessage</variable>
<variable id="4Uz[ZY|r[lC`HWepzkcC">result</variable>
</variables>
<block type="variables_set" id="eb[mvk]93-p(.Jtk#.Ut" x="137" y="137">
<field name="VAR" id="J?x:?:X,wGc,%bY0vKl5">mytopic</field>
<value name="VALUE">
<block type="text" id="JHvH;!uXfXv5i4m[d%hu">
<field name="TEXT">znil/Tests/TestnachrichtBlockly</field>
</block>
</value>
<next>
<block type="variables_set" id="B=i-:[RasoTB5|M|LBC1">
<field name="VAR" id="EfK(Ux@N1_KqYqVyJ=Kx">myMessage</field>
<value name="VALUE">
<block type="math_random_int" id="r0RAx+.0IH%chi869f|7">
<value name="FROM">
<shadow type="math_number" id="O@]daxjHHzd2@IE[kbsx">
<field name="NUM">1</field>
</shadow>
</value>
<value name="TO">
<shadow type="math_number" id="+0fJ^Y#^J#IBF*:N]z%f">
<field name="NUM">9999</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="sendto_custom" id="BWr5ehE:SME/#2Y:xw7n">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="topic,message" with_statement="true"></mutation>
<field name="INSTANCE">mqtt.0</field>
<field name="COMMAND">sendMessage2Client</field>
<field name="LOG">log</field>
<field name="WITH_STATEMENT">TRUE</field>
<value name="ARG0">
<shadow type="text" id="shDRnRIW0=J[-cD/uTNJ">
<field name="TEXT">znil/Tests/TestnachrichtBlockly</field>
</shadow>
<block type="variables_get" id="b0gS1Sb]_|Ld{A$#[;RO">
<field name="VAR" id="J?x:?:X,wGc,%bY0vKl5">mytopic</field>
</block>
</value>
<value name="ARG1">
<shadow type="text" id="KvpMsF((eyp:O5@zp#uw">
<field name="TEXT">88</field>
</shadow>
<block type="variables_get" id="_K@[G7xSPJw2(Y5cWL?u">
<field name="VAR" id="EfK(Ux@N1_KqYqVyJ=Kx">myMessage</field>
</block>
</value>
<statement name="STATEMENT">
<block type="debug" id="6/)Yg}cG5Np/PCAjXIuq">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="AuBzuc%w,N*$5S?Rd*^,">
<field name="TEXT">test</field>
</shadow>
<block type="variables_get" id="|$Kps5fBH/o^Fz*|#R`a">
<field name="VAR" id="4Uz[ZY|r[lC`HWepzkcC">result</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</xml>