Solved ! (but not by me)
Shelly.addStatusHandler(function(e) {
// Only handle input from switch state changes
if (e.name === 'input') {
let input0 = Shelly.getComponentStatus('input:0', 0);
let input1 = Shelly.getComponentStatus('input:1', 1);
let input2 = Shelly.getComponentStatus('input:2', 2);
console.log('--- x ---');
console.log('input0 -> ', JSON.stringify(input0));
console.log('input1 -> ', JSON.stringify(input1));
console.log('input2 -> ', JSON.stringify(input2));
console.log('--- y ---');
console.log('event -> ', JSON.stringify(e));
console.log('--- z ---');
let state = input0.state input1.state input2.state;
Shelly.call("Switch.set", {
'id': 1,
'on': state
});
}
});