Giter VIP home page Giter VIP logo

Comments (10)

tb-killa avatar tb-killa commented on August 17, 2024

Hi @kirovilya is this your mentioned device?
dresden-elektronik/deconz-rest-plugin#1666

from zigbee-herdsman.

kirovilya avatar kirovilya commented on August 17, 2024

@tb-killa yes

from zigbee-herdsman.

kirovilya avatar kirovilya commented on August 17, 2024

some handlers for this cluster and device https://github.com/monninn82/SmartThingsPublic-Backup/blob/master/devicetypes/smartthings/zigbee-scene-keypad.src/zigbee-scene-keypad.groovy#L61

from zigbee-herdsman.

kirovilya avatar kirovilya commented on August 17, 2024

I think we can use dummy-cluster for this case:

    cluster23: {
        ID: 23,
        attributes: {},
        commands: {},
        commandsResponse: {},
    },

from zigbee-herdsman.

Koenkk avatar Koenkk commented on August 17, 2024

Yes, but also commands and attributes have to be added otherwise it has no use.

from zigbee-herdsman.

kirovilya avatar kirovilya commented on August 17, 2024

This is only necessary to eliminate parsing errors. We already have similar clusters without attributes and commands https://github.com/Koenkk/zigbee-herdsman/blob/master/src/zcl/definition/cluster.ts#L3457

Processing data can be handled like a buffer.

from zigbee-herdsman.

Koenkk avatar Koenkk commented on August 17, 2024

So the idea is to parse the raw buffer in zigbee-herdsman-converters?

from zigbee-herdsman.

kirovilya avatar kirovilya commented on August 17, 2024

@Koenkk yes

orvibo_raw: {
        cluster: 'cluster23',
        type: 'raw',
        convert: (model, msg, publish, options) => {
            // 25,0,8,3,0,0 - click btn 1
            // 25,0,8,3,0,2 - hold btn 1
            // 25,0,8,3,0,3 - release btn 1
            // 25,0,8,11,0,0 - click btn 2
            // 25,0,8,11,0,2 - hold btn 2
            // 25,0,8,11,0,3 - release btn 2
            // 25,0,8,7,0,0 - click btn 3
            // 25,0,8,7,0,2 - hold btn 3
            // 25,0,8,7,0,3 - release btn 3
            // 25,0,8,15,0,0 - click btn 4
            // 25,0,8,15,0,2 - hold btn 4
            // 25,0,8,15,0,3 - release btn 4
            // TODO: do not know how to get to use 5,6,7,8 buttons
            const btn_lookup = {
                     3: 'btn_1',
                    11: 'btn_2',
                     7: 'btn_3',
                    15: 'btn_4',  
                  },
                  act_lookup = {
                     0: 'click',
                     2: 'hold',
                     3: 'release',
                  },
                  button = btn_lookup[msg.data[3]],
                  action = act_lookup[msg.data[5]];
            if (button && action) {
                return {[button]: action};
            }
        }, 
    },

from zigbee-herdsman.

Koenkk avatar Koenkk commented on August 17, 2024

Instead of having to define an empty cluster, zigbee-herdsman will now expose the cluster ID instead (as a number). So adding it to clusters.ts is not needed anymore.

Your converter should then use a number instead of string:

orvibo_raw: {
        cluster: 23, // <--- cluster number 
        type: 'raw',
        convert: (model, msg, publish, options) => {
            // 25,0,8,3,0,0 - click btn 1
            // 25,0,8,3,0,2 - hold btn 1
            // 25,0,8,3,0,3 - release btn 1
            // 25,0,8,11,0,0 - click btn 2
            // 25,0,8,11,0,2 - hold btn 2
            // 25,0,8,11,0,3 - release btn 2
            // 25,0,8,7,0,0 - click btn 3
            // 25,0,8,7,0,2 - hold btn 3
            // 25,0,8,7,0,3 - release btn 3
            // 25,0,8,15,0,0 - click btn 4
            // 25,0,8,15,0,2 - hold btn 4
            // 25,0,8,15,0,3 - release btn 4
            // TODO: do not know how to get to use 5,6,7,8 buttons
            const btn_lookup = {
                     3: 'btn_1',
                    11: 'btn_2',
                     7: 'btn_3',
                    15: 'btn_4',  
                  },
                  act_lookup = {
                     0: 'click',
                     2: 'hold',
                     3: 'release',
                  },
                  button = btn_lookup[msg.data[3]],
                  action = act_lookup[msg.data[5]];
            if (button && action) {
                return {[button]: action};
            }
        }, 
    },

from zigbee-herdsman.

kirovilya avatar kirovilya commented on August 17, 2024

Ok. thank you

from zigbee-herdsman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.