Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEIMAN IR control HS2IRC #7814

Closed
1 task done
Idaho947 opened this issue Jun 14, 2024 · 89 comments · May be fixed by #7860
Closed
1 task done

HEIMAN IR control HS2IRC #7814

Idaho947 opened this issue Jun 14, 2024 · 89 comments · May be fixed by #7860

Comments

@Idaho947
Copy link
Contributor

Is there already an existing issue for this?

  • I have searched the existing issues and there is none for my device

Product name

HEIMAN IR control HS2IRC

Manufacturer

HEIMAN

Model identifier

HS2IRC

Device type to add

Remote

Node info

image

Endpoints and clusters

image

Basic

image

image

Further relevant clusters

Power Configuration

image

Any other cluster of relevance/interest

Identify
image

Diagnostics
image

@Smanar
Copy link
Collaborator

Smanar commented Jun 14, 2024

From that I m reading this device is standard, no Tuya magic inside.
The problem is how to integrate it in deconz, someone have already tried for this kind of device, and lot of stuff is missing.
Need for exemple command like "learn", "create", need too an array to store data.

@Idaho947
Copy link
Contributor Author

Yes, that's what I was thinking here: https://forum.phoscon.de/t/zigbee-ir-infrared-controller/4930/3

@Smanar
Copy link
Collaborator

Smanar commented Jun 14, 2024

Can make a try for a basic support.
Do you have the GUI ? if yes can be possible to use it for this device at least for a part.

@Idaho947
Copy link
Contributor Author

Yes i got it i ve made the screen shot ^^

@Smanar
Copy link
Collaborator

Smanar commented Jun 14, 2024

Ok so can make a try.
Do you know how to edit the general.xml file ? in /usr/share/deCONZ/zcl

Can add the code

    <!-- HEIMAN  -->
    <cluster id="0xfc82" name="Heiman specific" mfcode="0x120b">
      <description>Heiman specific attributes for the device HS2IRC.</description>
      <server>
        <command id="0xf0" dir="recv" name="Learn" required="m">
          <description>Learn new code</description>
          <payload>
             <attribute id="0x0000" name="Id" type="u8" default="0" access="rw" required="m"></attribute>
             <attribute id="0x0001" name="Keycode" type="u8" default="0" access="rw" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf1" dir="recv" name="Send key" required="m">
          <description>Send a code</description>
          <payload>
             <attribute id="0x0000" name="Id" type="u8" default="0" access="rw" required="m"></attribute>
             <attribute id="0x0001" name="Keycode" type="u8" default="0" access="rw" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf6" dir="recv" name="Get list" required="m">
          <description>Get list code</description>
        </command>
      </server>
      <client>
      </client>
    </cluster>

It's totally experimental, I don't know how to receive the device list, so you can make the request but to see the return you will need to enable the log (Flag ZCL is I remember).
Will be fine if the device react physically to request ...

Device can learn up to 15 devices and up to 30 keycodes for each device.
Id 1 >15
Keycode 1 > 30

I can add at least a small edit box to see device return in the GUI

@Idaho947
Copy link
Contributor Author

Ok i understand how to add the code but after I don t know what I hate to do.

@Smanar
Copy link
Collaborator

Smanar commented Jun 15, 2024

Just restart deconz for it take the change.
After that on the GUI you will see "Heiman specific" instead of "Unknow" on the cluster list on the cluster 0xFC82, and if you select it you will have access to the 3 commands.

@Idaho947
Copy link
Contributor Author

Idaho947 commented Jun 15, 2024

OK I've probably made a mistake because deconz doesn't start with the modification....

EDIT : OK done
image

Learn : the led blink one time red
Sent and get list : nothing

@Smanar
Copy link
Collaborator

Smanar commented Jun 15, 2024

You have error message printed on GUI when making tries ?
Nothing on logs ?
Values need to be > 0 (0 is not working)

Have improved a little the xml

    <!-- HEIMAN  -->
    <cluster id="0xfc82" name="Heiman specific" mfcode="0x120b">
      <description>Heiman specific attributes for the device HS2IRC.</description>
      <server>
        <command id="0xf1" dir="recv" name="Learn key" required="m">
          <description>Learn new code</description>
          <payload>
             <attribute id="0x0000" name="Id" type="u8" default="0" access="rw" required="m"></attribute>
             <attribute id="0x0001" name="Keycode" type="u8" default="0" access="rw" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf0" dir="recv" name="Send key" required="m">
          <description>Send a code</description>
          <payload>
             <attribute id="0x0000" name="Id" type="u8" default="0" access="rw" required="m"></attribute>
             <attribute id="0x0001" name="Keycode" type="u8" default="0" access="rw" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf6" dir="recv" name="Get list" required="m">
          <description>Get list code</description>
        </command>
      </server>
      <client>
        <command id="0xf2" dir="recv" name="Learn key response" required="m">
          <description>The Response to the learn key request.</description>
          <payload>
            <attribute id="0x0000" type="u8" name="Id" required="m" default="0x00"></attribute>
            <attribute id="0x0001" type="u8" name="Key Code" required="m" default="0x00"></attribute>
            <attribute id="0x0002" type="u8" name="Result" required="m" default="0x00"></attribute>
          </payload>
        </command>
        <command id="0xf7" dir="recv" name="Get list response" required="m">
          <description>The Response to the Get list request.</description>
          <payload>
            <attribute id="0x0000" type="u8" name="Total" required="m" default="0x00"></attribute>
            <attribute id="0x0001" type="u8" name="Number" required="m" default="0x00"></attribute>
            <attribute id="0x0002" type="u8" name="Length" required="m" default="0x00"></attribute>
            <attribute id="0x0003" type="ostring" name="Payload" required="m"></attribute>
          </payload>
        </command>
      </client>
    </cluster>

You will be able to see "Learn key response", and perhaps the "Get list response", but I m not sure for the last value.
For information, for "result" > 0 - success, 1 - fail

@Idaho947
Copy link
Contributor Author

image
that when I click on learn

image
that when I click for send code id 1 ; keycode 2 the light blink in green

image
that when I click for learn code id 1 ; keycode 2 the light blink in green

@Smanar
Copy link
Collaborator

Smanar commented Jun 16, 2024

Lol, bad luck, there is realy nothing for your device (except when using "learn")

that when I click on learn

You mean "Get list" ? Because you have send the command 0xf6 ?

Log are too much talkative for me, you know how work the device ? It seem you can just select a model without learning the first remote ? Or you can turn in "learn mode", use a remote to memorise code, and the device react with special blink ?

Edit:
Have found a small manual, for the learning mode, the Led need to blink in yellow, and if success a fixe yellow for 1 s
Send command > Red blink, green on.

Edit2:
Have reversed "learn" and "send key", have corrected the previous xml #7814 (comment)

@Idaho947
Copy link
Contributor Author

Idaho947 commented Jun 16, 2024

So with the new code :

When I click for get list (nothing happen on light) :
image

When I click for send code id 1 ; keycode 2 the light blink in red 1s
image

When I click for learn code id 1 ; keycode 2 the light blink in green 15s
image

@Smanar
Copy link
Collaborator

Smanar commented Jun 16, 2024

Have found a comment on Z2M

I just received mine last week. The "get_list" function will only work after you successfully created the modelID and learned a key

So have added the create model ID request

    <!-- HEIMAN  -->
    <cluster id="0xfc82" name="Heiman specific" mfcode="0x120b">
      <description>Heiman specific attributes for the device HS2IRC.</description>
      <server>
        <command id="0xf4" dir="recv" name="Create ID" required="m">
          <description>Create model ID</description>
          <payload>
             <attribute id="0x0000" name="Model type" type="u8" default="0" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf1" dir="recv" name="Learn key" required="m">
          <description>Learn new code</description>
          <payload>
             <attribute id="0x0000" name="Id" type="u8" default="0" required="m"></attribute>
             <attribute id="0x0001" name="Keycode" type="u8" default="0" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf0" dir="recv" name="Send key" required="m">
          <description>Send a code</description>
          <payload>
             <attribute id="0x0000" name="Id" type="u8" default="0" required="m"></attribute>
             <attribute id="0x0001" name="Keycode" type="u8" default="0" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf6" dir="recv" name="Get list" required="m">
          <description>Get list code</description>
        </command>
      </server>
      <client>
        <command id="0xf2" dir="recv" name="Learn key response" required="m">
          <description>The Response to the learn key request.</description>
          <payload>
            <attribute id="0x0000" type="u8" name="Id" required="m" default="0x00"></attribute>
            <attribute id="0x0001" type="u8" name="Key Code" required="m" default="0x00"></attribute>
            <attribute id="0x0002" type="u8" name="Result" required="m" default="0x00"></attribute>
          </payload>
        </command>
        <command id="0xf7" dir="recv" name="Get list response" required="m">
          <description>The Response to the Get list request.</description>
          <payload>
            <attribute id="0x0000" type="u8" name="Total" required="m" default="0x00"></attribute>
            <attribute id="0x0001" type="u8" name="Number" required="m" default="0x00"></attribute>
            <attribute id="0x0002" type="u8" name="Length" required="m" default="0x00"></attribute>
            <attribute id="0x0003" type="ostring" name="Payload" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf5" dir="recv" name="Create model response" required="m">
          <description>The Response to the Create model request.</description>
          <payload>
            <attribute id="0x0000" type="u8" name="ID" required="m" default="0x00"></attribute>
            <attribute id="0x0001" type="u8" name="Model type" required="m" default="0x00"></attribute>
          </payload>
        </command>
      </client>
    </cluster>

Model id is a value from 1 to 255.
And there is a part in the GUI called "Create model response" this one will be filled when making the request.

@Idaho947
Copy link
Contributor Author

Idaho947 commented Jun 17, 2024

When I click on Create model id :
image

When I click on learn (blink yellow) :
image

When I click on send (blink red) :
image

When I click on get list :
image

What I use :
image

@Smanar
Copy link
Collaborator

Smanar commented Jun 17, 2024

Strange thee is no more log usefull ?
Your node is 0xABA3, and all request are using the cluster 0xFC82

When I click on learn (blink yellow) :

Nice was the good color, just miss a fixe 1s yellow after, you have tried to use a remote close to it for it learn the code ?

But you haven't a part on bottom of the Cluster panel ? I don't see "Learn key response" "Create model response" and ect ... This part is never filled when you make request ? Perhaps I miss the manufacture number, I have see I need to NOT use it to send request, but for return ...

For exemple when you have used the "get list" on your log we can see you have send the 0xf6 request, perfect but the device need to answer with a command 0xf7

@Idaho947
Copy link
Contributor Author

Yes I try to learn a remote but nothing happen.
I don't have a "Learn key response" "Create model response" section.

@Smanar
Copy link
Collaborator

Smanar commented Jun 17, 2024

I don't have a "Learn key response" "Create model response" section.

Ha ? right, same on my side, but I don't see what I m doing wrong, I m asking to other devs.

@Smanar
Copy link
Collaborator

Smanar commented Jun 18, 2024

Ok so I have another xml to test ^^

    <!-- HEIMAN  -->
    <cluster id="0xfc82" name="Heiman specific" mfcode="0x120b">
      <description>Heiman specific attributes for the device HS2IRC.</description>
      <server>
        <command id="0xf4" dir="recv" name="Create ID" required="m" response="0xf5">
          <description>Create model ID</description>
          <payload>
             <attribute id="0x0000" name="Model type" type="u8" default="0" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf1" dir="recv" name="Learn key" required="m" response="0xf2">
          <description>Learn new code</description>
          <payload>
             <attribute id="0x0000" name="Id" type="u8" default="0" required="m"></attribute>
             <attribute id="0x0001" name="Keycode" type="u8" default="0" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf0" dir="recv" name="Send key" required="m">
          <description>Send a code</description>
          <payload>
             <attribute id="0x0000" name="Id" type="u8" default="0" required="m"></attribute>
             <attribute id="0x0001" name="Keycode" type="u8" default="0" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf6" dir="recv" name="Get list" required="m" response="0xf7">
          <description>Get list code</description>
        </command>
      </server>
      <client>
        <command id="0xf2" dir="recv" name="Learn key response" required="m">
          <description>The Response to the learn key request.</description>
          <payload>
            <attribute id="0x0000" type="u8" name="Id" required="m" default="0x00"></attribute>
            <attribute id="0x0001" type="u8" name="Key Code" required="m" default="0x00"></attribute>
            <attribute id="0x0002" type="u8" name="Result" required="m" default="0x00"></attribute>
          </payload>
        </command>
        <command id="0xf7" dir="recv" name="Get list response" required="m">
          <description>The Response to the Get list request.</description>
          <payload>
            <attribute id="0x0000" type="u8" name="Total" required="m" default="0x00"></attribute>
            <attribute id="0x0001" type="u8" name="Number" required="m" default="0x00"></attribute>
            <attribute id="0x0002" type="u8" name="Length" required="m" default="0x00"></attribute>
            <attribute id="0x0003" type="ostring" name="Payload" required="m"></attribute>
          </payload>
        </command>
        <command id="0xf5" dir="recv" name="Create model response" required="m">
          <description>The Response to the Create model request.</description>
          <payload>
            <attribute id="0x0000" type="u8" name="ID" required="m" default="0x00"></attribute>
            <attribute id="0x0001" type="u8" name="Model type" required="m" default="0x00"></attribute>
          </payload>
        </command>
      </client>
    </cluster>

For this one for sure, you will be able to see all te xml, but not sure it will work, not logic for me

@Idaho947
Copy link
Contributor Author

Sorry for the delay, I miss your answer.

Get list :
image

image

Create model ID :
image

image

Learn :
image

image

Send :
image

@Smanar
Copy link
Collaborator

Smanar commented Jun 20, 2024

Ha nice, this time there is something usable.

  • Create model ID > Model type is the same you have used, so fine, the ID = 8 mean the device have selected the ID 8 for this model (value can go from 1 to 15.
  • Learn key > here better to try with the ID 8, same value, and result = 0 (0 = succed, 1 = fail) so fine for me too.
  • Get list > Total = 1, mean you have at least one memorised, Number = 1 , mean you are displaying the number 1 (it's a list but for the moment can display only one), lenght is the data length stored for this device, and the payload is buggy.

So first can try to decode the payload, on your situation it need to be 17 byte length, can try to get it as string, can you replace

<attribute id="0x0003" type="ostring" name="Payload" required="m"></attribute>

by

<attribute id="0x0003" type="cstring" name="Payload" required="m" showas="hex"></attribute>

When you press the "exec" button you haven't a fast return message (displayed just 1s).

Now about the device, you have succesfuly memorised at least 1 code, IDK what you have done but It have worked, the problem is without the "Get list" request, you are forced to remember yourself the ID and the keycode.

Now the hard part, have made some tries on my side, and the better flags to use to have all raw zigbee data is using APS + APS_L2. Problem you will have so talkative logs.
A usefull one look like this one

17:24:53:934 APS-DATA.indication srcAddr: 0x40FF, srcEp: 0x00 dstAddrMode: 2, profile: 0x0000, cluster: 0x8031, lqi: 179, rssi: -77
17:24:53:935 	asdu: 78000300039d9e02ffff2e21009d9e02ffff2e21000000040200539d9e02ffff2e2100550617000074040034b925020f769d9e02ffff2e210056383f02008d1500977a12000290

APS-DATA.indication mean it's from the device, else it's APS-DATA.request
cluster: 0x8031 : here need to have 0xFC82
asdu is the usefull part, I will decode it myself.

But this is only usefull if the request "Get list" don't work with last change using the GUI. For exemple if length = 17, you need to have as payload something like 0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

@Idaho947
Copy link
Contributor Author

Idaho947 commented Jun 30, 2024

Hello,

Sorry for the dealy.

It works ! I lean two commande (on and off) for a philips light with fan and the light goes on and off ! Don't know if you need more info.

Now how can I use it in HA. I think I need a new ddf ?

Do you know what a model type is ?
image

@Smanar
Copy link
Collaborator

Smanar commented Jun 30, 2024

Do you know what a model type is ?

Model type is a value from 1 to 255, IDK if there is a "rules" somewhere for value. Pehaps used by the native application ?

Now how can I use it in HA. I think I need a new ddf ?

Yeah, and experimental ^^

{
  "schema": "devcap1.schema.json",
  "manufacturername": "HEIMAN",
  "modelid": "IRControl-EM",
  "vendor": "HEIMAN",
  "product": "HS2IRC",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0xFC82"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "read": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "fn": "zcl:attr"
          },
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val/2",
            "fn": "zcl:attr"
          },
          "default": 0
        },
        {
          "name": "config/preset",
          "write": {
            "fn": "zcl:cmd",
            "ep": "0x01",
            "cl": "0xfc82",
            "cmd": "0xf0",
            "eval": "'00'+ ('0'+parseInt(Item.val.split(",")[0]).toString(16)).slice(-2) + '00' + ('0'+parseInt(Item.val.split(",")[1]).toString(16)).slice(-2);"
          }
        },
        {
          "name": "config/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 300,
          "max": 2700,
          "change": "0x00000001"
        }
      ]
    }
  ]
}

If I m right with this code, you will be to send a code using curl

curl -H 'Content-Type: application/json' -X PUT -d '{"preset": "2.3"}' http://IP:PORT/api/KEY/sensors/ID/config

To resume need to send a string composed by "id,code", the JS code will transform it to 00XX00YY with hexa value (visible on asdu on logs).
And idk why I need to use 0x00 and no 0x20, according to data type, so I m not sure here.

If you have problem with APS log, I think the magic will be visible too on log "DDF"

If I remember you are on Jeedom ? so you can mimic a config/preset request if you already have a thermostat. I have used this one because it'a string too by defaut.

@Idaho947
Copy link
Contributor Author

Idaho947 commented Jun 30, 2024

I try to validate the json on jsonlit and see that :

Error: Parse error on line 70:
...Int(Item.val.split(",")[1]).toString(16)
-----------------------^
Expecting ':', got ','

line 70 :

"eval": "'00'+ ('0'+parseInt(Item.val.split(",")[0]).toString(16)).slice(-2) + '00' + ('0'+parseInt(Item.val.split(",")[1]).toString(16)).slice(-2);"

Normal ?

I was on jeedom but now in home assistant.

@Smanar
Copy link
Collaborator

Smanar commented Jun 30, 2024

Ha yes right need to escape the quote or can use

"eval": "'20'+ ('0'+parseInt(Item.val.split(',')[0]).toString(16)).slice(-2) + '20' + ('0'+parseInt(Item.val.split(',')[1]).toString(16)).slice(-2);"

@Idaho947
Copy link
Contributor Author

"eval": "'20'+ ('0'+parseInt(Item.val.split(',')[0]).toString(16)).slice(-2) + '20' + ('0'+parseInt(Item.val.split(',')[1]).toString(16)).slice(-2);"

or

"eval": "'00'+ ('0'+parseInt(Item.val.split(',')[0]).toString(16)).slice(-2) + '20' + ('0'+parseInt(Item.val.split(',')[1]).toString(16)).slice(-2);"

@Smanar
Copy link
Collaborator

Smanar commented Jun 30, 2024

"eval": "'00'+ ('0'+parseInt(Item.val.split(',')[0]).toString(16)).slice(-2) + '00' + ('0'+parseInt(Item.val.split(',')[1]).toString(16)).slice(-2);"

I was using "20" because its the logic for me, but according to some logs need to use "00"

@Idaho947
Copy link
Contributor Author

Idaho947 commented Jun 30, 2024

The ddf seems to be apply to the remote :
image

See in phoscon :
image

See that in HA. Can we delete the battery (in ha and deconz GUI) ? :
image

What I have to do after ? send a put command in http://xxxxx/api/apikey/sensor/669/config ?

Try this but doesn't work (try a point and a coma between (10 and 2) :
image

@Smanar
Copy link
Collaborator

Smanar commented Jul 1, 2024

See that in HA. Can we delete the battery (in ha and deconz GUI) ? :

But this device don't have battery ? it have good attributes used. Else I can remove them in the DDF.

Try this but doesn't work (try a point and a coma between (10 and 2) :

It's a comma ",", and at least your procedure is fine, and deconz seem receive it.
Can you make a try with log "DDF" in deconz, you will see your value and the "magic" done by the DDF.

@Idaho947
Copy link
Contributor Author

Idaho947 commented Jul 1, 2024

The device is plugged into a usb cable.

I try the ;. It doesn't work. The sensor doesn't react (non red blink led) to :
{"preset": "10;1"}

@Idaho947
Copy link
Contributor Author

Ok so when I send 10,3 see that in log :

image

@Smanar
Copy link
Collaborator

Smanar commented Aug 12, 2024

All is fine in logs, but in the GUI do you have the complete payload ? or just the first char like here

image

It's not possible to decrypt it using the GUI, but I can make a script in python to do that, the user will just need to give the payload (if he can get it without using logs)

@Idaho947
Copy link
Contributor Author

Hello,

Just got that :
image

@Smanar
Copy link
Collaborator

Smanar commented Aug 12, 2024

Arf :( even with using "cstring" instead of "ostring" ?

The first byte is 0x01 and the second one 0x63, so for me decnz have take the first one as size, so it display only the second one alone (1 byte lenght)

@Idaho947
Copy link
Contributor Author

Idaho947 commented Aug 12, 2024

Got that with <attribute id="0x0003" type="cstring" name="Payload" required="m" showas="hex"></attribute>
image

@Smanar
Copy link
Collaborator

Smanar commented Aug 12, 2024

"c" is the ascii number for 0x63 ....
I will ask to other devs what I m doing bad.

@Smanar
Copy link
Collaborator

Smanar commented Aug 12, 2024

You are using showas="hex" too ? the next char is 0x02, so not possible using ASCII

@Idaho947
Copy link
Contributor Author

Idaho947 commented Aug 12, 2024

Yes I just copy past the line with showas="hex

@Smanar
Copy link
Collaborator

Smanar commented Aug 12, 2024

Ha, I have an idea, as deconz use the first byte as lenght, we can try to catch the payload 1 byte before, like that it will use the good lenght
With replacing

           <attribute id="0x0002" type="u8" name="Length" required="m" default="0x00"></attribute>
            <attribute id="0x0003" type="ostring" name="Payload" required="m"></attribute>

by

       ` <attribute id="0x0002" type="ostring" name="Payload" required="m" showas="hex"></attribute>`

So it take the payload 1 byte before, and start by the lengh.

@Idaho947
Copy link
Contributor Author

Idaho947 commented Aug 18, 2024

Hello,

I got this for the first one :
image

The payload is very long :
image

I got this for the second one I use in the living room :
image

@Smanar
Copy link
Collaborator

Smanar commented Aug 18, 2024

Perfect thx, have updated the PR and start to make a python code to decrypt the payload
You can use it in this site for exemple https://www.onlinegdb.com/online_python_debugger

payload = "0x016301020201000301000401000501000601000701000801000901000A0104010203040B0200"
if payload.startswith('0x'):
    payload = payload[2:]

i = 0
while i < len(payload):
    id = int(payload[i:i+2],16)
    model = int(payload[i+2:i+4],16)
    nbrekey = int(payload[i+4:i+6],16)
    key = ''
    j = 0
    while j < nbrekey:
        if j > 0:
            key = key + ', '
        key = key + payload[i+6+j*2:i+6+2+j*2]
        j = j + 1
    i = i + 6 + int(nbrekey)*2
    print("ID:" + str(id) + ", Model:"+ str(model) + ", key(" + str(nbrekey) + "):" + str(key))
print ('end')

result

ID:1, Model:99, key(1):02
ID:2, Model:1, key(0):
ID:3, Model:1, key(0):
ID:4, Model:1, key(0):
ID:5, Model:1, key(0):
ID:6, Model:1, key(0):
ID:7, Model:1, key(0):
ID:8, Model:1, key(0):
ID:9, Model:1, key(0):
ID:10, Model:1, key(4):01, 02, 03, 04
ID:11, Model:2, key(0):
end

It's probably possible to make this code in JS to use it in DDF, but not sure lot of people will use it.

@Idaho947
Copy link
Contributor Author

Idaho947 commented Aug 20, 2024

You need something from me ?

@Smanar
Copy link
Collaborator

Smanar commented Aug 20, 2024

Yes, do you have the Jennifer Aniston phone number ?
No seriously, it depend of you, for me all is working, this device don't have more secret for me. And the PR is in waiting list.
Depend of you, do you want to improve something ? Want more request to be usable with the API ?

@Idaho947
Copy link
Contributor Author

No it s ok for me too.

Jennifer Aniston... Seriously ? 😋

@Smanar
Copy link
Collaborator

Smanar commented Aug 20, 2024

Lol, why not, she is single ATM no ? (and no, I m not spy her life ...)

I have no return for the PR yet, so idk when (or if) it will be merged, but if you want improvements, just ask, I will see what I can do.

@Idaho947
Copy link
Contributor Author

Any news about the pr ?

@Smanar
Copy link
Collaborator

Smanar commented Aug 27, 2024

Nope, it's complete and not so hacky but not return yet.

@Idaho947
Copy link
Contributor Author

Ok hope for the next maj. Thanks

Copy link
Contributor

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Sep 18, 2024
@Idaho947
Copy link
Contributor Author

Hello , wait for an addition in stable version. Please dont close it.

@Smanar Smanar removed the stale label Sep 18, 2024
@Idaho947
Copy link
Contributor Author

Just maj on 2.28.1 and it doesn't work.
I add the ddf and the code in general.xml.

See that :
image

Preset desapear. It's still ok with the GUI.

@Smanar
Copy link
Collaborator

Smanar commented Sep 24, 2024

Perhaps the DDF have not worked because you miss "config_sendkey_item.json" , "config_learnkey_item.json" and the change in "constants.json)" ?

ATM you have the defaut device a ZHAswitch instead of the ZHAControl.

@Idaho947
Copy link
Contributor Author

Ah ok understand, the new ddf need more change. I ll rool back to the old methode 🤣

@SwoopX SwoopX linked a pull request Oct 7, 2024 that will close this issue
Copy link
Contributor

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Oct 16, 2024
Copy link
Contributor

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants