Homey Community Forum

How to change relay status when turn on/off

Hello,
I use AN196 to want to control two sets of relays by main node, or when two sets of relays change status can change main node status too, like this:

My questions below:
1.Using App to press one of relays can change main node, but press main node can’t change two sets of relays.
2.Using device to turn on/off, only main node change status, two sets of relays not work, it’s difference problem with App.

My codes below:
1.device.js:
‘use strict’;

const {ZwaveDevice} = require(‘homey-zwavedriver’);

class MyZWaveDevice extends ZwaveDevice {
async onNodeInit() {

    //relay 1 and 2
    this.registerCapability('onoff', 'BASIC', {
        report: 'SWITCH_BINARY_REPORT'
    });

    //group
    this.registerCapability('onoff', 'SWITCH_BINARY', {
    });
}

}

module.exports = MyZWaveDevice

2.app.json
{
“id”: “com.everspring”,
“version”: “1.0.0”,
“compatibility”: “>=5.0.0”,
“sdk”: 3,
“name”: {
“en”: “Everspring”
},
“description”: {
“en”: “n”
},
“category”: [
“lights”
],
“permissions”: ,
“images”: {
“large”: “/assets/images/large.png”,
“small”: “/assets/images/small.png”
},
“author”: {
“name”: “YI KUAN HSIN”,
“email”: “101797@everspring.com
},
“drivers”: [
{
“id”: “AN196”,
“name”: {
“en”: “AN196”
},
“class”: “socket”,
“capabilities”: [
“onoff”
],
“images”: {
“large”: “/drivers/AN196/assets/images/large.png”,
“small”: “/drivers/AN196/assets/images/small.png”
},
“zwave”: {
“manufacturerId”: 96,
“productTypeId”: 4,
“productId”: 14,
“learnmode”: {
“image”: “/drivers/AN196/assets/learnmode.svg”,
“instruction”: {
“en”: “Press the link key three times within 1.5 seconds to put the unit into inclusion mode.”
}
},
“associationGroups”: [
1
],
“associationGroupsOptions”: {
“1”: {
“hint”: {
“en”: “Group”
}
},
“2”: {
“hint”: {
“en”: “Relay 1”
}
},
“3”: {
“hint”: {
“en”: “Relay 2”
}
}
},
“multiChannelNodes”: {
“1”: {
“class”: “socket”,
“capabilities”: [
“onoff”
],
“icon”: “/drivers/AN196/assets/icon.svg”,
“name”: {
“en”: “Relay 1”
}
},
“2”: {
“class”: “socket”,
“capabilities”: [
“onoff”
],
“icon”: “/drivers/AN196/assets/icon.svg”,
“name”: {
“en”: “Relay 2”
}
}
},
“defaultConfiguration”: [
{
“id”: 1,
“size”: 1,
“value”: 0
},
{
“id”: 2,
“size”: 1,
“value”: 0
},
{
“id”: 3,
“size”: 4,
“value”: 0
},
{
“id”: 4,
“size”: 4,
“value”: 0
},
{
“id”: 5,
“size”: 1,
“value”: 1
},
{
“id”: 6,
“size”: 1,
“value”: 1
}
]
}
}
]
}

I’m not sure I fully understand your question, but I think that if you create a virtual device with the [App] Virtual Devices you can use flows to create the required behaviour for the virtual device.