Virtual Devices for lamellas in Vera
-
So, I've just installed two venetian blinds and I want to control their lamellas with Fibaro FGRM222.
According to the old place, this could be accomplished with some Zwave raw messages and I'm OK with it.
Since I've moved (mostly) everything virtual in MSR, I'm now ready to add a virtual device with actions.Looking at the docs, it seems possible, but it's not documented. @toggledbits any hints? I want to define a cover and send Zwave commands to the existing x_vera_svc_micasaverde_com_ZWaveNetwork1.SendData action. Thanks.
-
for a future me, according to the current design, it's not possible to perform actions on different devices. you'd remap an action to another one, call a function with a fixed signature, specify a fixed value or an expression, but not call an arbitrary expression, nor an action with parameters on a specific entity.
back to the drawing board. -
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:
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. -
T toggledbits locked this topic on