Hi,
The only way I know of to change the opacity in RV (except for rendering the source with a different Alpha value) is using a Sequence.
Sequences have now a inputOpacities property: here in the manual
So a way to change the opacity for a given source would be (in python)
opacity_sequence = commands.newNode("RVSequence")
commands.setNodeInputs(opacity_sequence, ["sourceGroup000000"])
commands.setFloatProperty(f"{opacity_sequence}.composite.inputOpacities", [0.5], True)
or if you want a full RVSequenceGroup that is visible in the session manager:
opacity_sequence = commands.newNode("RVSequenceGroup")
commands.setNodeInputs(opacity_sequence, ["sourceGroup000000"])
commands.setFloatProperty(f"{opacity_sequence}_sequence.composite.inputOpacities", [0.5], True)
Full version of what was initally asked:
from rv import commands
# source examples (find real source or add source yourself)
source_node = "sourceGroup000000"
background_source = "sourceGroup000001"
alpha_value = 0.5
opacity_sequence = commands.newNode("RVSequence")
commands.setNodeInputs(opacity_sequence, [source_node])
commands.setFloatProperty(f"{opacity_sequence}.composite.inputOpacities", [alpha_value], True)
# Add to layout
layout = commands.newNode("RVLayoutGroup")
commands.setNodeInputs(layout, [opacity_sequence, background_source])
commands.setStringProperty(f"{layout}.layout.mode", ["static"], False)
# Make background fullsize
commands.setFloatProperty(f"{layout}_t_{background_source}.transform.translate", [0.0, 0.0,], False)
commands.setFloatProperty(f"{layout}_t_{background_source}.transform.scale", [1.0, 1.0,], False)
# Place "floating" opacity sequence (adjust as needed)
commands.setFloatProperty(f"{layout}_t_{opacity_sequence}.transform.translate", [0.5, 0.25], False)
commands.setFloatProperty(f"{layout}_t_{opacity_sequence}.transform.scale", [0.3, 0.3], False)
commands.setViewNode(layout)
Hope this helps 
The input opacities property is quite new (april of 2025), so make sure you are running a relatively recent version of RV.
Cheers, Mirco