TypeCasting & values with and without values (Blocky & Javascript)

Hi all,

I’ve already managed that the whole story works (so the blocky is doing what it should) but I have some questions about the types in the script. (See below the blocky)

  1. I’ve tried to extract the Progress State from my Coffee Machine and directly insert the value into the Color Temperature of a Bulb.
    The Problem was that the Command “100 %” could not be sent to the bulb.
    Question: As I got it the .getState() returns “100 %” can i just get the “100”.

  2. Then I’ve tried to do a string Split of the value but it complained like:

[internal.handler.ScriptActionHandler] - Script execution of rule with UID 'cac3268206' failed: TypeError: ProzState.indexOf is not a function in <eval> at line number 11

Question: I’ve entered a block that adds an empty string to the Object to forse a “to_String()” is this a good behaviour or can this be done differently in Blocky?

Most likely. What you get in a state depends on the type of the Item, which is still a secret. What commands you can send to an Item depends on the type, and that one is secret too.