examples/node/webhook-subscriptions.js
function subscribe() {
    // starts to receive values after device regsiters
    connect.subscribe.resourceValues({ resourcePaths: ["/3200/0/5501"] })
        .addListener((res) => logData(res, "OnRegistration"))
        .addLocalFilter(res => res.payload >= 20);

    // starts to reveive values immediatley
    connect.subscribe.resourceValues({ resourcePaths: ["/3200/0/5501"] }, "OnValueUpdate")
        .addListener((res) => logData(res, "OnValueUpdate"));
}
function subscribe() {
    // starts to receive values after device regsiters
    connect.subscribe.resourceValues({ resourcePaths: ["/3200/0/5501"] })
        .addListener((res) => logData(res, "OnRegistration"))
        .addLocalFilter(res => res.payload >= 20);

    // starts to reveive values immediatley
    connect.subscribe.resourceValues({ resourcePaths: ["/3200/0/5501"] }, "OnValueUpdate")
        .addListener((res) => logData(res, "OnValueUpdate"));
}
function subscribe ( ) { // starts to receive values after device regsiters connect . subscribe . resourceValues ( { resourcePaths : [ "/3200/0/5501" ] } ) . addListener ( ( res ) => logData ( res , "OnRegistration" ) ) . addLocalFilter ( res => res . payload >= 20 ) ; // starts to reveive values immediatley connect . subscribe . resourceValues ( { resourcePaths : [ "/3200/0/5501" ] } , "OnValueUpdate" ) . addListener ( ( res ) => logData ( res , "OnValueUpdate" ) ) ; }
subscribe to the button resource
subscribe to the button resource