Giter Site home page Giter Site logo

Comments (25)

Koenkk avatar Koenkk commented on July 20, 2024

Do you see any direct output when you pres any of the button? (when running with DEBUG=* npm start)

from zigbee-herdsman-converters.

MoskitoHorst avatar MoskitoHorst commented on July 20, 2024

yes, the following lines come, when I press "warm":
serialport:poller received "readable" +39s
serialport:bindings read +39s
serialport:unixRead Starting read +39s
serialport:unixRead Finished read 34 bytes +0ms
serialport:main binding.read finished +39s
cc-znp { sof: 254,
cc-znp len: 29,
cc-znp type: 'AREQ',
cc-znp subsys: 'AF',
cc-znp cmd: 'incomingMsg',
cc-znp payload:
cc-znp { groupid: 16388,
cc-znp clusterid: 768,
cc-znp srcaddr: 25648,
cc-znp srcendpoint: 1,
cc-znp dstendpoint: 1,
cc-znp wasbroadcast: 0,
cc-znp linkquality: 76,
cc-znp securityuse: 0,
cc-znp timestamp: 11712182,
cc-znp transseqnumber: 0,
cc-znp len: 9,
cc-znp data: <Buffer 11 32 0a 72 01 0a 00 00 00> },
cc-znp fcs: 130,
cc-znp csum: 130 } +39s
serialport:main _read reading +14ms
serialport:bindings read +15ms
serialport:unixRead Starting read +14ms
cc-znp:AREQ <-- AF:incomingMsg, { groupid: 16388, clusterid: 768, srcaddr: 25648, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 76, securityuse: 0, timestamp: 11712182, transseqnumber: 0, len: 9, data: <Buffer 11 32 0a 72 01 0a 00 00 00> } +6ms
zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +0ms
zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +39s
serialport:unixRead waiting for readable because of code: EAGAIN +34ms
serialport:poller Polling for "readable" +51ms
zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +31ms

They are in the logfile. But I do not see something without debug. All other keys produce similar results

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on July 20, 2024

Can you add on https://github.com/Koenkk/zigbee-shepherd/blob/master/lib/components/af.js#L689

console.log('CMD ID', msg.zclMsg.cmdId)

from zigbee-herdsman-converters.

MoskitoHorst avatar MoskitoHorst commented on July 20, 2024

It resulted in
CMD ID moveToColorTemp
for the colorWheel:
CMD ID moveToColor
and for the Scenes:
CMD ID write

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on July 20, 2024

Good, you should add those to this list now: https://github.com/Koenkk/zigbee-shepherd/blob/master/lib/components/af.js#L686

from zigbee-herdsman-converters.

MoskitoHorst avatar MoskitoHorst commented on July 20, 2024

Ok, this worked for most of the keys. The Scenes do not:
serialport:main binding.read finished +24s
cc-znp { sof: 254,
cc-znp len: 29,
cc-znp type: 'AREQ',
cc-znp subsys: 'AF',
cc-znp cmd: 'incomingMsg',
cc-znp payload:
cc-znp { groupid: 16388,
cc-znp clusterid: 0,
cc-znp srcaddr: 25648,
cc-znp srcendpoint: 1,
cc-znp dstendpoint: 1,
cc-znp wasbroadcast: 0,
cc-znp linkquality: 78,
cc-znp securityuse: 0,
cc-znp timestamp: 8278316,
cc-znp transseqnumber: 0,
cc-znp len: 9,
cc-znp data: <Buffer 14 1b 12 58 02 05 40 20 02> },
cc-znp fcs: 66,
cc-znp csum: 66 } +24s
serialport:main _read reading +9ms
serialport:bindings read +11ms
serialport:unixRead Starting read +11ms
cc-znp:AREQ <-- AF:incomingMsg, { groupid: 16388, clusterid: 0, srcaddr: 25648, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 78, securityuse: 0, timestamp: 8278316, transseqnumber: 0, len: 9, data: <Buffer 14 1b 12 58 02 05 40 20 02> } +4ms
zigbee-shepherd:af dispatchIncomingMsg(): type: incomingMsg, msg: [object Object] +24s
zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +24s
serialport:unixRead waiting for readable because of code: EAGAIN +9ms
serialport:poller Polling for "readable" +21ms
zigbee-shepherd:af dispatchIncomingMsg(): type: zclIncomingMsg, msg: [object Object] +8ms
CMD ID write

Maybe, the value of 0 is a Special case.

Horst

from zigbee-herdsman-converters.

MoskitoHorst avatar MoskitoHorst commented on July 20, 2024

I put my changes in devices.pm and fromZigbee.pm

from zigbee-herdsman-converters.

MoskitoHorst avatar MoskitoHorst commented on July 20, 2024

Sorry, Maybe my pull request is a bit missformed.

from zigbee-herdsman-converters.

MoskitoHorst avatar MoskitoHorst commented on July 20, 2024

I did a local change in:
af.js, Line 694:
if ( cmdIDs.includes(msg.zclMsg.cmdId) && msg.zclMsg.payload) {
// if (frameType === 1 && cmdIDs.includes(msg.zclMsg.cmdId) && msg.zclMsg.payload) {

but a do not know About side effects. After this, I get results for the scene-keys as well, but I donot trust in my change.

from zigbee-herdsman-converters.

stale avatar stale commented on July 20, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from zigbee-herdsman-converters.

FHeilmann avatar FHeilmann commented on July 20, 2024

@Koenkk sorry to resurrect this closed issue, but I'm seing the same issue @MoskitoHorst was seing. All buttons on the remote work, except the scene buttons, which don't trigger any response in zigbee2mqtt.

I'm running the latest dev, freshly pulled today. Lmk if there is anything I can try to assist you.

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on July 20, 2024

@FHeilmann please provide the log when pressing the button and running zigbee2mqtt with herdsman debug log enabled.

To enable herdsman debug logging, see https://www.zigbee2mqtt.io/information/debug.html#zigbee-herdsman-debug-logging

from zigbee-herdsman-converters.

FHeilmann avatar FHeilmann commented on July 20, 2024

mueller_tint_remote_scene_keys.log

There you go, this is the log of pressing each of the scene buttons once.

Bests,
-Florian

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on July 20, 2024

Do you see a No converter available... message in the zigbee2mqtt log with debug logging enabled?

To enable debug logging set in configuration.yaml:

advanced:
  log_level: debug

from zigbee-herdsman-converters.

FHeilmann avatar FHeilmann commented on July 20, 2024

Unfortunately no. Zigbee2mqtts log does not react at all to the scene buttons, regardless of the log level.

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on July 20, 2024

Could you sniff the traffic while pressing the buttons? https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html

from zigbee-herdsman-converters.

FHeilmann avatar FHeilmann commented on July 20, 2024

Sure, here is the capture file from Wireshark:

tint.zip

The file contains the following sequence:

I pressed

  • Color temp down (towards warm)
  • Color temp up (towards cold)
  • Brightness down
  • Brightness up
  • Each Scene button once: Reading, Sunset, Disco, Moonlight, Fireplace, Heartbeat
  • Each Scene button once, again: Reading, Sunset, Disco, Moonlight, Fireplace, Heartbeat
  • Color temp down (towards warm)
  • Color temp up (towards cold)
  • Brightness down
  • Brightness up

Hope this helps,

-Florian

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on July 20, 2024

Thanks, it turns out that the scene buttons are not common write request. These were not yet emitted, and therefore you wouldn't get No converter available.. messages. Please update to the latest zigbee2mqtt dev branch and set the log level to debug. You should now see these No converter available... messages and can start writing the missing converters.

from zigbee-herdsman-converters.

FHeilmann avatar FHeilmann commented on July 20, 2024

Thank you so much for the swift fix. I also have some tint bulbs, does this patch also expose the functionality so I can send the 'write' requests to those bulbs too?

edit: I can already confirm that the missing converter messages are now triggered:


zigbee2mqtt:debug 2019-12-11 19:49:40: Received Zigbee message from 'RGB Remote', type 'write', cluster 'genBasic', data '{"16389":3}' from endpoint 1 with groupID 16388
zigbee2mqtt:warn  2019-12-11 19:49:40: No converter available for 'MLI-404011' with cluster 'genBasic' and type 'write' and data '{"16389":3}'
zigbee2mqtt:debug 2019-12-11 19:49:46: Received Zigbee message from 'RGB Remote', type 'write', cluster 'genBasic', data '{"16389":1}' from endpoint 1 with groupID 16388
zigbee2mqtt:warn  2019-12-11 19:49:46: No converter available for 'MLI-404011' with cluster 'genBasic' and type 'write' and data '{"16389":1}'
zigbee2mqtt:debug 2019-12-11 19:49:47: Received Zigbee message from 'RGB Remote', type 'write', cluster 'genBasic', data '{"16389":2}' from endpoint 1 with groupID 16388
zigbee2mqtt:warn  2019-12-11 19:49:47: No converter available for 'MLI-404011' with cluster 'genBasic' and type 'write' and data '{"16389":2}'
zigbee2mqtt:debug 2019-12-11 19:49:48: Received Zigbee message from 'RGB Remote', type 'write', cluster 'genBasic', data '{"16389":6}' from endpoint 1 with groupID 16388
zigbee2mqtt:warn  2019-12-11 19:49:48: No converter available for 'MLI-404011' with cluster 'genBasic' and type 'write' and data '{"16389":6}'
zigbee2mqtt:debug 2019-12-11 19:49:49: Received Zigbee message from 'RGB Remote', type 'write', cluster 'genBasic', data '{"16389":4}' from endpoint 1 with groupID 16388
zigbee2mqtt:warn  2019-12-11 19:49:49: No converter available for 'MLI-404011' with cluster 'genBasic' and type 'write' and data '{"16389":4}'
zigbee2mqtt:debug 2019-12-11 19:49:50: Received Zigbee message from 'RGB Remote', type 'write', cluster 'genBasic', data '{"16389":5}' from endpoint 1 with groupID 16388
zigbee2mqtt:warn  2019-12-11 19:49:50: No converter available for 'MLI-404011' with cluster 'genBasic' and type 'write' and data '{"16389":5}'

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on July 20, 2024

With the latest zigbee2mqtt dev branch these messages should now be converted to MQTT (please wait a few hours before checking the latest dev). Based on this you can further create your own automations based on these actions (e.g. setting a certain color using Home Assistant).

from zigbee-herdsman-converters.

FHeilmann avatar FHeilmann commented on July 20, 2024

If I want to send the scene command to my tint bulbs I need a converter in "toZigbee.js" as well right? Thanks for fixing the converter!

from zigbee-herdsman-converters.

FHeilmann avatar FHeilmann commented on July 20, 2024

I've done some digging, but I've never worked with typescript before so my skills there are severely limited. My goal is to be able to send the scene commands to the mueller licht GU10 lightbulbs which I own.

I tried the following:

  • added a converter to toZigbee.js:
    tint_scene : {
        // scene selection, tint specific
        key: ['scene'],
        convertSet: async (entity, key, value, meta) => {
            value = parseInt(value);
            if (value > 6) {
              return;
            }
            await entity.command('genBasic', 'write', {'16389': value});
        },
    },
  • modified the respective entry in devices.js to use the new converter:
    // Müller Licht
    {
        zigbeeModel: ['ZBT-ExtendedColor'],
        model: '404000/404005/404012',
        vendor: 'Müller Licht',
        description: 'Tint LED bulb GU10/E14/E27 350/470/806 lumen, dimmable, color, opal white',
        fromZigbee: [
            fz.color_colortemp, fz.on_off, fz.brightness, fz.ignore_basic_report,
        ],
        toZigbee: [
            tz.light_onoff_brightness, tz.light_color_colortemp, tz.ignore_transition,
            tz.light_alert, tz.light_brightness_move, tz.tint_scene,
        ],
    },

Now I'm getting the following error when trying to set a payload with a 'scene' parameter:

zigbee2mqtt:debug 2019-12-12 22:33:00: Error: Cluster 'genBasic' has no command 'write'
    at Object.getCommand (/app/node_modules/zigbee-herdsman/dist/zcl/utils.js:106:19)
    at Endpoint.<anonymous> (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:245:37)
    at Generator.next (<anonymous>)
    at /app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:4:12)
    at Endpoint.command (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:243:16)
    at Object.convertSet (/app/node_modules/zigbee-herdsman-converters/converters/toZigbee.js:1188:26)
    at EntityPublish.onMQTTMessage (/app/lib/extension/entityPublish.js:169:52)
    at Controller.callExtensionMethod (/app/lib/controller.js:322:44)

This is where things start to go over my head, because there is a lot of data that has to be added in different places. Here's what I've found so far:

  • toZigbee.js needs to get the manufacturer info for tint added to the options dict:
         tint: {
           manufacturerCode: 0x121b,
         },
    
  • cluster.ts of zigbee-herdsman needs the following attributes added to the genBasic cluster:
    TintScene: {ID: 16389, type: DataType.uint8},
    and the following added to commands:
     write: {
                 ID: 2,
                 parameters: [
                 ],
             },
    

This would also require to rewrite the toZigbee.js converter to:

    tint_scene : {
        // scene selection, tint specific
        key: ['scene'],
        convertSet: async (entity, key, value, meta) => {
            const TintScene = parseInt(value);
            if (TintScene > 6) {
              return;
            }
            await entity.command('genBasic', 'write', {TintScene}, options.tint);
        },
    },

I'm not sure which of these steps are correct. In particular I am not sure if a manufacturerspecific cluster should be defined here, and if so, how I am going to obtain the ID of said cluster. This seems to go into the more advanced device configuration for which I as a js-know-nothing would need your help to accomplish ;)

Thanks in advance

  • Florian

P.S.: The fixed converter for incoming messages works flawlessly.

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on July 20, 2024

In the latest zigbee2mqtt dev branch this should be possible now (try in a few hours). Send to zigbee2mqtt/[FRIENDLY_NAME]/set payload {"tint_scene": 1} (where the number can be anything between 1 and 6)

from zigbee-herdsman-converters.

FHeilmann avatar FHeilmann commented on July 20, 2024

@Koenkk Works great, the only thing I noticed is that I can issue the command to the bulbs directly, but trying to issue the command to a group with several of them in it I get a 'no converter available' message.

Bests,
Florian

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on July 20, 2024

Possible with latest dev now.

from zigbee-herdsman-converters.

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.