Also, the type: script.ScriptAction lines for both of the scripts are incorrectly indented. In yaml the level of the indentation matters and there are two possible type properties that can be filled in here. The first is a required type of the actual action that is a property of the action its self. That’s the line you have and because it is a property of the action itself, it needs to be at the same indentation level as the configuration property (similar to the trigger elements that are properly indented above it). You have it indented one extra level so now it is a sub-property of the configuration property.
So right now your script actions are not identified to the UI rule parser as script actions, and the text of the script itself is improperly identified as being in the “script.ScriptAction” scripting language instead of whatever language is actually is.
No. You have not changed the indentation at all (order is irrelevant within the same indentation level) and there’s no such thing as scriptType. There are two different properties that are both named type, but because they are at different indentation levels in the yaml they are different properties.
Oliver is quite correct:
Even if you insist on typing these rules in to the code box (which is, for most users not a good idea), at least please create a dummy rule using the wizard and look at the structure that rule has. Guessing is going to take you much longer and just frustrate you.