@derolf-0 Den Device- und Statename kann man mit einer Funktion anzeigen lassen.
Device-Name

id = id.substring(0, id.lastIndexOf('.'));
if(existsObject(id)) return getObject(id).common.name;
State-Name

return getObject(id).common.name;
Wie folgt sieht nun das Debug aus:

Hier das komplette Blockly:
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="w/{R8#0v_s11Rv#o,$~0">id</variable>
</variables>
<block type="procedures_defcustomreturn" id="$A~*/x]d!OZA5{7m$Y?3" x="-287" y="213">
<mutation statements="false">
<arg name="id" varid="w/{R8#0v_s11Rv#o,$~0"></arg>
</mutation>
<field name="NAME">Device-Name</field>
<field name="SCRIPT">aWQgPSBpZC5zdWJzdHJpbmcoMCwgaWQubGFzdEluZGV4T2YoJy4nKSk7DQppZihleGlzdHNPYmplY3QoaWQpKSByZXR1cm4gZ2V0T2JqZWN0KGlkKS5jb21tb24ubmFtZTs=</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
</block>
<block type="debug" id="y]f;9I4/^]8YGkm,pw5" x="-387" y="288"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="B]{qAcEg4V90~9Rr4].z"> <field name="TEXT">test</field> </shadow> <block type="procedures_callcustomreturn" id="_F~)7g4}Nc@;e69}#IQ|"> <mutation name="Device-Name"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="field_oid" id="$ueQCeDztaJ6|/0-)y/U"> <field name="oid">hue.0.Ambilight_Schlafzimmer.bri</field> </block> </value> </block> </value> </block> <block type="procedures_defcustomreturn" id="R*FFbib=vM6Z)~/07mes" x="-312" y="538"> <mutation statements="false"> <arg name="id" varid="w/{R8#0v_s11Rv#o,$~0"></arg> </mutation> <field name="NAME">State-Name</field> <field name="SCRIPT">cmV0dXJuIGdldE9iamVjdChpZCkuY29tbW9uLm5hbWU7</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="debug" id="x,F*h!L@FQ.bz4xt~SuP" x="-387" y="613"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id=":5e~^mUOd+7Mvm_1TTmu"> <field name="TEXT">test</field> </shadow> <block type="procedures_callcustomreturn" id="^pS_s_@V+rj/*E6I:FYJ"> <mutation name="State-Name"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="field_oid" id="S(/^!_
ABPx]D$h:u^Fp">
<field name="oid">hue.0.Ambilight_Schlafzimmer.bri</field>
</block>
</value>
</block>
</value>
</block>
</xml>