Last active
October 15, 2022 18:04
-
-
Save stas-dovgodko/d165b896f08df4a1118c5ffcc992d949 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// при перемиканні 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