Hey everyone,
I am currently trying to move all my rules into the Main UI and only my Alexa rules are missing now.
I am currently stuck when trying to construct a string in the Blockly UI and would appreciate it if someone could guide me in the right direction.
This is the rule I am trying to recreate in blockly:
rule "Alexa Dieselpreis Rule"
when
Member of AllAlexaDevices changed
then
if(Dieselpreis.state == ON){
Dieselpreis.postUpdate(OFF)
val String formattedForAlexa = (String::format("%.2f", (TankstelleOIL_Diesel.state as DecimalType).floatValue())).replace(".",",")
val String sourceRoom = triggeringItem.name.split("_").get(0) // der erste Teil des Itemnamens
logInfo("Alexa Specific Rules","SourceRoom " + sourceRoom)
val String DestinationRoom = sourceRoom + "_Sprich"
logInfo("Alexa Specific Rules","DestinationRoom " + DestinationRoom)
DestinationRoom.sendCommand('<speak>Aktueller Dieselpreis ist <say-as interpret-as="unit">EUR' + formattedForAlexa + '</say-as></speak>')
}
end
How can I format a String of an item state in Blockly?