I toyed with the idea of writing my own VirtualController, but findEntity and such are only valid within the controller, so an entity from another controller is not callable. After a couple of hours flidding with code, I've just added two virtual devices like this, supporting the main features I need:
- id: "cover_lamellas2"
name: 'Frangisole Matteo: lamelle'
capabilities:
cover:
actions:
open:
- target: 'position.value'
value: '1'
- target: 'state'
value: 'true'
close:
- target: 'position.value'
value: '0'
- target: 'state'
value: 'false'
set:
- target: 'position. Value'
expr: 'parameters.state?1:0'
- target: 'state'
expr: 'parameters.state'
position:
actions:
set:
- target: 'value'
expr: 'parameters.value'
- target: 'cover. State'
expr: 'parameters.value != 0'
And two reactions like this, watching for position. Value changes:
88a26f94-fad7-4367-b6ce-8ed5780e6f82-image.png
It's working lovely, even if I wish it were possible to avoid two reactions. I'll move to zwavejs, eventually, so this is acceptable as a short-term solution.
I hope this can be helpful to other people in the future.