Skip to content

Instantly share code, notes, and snippets.

@stas-dovgodko
Last active October 15, 2022 18:04
Show Gist options
  • Save stas-dovgodko/d165b896f08df4a1118c5ffcc992d949 to your computer and use it in GitHub Desktop.
Save stas-dovgodko/d165b896f08df4a1118c5ffcc992d949 to your computer and use it in GitHub Desktop.
// при перемиканні ioncs8_config в ON конфігуруємо реле
rules.JSRule({
name: "Initial relay config",
triggers: [triggers.ItemCommandTrigger('ioncs8_config')],
execute: (event) => {
// відв'язуємо перший та восьмий вхід від виходу
if (event.receivedCommand === 'ON') items.getItem('ioncs8_1_configuration_outputmapping').sendCommand(0b01111110);
else items.getItem('ioncs8_1_configuration_outputmapping').sendCommand(0b11111111);
console.log('RELAY CONFIGURED');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment