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

ZS-06 / Zigbee IR Remote Control / TS1201 #6814

Closed
Xyaren opened this issue Mar 22, 2023 · 104 comments
Closed

ZS-06 / Zigbee IR Remote Control / TS1201 #6814

Xyaren opened this issue Mar 22, 2023 · 104 comments

Comments

@Xyaren
Copy link
Contributor

Xyaren commented Mar 22, 2023

Device

  • Product name: Zigbee IR Remote Control
  • Manufacturer: _TZ3290_7v1k4vufotpowp9z
  • Model identifier: TS1201
  • Device type:
    • Other: IR Blaster

ZS seems to stand for ZOSUNG

Bought at https://www.aliexpress.com/item/1005003878194474.html

Device Image

image

Screenshots

Basic & Device

image

image

Node Info
image

Basic

image

Groups

image

Scenes

image

Identify

image

ED00 Unknown

Empty

ED04 Unknown

Empty

On/Off

image

OTAU

image

Time

image

Green Power

image

Zigbee2mqtt

I tested the device using zigbee2mqtt and it works.
Device link: https://www.zigbee2mqtt.io/devices/ZS06.html
Implementation links:

Related to #6470 (inactive) but not the same device.

@Mimiix
Copy link
Collaborator

Mimiix commented Mar 22, 2023

Please add all requested screenshots.

@Xyaren
Copy link
Contributor Author

Xyaren commented Mar 22, 2023

Please add all requested screenshots.

What are you missing ?

@Mimiix
Copy link
Collaborator

Mimiix commented Mar 22, 2023

Please read the the template. It clearly states what we need :)

@Xyaren
Copy link
Contributor Author

Xyaren commented Mar 22, 2023

Updated

@Mimiix
Copy link
Collaborator

Mimiix commented Mar 22, 2023

thanks :)

@BabaIsYou
Copy link
Contributor

I think that Basic cluster is still mssing.

@Mimiix
Copy link
Collaborator

Mimiix commented Mar 24, 2023

Agree.

It was there before, in his 3rd edit.

@Xyaren canyou make sure Basic is back?

@BabaIsYou
Copy link
Contributor

BTW not sure that we could answer something more than previous @Smanar answer : #6470 (comment)

@Xyaren
Copy link
Contributor Author

Xyaren commented Mar 24, 2023

Sorry I got really confused and startet all over. Should be in now.

I can't keep the other Issue open. Also this is a different device, therefore I thought this should be a different Issue.

I really hope there is a way to get this working with deconz.
I understand C++ Implementation is not desired, but on the other hand DDF is not supporting this usecase,

@BabaIsYou
Copy link
Contributor

BabaIsYou commented Apr 5, 2023

Once we find a way it will also cover devices _TZ3290_acv1iuslxi3shaaj TZ3290_j37rooaxrcdcqo5n and _TZ3290_ot6ewjvmejq5ekhl

BTW, I'm in an unknown field, then ask for other devs if it coud be that minimaly you have something like this in general.xml (don't have the device myself to test)?

     <cluster id="0xe004" name="Zosung specific cluster" mfcode="0x1002">
			<description>IR Remote Control cluster</description>
			<server>
			   <attribute id="0x0000" type="cstring" name="last learned IR code" required="o"> </attribute>
			   <command id="0x01" dir="recv" name="IR Learning mode" required="m" mfcode="0x1002">
                               <description>This command place device in IR learning mode</description>
				<payload>
				<attribute id="0x00" type="bool" name="On/Off" required="m">
					<value name="Off" value="0x00"></value>
					<value name="On" value="0x01"></value>
				</attribute>
				</payload>
			</command>
			<command id="0x02" dir="recv" name="Send IR Code" required="m" mfcode="0x1002">
			<description>This command send base64 IR code</description>
			<payload>
				<attribute id="0x00" type="cstring" name="Code" required="m">
				</attribute>
			</payload>
			</server>
			<client>
			</client>
	  </cluster>

Extrapolation from : https://github.com/ferehcarb/zha-device-handlers/blob/039fe46b57328584d13036541558bb6fed72291a/zhaquirks/tuya/ts1201.py#L53 and zigpy/zha-device-handlers#1687

@Xyaren
Copy link
Contributor Author

Xyaren commented Apr 6, 2023

Good start !
After some tweaking I can see "something":
I added

    <cluster id="0xe004" name="Zosung specific cluster" mfcode="0x1002">
      <description>IR Remote Control cluster</description>
      <server>
        <attribute id="0x0000" type="cstring" name="last learned IR code" access="r" required="o">
          <description>Last Learned IR Code</description>
        </attribute>
        <command id="0x01" dir="recv" name="IR Learning mode" required="m" mfcode="0x1002">
          <description>This command place device in IR learning mode</description>
          <payload>
            <attribute id="0x00" type="bool" name="On/Off" required="m">
              <value name="Off" value="0x00"></value>
              <value name="On" value="0x01"></value>
            </attribute>
          </payload>
        </command>
        <command id="0x02" dir="recv" name="Send IR Code" required="m" mfcode="0x1002">
          <description>This command send base64 IR code</description>
          <payload>
            <attribute id="0x00" type="cstring" name="Code" required="m">
            </attribute>
          </payload>
        </command>
      </server>
      <client>
      </client>
    </cluster>

under <domain name="Manufacturer Specific" useZcl="true" description="Manufacturer specific clusters.">

And this is the result:
image

It's not working though:

  • IR Learning Mode is not working (No LED / Reaction from the device)
  • IR Send is not triggering anything (Checked with entering random numbers and presing exec - no IR emitted - checked with phone camera)
  • The attribute show a static "3" no matter what I try

Looking at this: https://github.com/Koenkk/zigbee-herdsman-converters/blob/9d5e7b902479582581615cbfac3148d66d4c675c/lib/zosung.js#L218 it seems that some sort of JSON Payload is needed for activating the IR Learning.

Also here:
https://github.com/ferehcarb/zha-device-handlers/blob/039fe46b57328584d13036541558bb6fed72291a/zhaquirks/tuya/ts1201.py#L120

@BabaIsYou
Copy link
Contributor

Had no hope to have it working at first try ! ;-(
But nice try.
BTW there is something wrong on the Last learned code attribute because that should be a string and not a u16 … that’s perhaps why it displays a number.

Perhaps that also some bindings should help later to have this attribute read automatically. But that part could be seen later. For the moment if we could have it read by the gui it would be great.

I may be wrong but I don’t think that a payload is needed to put device in learning mode.

@Xyaren
Copy link
Contributor Author

Xyaren commented Apr 6, 2023

BTW there is something wrong on the Last learned code attribute because that should be a string and not a u16 … that’s perhaps why it displays a number.

I noticed that too but in the xml it is typed as cstring.
EDIT: It changes to u16 once i click "read". Initially it is on the configured type.

I may be wrong but I don’t think that a payload is needed to put device in learning mode.

What makes you think that ? All existing Implementations do use Json data to trigger any action on the device.
Learing and Sending.

@Xyaren
Copy link
Contributor Author

Xyaren commented Apr 6, 2023

I think I figured out where the "3" is comming from.
As the attribute in the xml is missing the mfcode="0x1002" it is probably reading the ZCL Version from the 0x0000 Cluster :(

@BabaIsYou
Copy link
Contributor

I think that the attribute is embedded inside cluster-id that contains mec and cluster number. But could add mfc to the attribute to try

@Xyaren
Copy link
Contributor Author

Xyaren commented Apr 6, 2023

Tried it and it's just greyed out once i press "read" :(

The clusters are described in zigbee herdsman but I wasn't able to figure out anything working using these values yet.

https://github.com/Koenkk/zigbee-herdsman/blob/61b701e8826d0120833a5485ebd595d4a2a5cfe9/src/zcl/definition/cluster.ts#L5115

https://github.com/Koenkk/zigbee-herdsman/blob/61b701e8826d0120833a5485ebd595d4a2a5cfe9/src/zcl/definition/cluster.ts#L5031

My current try based on the links above

<cluster id="0xed00" name="Zosung IR Transmit" mfcode="0x1002">
      <description>IR Remote Transmit Cluster</description>
      <server>
      </server>
      <client>
      </client>
    </cluster>
    <cluster id="0xe004" name="Zosung IR Control" mfcode="0x1002">
      <description>IR Remote Control Cluster</description>
      <server>
        <attribute id="0x0000" type="cstring" name="last learned IR code" access="r" required="o">
          <description>Last Learned IR Code</description>
        </attribute>
        <command id="0x00" dir="recv" name="Command 00" required="m" mfcode="0x1002">
          <description>Unknown</description>
          <payload>
            <attribute id="0x00" type="bool" name="On/Off" required="m">
              <value name="Off" value="0x00"></value>
              <value name="On" value="0x01"></value>
            </attribute>
            <!--            <attribute id="0x00" type="cstring" name="data" required="m"></attribute>-->
          </payload>
        </command>
      </server>
      <client>
      </client>
    </cluster>

No Success unfortunately.

I also tried defining the command/attribute as cstring and putting in JSON {"study":1} but no success.

@Xyaren
Copy link
Contributor Author

Xyaren commented Apr 6, 2023

I tried blindly adding some more attributes and found this, after unplugging/replugging the device:

image

the {"num": 10} looks a bit like part of https://github.com/Koenkk/zigbee-herdsman-converters/blob/9d5e7b902479582581615cbfac3148d66d4c675c/lib/zosung.js#L195

@Smanar
Copy link
Collaborator

Smanar commented Apr 6, 2023

Can you try that for the enable/disable

    <cluster id="0xE004" name="Zosung IR Control" mfcode="0x1002">
      <description>xxxxxxxxxxxx</description>
      <server>
          <attribute id="0001" name="IR Learning mode" type="bool" access="r" default="0" required="m">
            <value name="On" value="1"></value>
            <value name="Off" value="0"></value>
          </attribute>

@Xyaren
Copy link
Contributor Author

Xyaren commented Apr 6, 2023

Can you try that for the enable/disable

    <cluster id="0xE004" name="Zosung IR Control" mfcode="0x1002">
      <description>xxxxxxxxxxxx</description>
      <server>
          <attribute id="0001" name="IR Learning mode" type="bool" access="r" default="0" required="m">
            <value name="On" value="1"></value>
            <value name="Off" value="0"></value>
          </attribute>

image

I don't think this device has an attribute for "learning mode".
Instead you send a command, to enable learning mode {"study":1} and any detected IR Signal is written to attrbute 0x0000 in the 0xe004 Cluster.

@BabaIsYou
Copy link
Contributor

BabaIsYou commented Apr 6, 2023

I don't think this device has an attribute for "learning mode".
Instead you send a command, to enable learning mode {"study":1} and any detected IR Signal is written to attrbute 0x0000 in the 0xe004 Cluster.

Looks like something like this. It seems that there are several commands but one attribute. And for send IR the payload is the base64 code in a string and for enabling/disabling IR learning the payload is the value on or off (as bool value)

@BabaIsYou
Copy link
Contributor

Would be interesting to grab log when sending command.

@Xyaren
Copy link
Contributor Author

Xyaren commented Apr 6, 2023

Where do you see the boolean part?

How do I get the log?

@BabaIsYou
Copy link
Contributor

BabaIsYou commented Apr 6, 2023

Where do you see the boolean part?

Your’ re right, it’s perhaps not a Boolean value but a json payload like in https://github.com/Koenkk/zigbee-herdsman-converters/blob/9d5e7b902479582581615cbfac3148d66d4c675c/lib/zosung.js#L218 with {"study":0}, and the. {"study":1} to disable it. That’s why I called it a Boolean … but seems better to call it a value 0 or 1 for parameter « study » in the payload json of command 0x00. But don’t know how to articulate that in general.xml syntax or perhaps a combination of general.xml and .js called in a DDF.

Regarding log : have to pass in debug view in Deconz GUI and activate some log options … but at this level don’t really know which ones. Will begin with INFO and ZCL

@BabaIsYou
Copy link
Contributor

the {"num": 10} looks a bit like part of

You’re right. But it couldn’t be an attribute, that should be part of the payload as a json.

@Xyaren
Copy link
Contributor Author

Xyaren commented Apr 7, 2023

Not sure how to isolate the log for this device only, without redoing my whole network afterwards.

As soon as I press the button I get

11:23:46:656 ZCL cmd-req nwk: 0xAE43, profile: 0x0104, cluster: 0xE004 cmd: 0x00

But thats it :/

@BabaIsYou
Copy link
Contributor

BabaIsYou commented Apr 7, 2023 via email

@Xyaren
Copy link
Contributor Author

Xyaren commented Apr 7, 2023

    <cluster id="0xE004" name="Zosung IR Control" mfcode="0x1002">
      <description>IR Remote Control Cluster</description>
      <server>
        <attribute id="0" name="IR Learned Code" type="u16" access="r" required="m">
        </attribute>
        <command id="0x00" dir="recv" name="Command 00" required="m" mfcode="0x1002">
          <description>Unknown</description>
          <payload>
            <attribute id="0x00" type="bool" name="On/Off" required="m">
              <!--<value name="Off" value="{&quot;study&quot;:0}"></value>-->
              <!--<value name="On"  value="{&quot;study&quot;:1}"></value>-->
              <value name="Off" value="{study:0}"></value>
              <value name="On"  value="{study:1}"></value>
            </attribute>
          </payload>
        </command>
      </server>
      <client>
      </client>
    </cluster>

No luck, no reaction from the device, no difference in the log.

I tried with and without quotation marks.

@BabaIsYou
Copy link
Contributor

BabaIsYou commented Jun 1, 2023

That’s why I choosed at first to get all that we can thru general.xml … then perhaps this could help us to go further #6814 (comment)
We can use an attribute calling a js script … that’s not a trouble

@BabaIsYou
Copy link
Contributor

  • All of the working ones seem to have 13 Characters

Then this one { "study" : 1} should also be correct and may be it's what is done by other projet when "jsoning" the buffer before sending command in JS

@Xyaren
Copy link
Contributor Author

Xyaren commented Jun 1, 2023

  • All of the working ones seem to have 13 Characters

Then this one { "study" : 1} should also be correct and may be it's what is done by other projet when "jsoning" the buffer before sending command in JS

Thats 14 characters ;)

I thought so aswell but JSON.stringify({'study': 1}) results in {"study":1} (11 Chars)

https://github.com/Koenkk/zigbee-herdsman-converters/blob/9d5e7b902479582581615cbfac3148d66d4c675c/lib/zosung.js#LL173C25-L173C25

console.log(Buffer.from(JSON.stringify({'study': 0})))
<Buffer 7b 22 73 74 75 64 79 22 3a 30 7d>

11 Characters

@BabaIsYou
Copy link
Contributor

Thats 14 characters ;)

You're right ... I would write {"study" : 1}

@BabaIsYou
Copy link
Contributor

So we would need to have a new DDF functionality for device attributes to be parsed from a "command listener" instead of zcl attribute. The data should then be passed to a js expression/file that returns the appropriate value.

Can this be done without dresden-elektronik ? As far as I understand we only have access to the rest plugin.

I think we already have it, have a look to :

@Xyaren
Copy link
Contributor Author

Xyaren commented Jun 16, 2023

Updated files:

DDF: ir.json

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZ3290_7v1k4vufotpowp9z",
  "modelid": "TS1201",
  "product": "TS1201",
  "sleeper": false,
  "status": "Silver",
  "path": "/devices/ir.json",
  "subdevices": [
    {
      "type": "$TYPE_RANGE_EXTENDER",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0xf000",
        "endpoint": "0x01",
        "in": [ "0x0000","0xed00"]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "fn": "zcl:cmd",
            "cmd": "0x00",
            "cl": "0xed00",
            "ep": "0x01",
            "script": "ir.js"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ]
}
/* global Item, R, ZclFrame */

let s = "Data: ";
if (ZclFrame.cmd === 0x00) {
    for (let i = 0; i < ZclFrame.payloadSize; i++) {
        s += "" + i + ":";
        s += "" + ZclFrame.at(i);
        s += " ";
    }
}
Item.val = s;

ir.xml (Loaded after general.xml)

<?xml version="1.0" encoding="UTF-8"?>
<zcl>
<profile id="0x0104" name="Home Automation" description="This profile defines device descriptions and standard practices for applications needed in a residential or light commercial environment. Installation scenarios range from a single room to an entire home up to 20,000 square feet (approximately 1850m2)." version="1.0" rev="25" icon="ha.png">
        <domain-ref name="General" low_bound="0000" />
        <domain-ref name="Measurement and Sensing" low_bound="0400" />
        <domain-ref name="Lighting" low_bound="0300" />
        <domain-ref name="HVAC" low_bound="0200" />
        <domain-ref name="Closures" low_bound="0100" />
        <domain-ref name="Security and Safety" low_bound="0500" />
        <domain-ref name="Smart Energy" low_bound="0x0700" />
        <domain-ref name="Appliances" low_bound="0x0b00" />
        <domain-ref name="Light Link" low_bound="1000" />
        <domain-ref name="Manufacturer Specific" low_bound="0xf000" />
        <device id="0x000c" name="Simple sensor" icon="dev-light-sensor.png">
            <description></description>
        </device>
        <device id="0xf000" name="Manufacturer Specific Device" description=""></device>
        <device id="0x0010" name="On/off plug-in unit" description=""></device>
        <device id="0x0051" name="Smart plug" description=""></device>
        <device id="0x0100" name="On/off light" description="" icon="dev-on-off-light.png"></device>
        <device id="0x0110" name="Dimmable plug-in unit" description="" icon="dev-on-off-light.png"></device>
        <device id="0x0200" name="Color light" description="" icon="dev-on-off-light.png"></device>
        <device id="0x0210" name="Extended color light" description="" icon="dev-on-off-light.png"></device>
        <device id="0x0220" name="Color temperature light" description="" icon="dev-on-off-light.png"></device>
        <device id="0x0800" name="Color controller" description=""></device>
        <device id="0x0810" name="Color scene controller" description=""></device>
        <device id="0x0820" name="Non color controller" description=""></device>
        <device id="0x0830" name="Non color scene controller" description=""></device>
        <device id="0x0840" name="Control bridge" description=""></device>
        <device id="0x0850" name="On/off sensor" description=""></device>
    </profile>
    <domain name="Manufacturer Specific" useZcl="true" description="Manufacturer specific clusters.">

        <!-- Zosung -->
        <cluster id="0xe004" name="Zosung Specific IR control" mfcode="0x1002">
            <description>IR Remote Control cluster</description>
            <server>
                <attribute id="0x0000" name="Last learned IR code" type="lostring" mfcode="0x1002" access="rw"
                           required="o">
                </attribute>
                <command id="0x00" dir="recv" name="ControlIRCommand00" required="m">
                    <description>This command starts IR learning mode
                        {&quot;study&quot; : 0} for On
                        {&quot;study&quot; : 1} for Off
                        Note that the total length must be 13 characters including spaces (
                    </description>
                    <payload>
                        <attribute id="0x0000" type="cstring" name="study" required="m"
                                   default="{&quot;study&quot; : 0}">
                            <description>Value to send to the device to control learning mode</description>
                        </attribute>
                    </payload>
                </command>
            </server>
            <client>
            </client>
        </cluster>
        <cluster id="0xed00" name="Zosung Specific IR transmit" mfcode="0x1002">
            <description>IR transmit cluster</description>
            <server>
                <command id="0x00" dir="recv" name="SendIRCode00" required="m">
                    <payload>
                        <attribute id="0x00" type="u16" name="seq" required="m"></attribute>
                        <attribute id="0x01" type="u32" name="length" required="m"></attribute>
                        <attribute id="0x02" type="u32" name="unk1" required="m" default="0x00000000"
                                   showas="hex"></attribute>
                        <attribute id="0x03" type="u16" name="unk2" required="m" default="0xe004"
                                   showas="hex"></attribute>
                        <attribute id="0x04" type="u8" name="unk3" required="m" default="0x01" showas="hex"></attribute>
                        <attribute id="0x05" type="u8" name="cmd" required="m" default="0x02" showas="hex"></attribute>
                        <attribute id="0x06" type="u16" name="unk4" required="m" default="0x0000"
                                   showas="hex"></attribute>
                    </payload>
                </command>
                <command id="0x01" dir="recv" name="SendIRCode01" required="m">
                    <payload>
                        <attribute id="0x00" type="u8" name="zero" required="m" default="0"></attribute>
                        <attribute id="0x01" type="u16" name="seq" required="m"></attribute>
                        <attribute id="0x02" type="u32" name="length" required="m"></attribute>
                        <attribute id="0x03" type="u32" name="unk1" required="m" default="0x00000000"
                                   showas="hex"></attribute>
                        <attribute id="0x04" type="u16" name="unk2" required="m" default="0xe004"
                                   showas="hex"></attribute>
                        <attribute id="0x05" type="u8" name="unk3" required="m" default="0x01" showas="hex"></attribute>
                        <attribute id="0x06" type="u8" name="cmd" required="m" default="0x02" showas="hex"></attribute>
                        <attribute id="0x07" type="u16" name="unk4" required="m" default="0x0000"
                                   showas="hex"></attribute>
                    </payload>
                </command>
                <command id="0x02" dir="recv" name="SendIRCode02" required="m">
                    <payload>
                        <attribute id="0x00" type="u8" name="seq" required="m"></attribute>
                        <attribute id="0x01" type="u32" name="position" required="m" default="0"></attribute>
                        <attribute id="0x02" type="u8" name="maxlen" required="m" default="0x38"
                                   showas="hex"></attribute>
                    </payload>
                </command>
                <command id="0x03" dir="recv" name="SendIRCode03" response="0x03" required="m">
                    <payload>
                        <attribute id="0x00" type="u8" name="zero" required="m" default="0"></attribute>
                        <attribute id="0x01" type="u16" name="seq" required="m"></attribute>
                        <attribute id="0x02" type="u32" name="position" required="m"></attribute>
                        <attribute id="0x03" type="ostring" name="msgpart" required="m"></attribute>
                        <attribute id="0x04" type="u8" name="msgpartcrc" required="m"></attribute>
                    </payload>
                </command>
                <command id="0x04" dir="recv" name="SendIRCode04" required="m">
                    <payload>
                        <attribute id="0x00" type="u8" name="zero0" required="m" default="0"></attribute>
                        <attribute id="0x01" type="u16" name="seq" required="m"></attribute>
                        <attribute id="0x02" type="u16" name="zero1" required="m" default="0"></attribute>
                    </payload>
                </command>
                <command id="0x05" dir="recv" name="SendIRCode05" response="0x05" required="m">
                    <payload>
                        <attribute id="0x00" type="u16" name="seq" required="m"></attribute>
                        <attribute id="0x01" type="u16" name="zero" required="m" default="0"></attribute>
                    </payload>
                </command>
            </server>
            <client>
                <command id="0x03" dir="recv" name="SendIRCode03Resp" required="m">
                    <payload>
                        <attribute id="0x00" type="u8" name="zero" required="m" default="0"></attribute>
                        <attribute id="0x01" type="u16" name="seq" required="m"></attribute>
                        <attribute id="0x02" type="u32" name="position" required="m" default="0"></attribute>
                        <attribute id="0x03" type="ostring" name="msgpart" required="m"></attribute>
                        <attribute id="0x04" type="u8" name="msgpartcrc" required="m"></attribute>
                    </payload>
                </command>
                <command id="0x05" dir="recv" name="SendIRCode05Resp" required="m">
                    <payload>
                        <attribute id="0x00" type="u16" name="seq" required="m"></attribute>
                        <attribute id="0x01" type="u16" name="zero" required="m" default="0"></attribute>
                    </payload>
                </command>
            </client>
        </cluster>
    </domain>
</zcl>

For testing I am trying to use the swversion attribute (due to the lack of a better alternative)
It seems the expression is at least triggered.

If I undestand https://github.com/ferehcarb/zha-device-handlers/blob/039fe46b57328584d13036541558bb6fed72291a/zhaquirks/tuya/ts1201.py correctly, there is a whole chain of commands that needs to be triggered from the initial event.

@BabaIsYou
Copy link
Contributor

If I undestand https://github.com/ferehcarb/zha-device-handlers/blob/039fe46b57328584d13036541558bb6fed72291a/zhaquirks/tuya/ts1201.py correctly, there is a whole chain of commands that needs to be triggered from the initial event.

Yes, like we already saw it #6814 (comment) (and in the different links already referenced). Now the deal is to "translate" this into a .js script triggered by a "parse" function from into DDF like . But I didn't really understand when the learned code is stored into attribute 0x0000

@Xyaren
Copy link
Contributor Author

Xyaren commented Jun 16, 2023

I updated the script in my message above.
I am now receiving the following data:
Data: 0:193 1:2 2:55 3:0 4:0 5:0 6:0 7:0 8:0 9:0 10:4 11:224 12:1 13:4 14:0 15:0

(BTW: Logging in that area leaves much to be desired)

Based on https://github.com/Koenkk/zigbee-herdsman-converters/blob/49e8b9544d2598adb324d9591ac7910b450672b8/src/lib/zosung.ts#LL98C18-L98C18 or https://github.com/ferehcarb/zha-device-handlers/blob/105fa7608ab61219be853fd3745a7c39d07d1c3a/zhaquirks/tuya/ts1201.py#L291 this now needs to be send as command 0x01 AND 0x02.

@Smanar
Copy link
Collaborator

Smanar commented Jun 17, 2023

So you are trying to send { "study" : 1} using the DDF now ? or catch return using DDF and making request with GUI ?

@Xyaren
Copy link
Contributor Author

Xyaren commented Jun 17, 2023

The latter.

But I'm afraid I'm stuck now. I don't see any way to send a command from the script.

@BabaIsYou
Copy link
Contributor

I don’t know if « write » function can use a script

@Xyaren
Copy link
Contributor Author

Xyaren commented Jun 17, 2023

I'm afraid this would not help, as i need to send a command from within a script

@Smanar
Copy link
Collaborator

Smanar commented Jun 17, 2023

I don’t know if « write » function can use a script

Yes it can, look at the device "starkvind_air_purifier.json"

@Xyaren I haven"t followed all your work sorry, what is the zigbee request you try to do ? And wich one "API field" you want to use for it (even just for test) ?

There is a new feature I have never tried on DDF

/*! A generic function to send a cluster-specific ZCL command.
    The \p cmdParameters is expected to contain one object (given in the device description file).

    { "fn": "zcl:cmd", "ep": endpoint, "cl": clusterId, "mf": manufacturerCode, "cmd": commandId, "eval": expression }

    - endpoint: the destination endpoint, use 0 for auto endpoint (from the uniqueid)
    - clusterId: string hex value
    - manufacturerCode: (optional) string hex value
    - commandId: string hex value
    - expression: (optional) to transform the item value to the command payload as hex string value

    Example: "write": {"fn": "zcl:cmd", "cl": "0x0000", "mf": "0x100b", "cmd": "0xc0",  "eval": "'002d00000040'"}
 */

@Xyaren
Copy link
Contributor Author

Xyaren commented Jun 18, 2023

Thanks for the Hint ! I'll look into it.
The Request I'll try to do is part of the sequence of command to get to the "Last Received IR Code" from the device.
This should be a (base64?) Encoded String that you can use in your automations and send back to the device in order to "reproduce" a previous received IR Signal.

I'm currently trying to replicate the behaviour of https://github.com/Koenkk/zigbee-herdsman-converters/blob/49e8b9544d2598adb324d9591ac7910b450672b8/src/lib/zosung.ts#LL98C18-L98C18

At the end of the chain of back-and-forth commands the ir-code is received:
https://github.com/Koenkk/zigbee-herdsman-converters/blob/49e8b9544d2598adb324d9591ac7910b450672b8/src/lib/zosung.ts#LL168C21-L168C21

I'll still need to figure out how to "listen" for multiple different commands without repurposing a bunch of attributes...

@Xyaren
Copy link
Contributor Author

Xyaren commented Jun 18, 2023

I don't think a write script is enough here.

I need the response script of one command be the trigger for the next command.
For me it looks like the capabilities of DDF based JS are not enough for the steps that need to be taken.

@Xyaren
Copy link
Contributor Author

Xyaren commented Jun 18, 2023

Here is a log from zigbee2mqtt:
I started the learning via z2m and than pressed the "OK" Button my TV Remote:

Debug 2023-06-18 12:52:05 Received MQTT message on 'zigbee2mqtt/0x70ac08fffe22f521/set' with data '{"learn_ir_code":"ON"}'
Debug 2023-06-18 12:52:05 Publishing 'set' 'learn_ir_code' to '0x70ac08fffe22f521'
Debug 2023-06-18 12:52:05 Starting IR Code Learning...
Debug 2023-06-18 12:52:05 IR Code Learning started.

Debug 2023-06-18 12:52:07 Received Zigbee message from '0x70ac08fffe22f521', type 'commandZosungSendIRCode00', cluster 'zosungIRTransmit', data '{"cmd":4,"length":62,"seq":1,"unk1":0,"unk2":57348,"unk3":1,"unk4":0}' from endpoint 1 with groupID null
Debug 2023-06-18 12:52:07 "IR-Message-Code00" received (msg:{"seq":1,"length":62,"unk1":0,"unk2":57348,"unk3":1,"cmd":4,"unk4":0})
Debug 2023-06-18 12:52:07 "IR-Message-Code00" response sent.
Debug 2023-06-18 12:52:07 "IR-Message-Code00" transfer started.

Debug 2023-06-18 12:52:07 Received Zigbee message from '0x70ac08fffe22f521', type 'zosungSendIRCode03Resp', cluster 'zosungIRTransmit', data '{"msgpart":{"data":[5,97,35,151,17,63,2,192,1,3,126,6,63,2,224,11,1,64,23,64,3,64,1,64,7,224,7,3,192,1,64,23,224,3,1,192,15,64,7,64,3,64,1,64,7,192,3,64,1,11,126,6,63,2,111],"type":"Buffer"},"msgpartcrc":19,"position":0,"seq":1,"zero":0}' from endpoint 1 with groupID null
Debug 2023-06-18 12:52:07 "IR-Message-Code03" received (msg:{"zero":0,"seq":1,"position":0,"msgpart":{"type":"Buffer","data":[5,97,35,151,17,63,2,192,1,3,126,6,63,2,224,11,1,64,23,64,3,64,1,64,7,224,7,3,192,1,64,23,224,3,1,192,15,64,7,64,3,64,1,64,7,192,3,64,1,11,126,6,63,2,111]},"msgpartcrc":19})
Debug 2023-06-18 12:52:07 55 bytes received.

Debug 2023-06-18 12:52:08 Received Zigbee message from '0x70ac08fffe22f521', type 'zosungSendIRCode03Resp', cluster 'zosungIRTransmit', data '{"msgpart":{"data":[157,97,35,218,8,63,2],"type":"Buffer"},"msgpartcrc":68,"position":55,"seq":1,"zero":0}' from endpoint 1 with groupID null
Debug 2023-06-18 12:52:08 "IR-Message-Code03" received (msg:{"zero":0,"seq":1,"position":55,"msgpart":{"type":"Buffer","data":[157,97,35,218,8,63,2]},"msgpartcrc":68})
Debug 2023-06-18 12:52:08 7 bytes received.

Debug 2023-06-18 12:52:08 Received Zigbee message from '0x70ac08fffe22f521', type 'zosungSendIRCode05Resp', cluster 'zosungIRTransmit', data '{"seq":1,"zero":0}' from endpoint 1 with groupID null
Debug 2023-06-18 12:52:08 "IR-Message-Code05" received (msg:{"seq":1,"zero":0})
Debug 2023-06-18 12:52:08 Received: BWEjlxE/AsABA34GPwLgCwFAF0ADQAFAB+AHA8ABQBfgAwHAD0AHQANAAUAHwANAAQt+Bj8Cb51hI9oIPwI=

Info  2023-06-18 12:52:08 MQTT publish: topic 'zigbee2mqtt/0x70ac08fffe22f521', payload '{"learned_ir_code":"BWEjlxE/AsABA34GPwLgCwFAF0ADQAFAB+AHA8ABQBfgAwHAD0AHQANAAUAHwANAAQt+Bj8Cb51hI9oIPwI=","linkquality":255}'

Here is another try with more detailed logging enabled:

Zigbee2MQTT:debug 2023-06-18 13:09:36: Received MQTT message on 'zigbee2mqtt/IR Blaster/set' with data '{"learn_ir_code":"ON"}'
Zigbee2MQTT:debug 2023-06-18 13:09:36: Publishing 'set' 'learn_ir_code' to 'IR Blaster'
Zigbee2MQTT:debug 2023-06-18 13:09:36: Starting IR Code Learning...
2023-06-18T11:09:36.151Z zigbee-herdsman:controller:endpoint Command 0x70ac08fffe22f521/1 zosungIRControl.zosungControlIRCommand00({"data":{"type":"Buffer","data":[123,34,115,116,117,100,121,34,58,48,125]}}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
2023-06-18T11:09:36.151Z zigbee-herdsman:deconz:adapter no response expected (19)
Zigbee2MQTT:debug 2023-06-18 13:09:36: IR Code Learning started.
2023-06-18T11:09:36.152Z zigbee-herdsman:deconz:frameParser device state: 10100010
2023-06-18T11:09:36.152Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:36.154Z zigbee-herdsman:deconz:driver DATA_REQUEST - destAddr: 0xd12b EP:1 SeqNr. 98 request id: 31
2023-06-18T11:09:36.165Z zigbee-herdsman:deconz:frameParser DATA_REQUEST RESPONSE - request id: 31 status: 0
2023-06-18T11:09:36.165Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:36.165Z zigbee-herdsman:deconz:frameParser DEVICE_STATE changed: 10100110
2023-06-18T11:09:36.165Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:36.169Z zigbee-herdsman:deconz:driver query aps data confirm
2023-06-18T11:09:36.170Z zigbee-herdsman:deconz:driver DATA_CONFIRM - sending data state request - SeqNr. 99
2023-06-18T11:09:36.171Z zigbee-herdsman:deconz:frameParser DATA_CONFIRM RESPONSE - destAddr: 0xd12b request id: 31 confirm status: 0
2023-06-18T11:09:36.171Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:36.171Z zigbee-herdsman:deconz:adapter sendZclFrameToEndpoint - message send with transSeq Nr.: 19
2023-06-18T11:09:36.171Z zigbee-herdsman:deconz:adapter false, true, false, 10000
2023-06-18T11:09:36.171Z zigbee-herdsman:deconz:adapter resolve request (19)
2023-06-18T11:09:40.323Z zigbee-herdsman:deconz:frameParser DEVICE_STATE changed: 10101010
2023-06-18T11:09:40.323Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 1 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.327Z zigbee-herdsman:deconz:driver query aps data indication
2023-06-18T11:09:40.333Z zigbee-herdsman:deconz:driver DATA_INDICATION - sending read data request - SeqNr. 100
2023-06-18T11:09:40.334Z zigbee-herdsman:deconz:frameParser DATA_INDICATION RESPONSE - seqNr. 100 srcAddr: 0xd12b destAddr: 0x0 profile id: 0x104 cluster id: 0xed00 lqi: 255
2023-06-18T11:09:40.334Z zigbee-herdsman:deconz:frameParser response payload: 1,117,0,13,0,55,0,0,0,0,0,0,0,4,224,1,4,0,0
2023-06-18T11:09:40.335Z zigbee-herdsman:controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":0,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":117,"manufacturerCode":null,"commandIdentifier":0},"Payload":{"seq":13,"length":55,"unk1":0,"unk2":57348,"unk3":1,"cmd":4,"unk4":0},"Command":{"ID":0,"parameters":[{"name":"seq","type":33},{"name":"length","type":35},{"name":"unk1","type":35},{"name":"unk2","type":33},{"name":"unk3","type":32},{"name":"cmd","type":32},{"name":"unk4","type":33}],"name":"zosungSendIRCode00"}},"address":53547,"endpoint":1,"linkquality":255,"groupID":null,"wasBroadcast":false,"destinationEndpoint":1}'
2023-06-18T11:09:40.336Z zigbee-herdsman:controller:endpoint Command 0x70ac08fffe22f521/1 zosungIRTransmit.zosungSendIRCode01({"zero":0,"seq":13,"length":55,"unk1":0,"unk2":57348,"unk3":1,"cmd":4,"unk4":0}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
2023-06-18T11:09:40.336Z zigbee-herdsman:deconz:adapter no response expected (20)
2023-06-18T11:09:40.336Z zigbee-herdsman:controller:endpoint DefaultResponse 0x70ac08fffe22f521/1 60672(0, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
2023-06-18T11:09:40.336Z zigbee-herdsman:deconz:adapter no response expected (117)
2023-06-18T11:09:40.336Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.337Z zigbee-herdsman:controller:endpoint Command 0x70ac08fffe22f521/1 zosungIRTransmit.zosungSendIRCode02({"seq":13,"position":0,"maxlen":56}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
2023-06-18T11:09:40.337Z zigbee-herdsman:deconz:adapter no response expected (21)
Zigbee2MQTT:debug 2023-06-18 13:09:40: Received Zigbee message from 'IR Blaster', type 'commandZosungSendIRCode00', cluster 'zosungIRTransmit', data '{"cmd":4,"length":55,"seq":13,"unk1":0,"unk2":57348,"unk3":1,"unk4":0}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2023-06-18 13:09:40: "IR-Message-Code00" received (msg:{"seq":13,"length":55,"unk1":0,"unk2":57348,"unk3":1,"cmd":4,"unk4":0})
Zigbee2MQTT:debug 2023-06-18 13:09:40: "IR-Message-Code00" response sent.
Zigbee2MQTT:debug 2023-06-18 13:09:40: "IR-Message-Code00" transfer started.
2023-06-18T11:09:40.341Z zigbee-herdsman:deconz:driver DATA_REQUEST - destAddr: 0xd12b EP:1 SeqNr. 101 request id: 32
2023-06-18T11:09:40.348Z zigbee-herdsman:deconz:driver DATA_REQUEST - destAddr: 0xd12b EP:1 SeqNr. 102 request id: 33
2023-06-18T11:09:40.351Z zigbee-herdsman:deconz:frameParser DATA_REQUEST RESPONSE - request id: 32 status: 0
2023-06-18T11:09:40.351Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.351Z zigbee-herdsman:deconz:frameParser DEVICE_STATE changed: 10100110
2023-06-18T11:09:40.351Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.354Z zigbee-herdsman:deconz:driver query aps data confirm
2023-06-18T11:09:40.354Z zigbee-herdsman:deconz:driver DATA_REQUEST - destAddr: 0xd12b EP:1 SeqNr. 103 request id: 34
2023-06-18T11:09:40.358Z zigbee-herdsman:deconz:driver DATA_CONFIRM - sending data state request - SeqNr. 104
2023-06-18T11:09:40.360Z zigbee-herdsman:deconz:frameParser DATA_REQUEST RESPONSE - request id: 33 status: 0
2023-06-18T11:09:40.360Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.360Z zigbee-herdsman:deconz:frameParser DEVICE_STATE changed: 10100110
2023-06-18T11:09:40.360Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.364Z zigbee-herdsman:deconz:driver query aps data confirm
2023-06-18T11:09:40.369Z zigbee-herdsman:deconz:driver DATA_CONFIRM - sending data state request - SeqNr. 105
2023-06-18T11:09:40.369Z zigbee-herdsman:deconz:frameParser DATA_REQUEST RESPONSE - request id: 34 status: 0
2023-06-18T11:09:40.369Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.369Z zigbee-herdsman:deconz:frameParser DEVICE_STATE changed: 10100110
2023-06-18T11:09:40.369Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.370Z zigbee-herdsman:deconz:frameParser DATA_CONFIRM RESPONSE - destAddr: 0xd12b request id: 32 confirm status: 0
2023-06-18T11:09:40.370Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.370Z zigbee-herdsman:deconz:adapter sendZclFrameToEndpoint - message send with transSeq Nr.: 20
2023-06-18T11:09:40.370Z zigbee-herdsman:deconz:adapter false, true, false, 10000
2023-06-18T11:09:40.370Z zigbee-herdsman:deconz:adapter resolve request (20)
2023-06-18T11:09:40.375Z zigbee-herdsman:deconz:driver query aps data confirm
2023-06-18T11:09:40.378Z zigbee-herdsman:deconz:driver DATA_CONFIRM - sending data state request - SeqNr. 106
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:frameParser DATA_CONFIRM RESPONSE - destAddr: 0xd12b request id: 33 confirm status: 0
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:frameParser DEVICE_STATE changed: 10101110
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 1 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:frameParser DATA_CONFIRM RESPONSE - destAddr: 0xd12b request id: 34 confirm status: 0
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 1 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:adapter sendZclFrameToEndpoint - message send with transSeq Nr.: 117
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:adapter false, true, false, 10000
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:adapter resolve request (117)
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:adapter sendZclFrameToEndpoint - message send with transSeq Nr.: 21
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:adapter false, true, false, 10000
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:adapter resolve request (21)
2023-06-18T11:09:40.383Z zigbee-herdsman:deconz:driver query aps data indication
2023-06-18T11:09:40.389Z zigbee-herdsman:deconz:driver DATA_INDICATION - sending read data request - SeqNr. 107
2023-06-18T11:09:40.391Z zigbee-herdsman:deconz:frameParser DATA_INDICATION RESPONSE - seqNr. 107 srcAddr: 0xd12b destAddr: 0x0 profile id: 0x104 cluster id: 0xed00 lqi: 255
2023-06-18T11:09:40.391Z zigbee-herdsman:deconz:frameParser response payload: 9,118,3,0,13,0,0,0,0,0,55,5,92,35,155,17,64,2,192,1,3,122,6,64,2,224,11,1,64,23,64,3,64,1,64,7,224,11,3,192,1,64,27,224,11,1,64,23,64,3,64,1,64,7,224,3,3,7,175,157,92,35,185,8,64,2,217
2023-06-18T11:09:40.392Z zigbee-herdsman:controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":118,"manufacturerCode":null,"commandIdentifier":3},"Payload":{"zero":0,"seq":13,"position":0,"msgpart":{"type":"Buffer","data":[5,92,35,155,17,64,2,192,1,3,122,6,64,2,224,11,1,64,23,64,3,64,1,64,7,224,11,3,192,1,64,27,224,11,1,64,23,64,3,64,1,64,7,224,3,3,7,175,157,92,35,185,8,64,2]},"msgpartcrc":217},"Command":{"ID":3,"parameters":[{"name":"zero","type":32},{"name":"seq","type":33},{"name":"position","type":35},{"name":"msgpart","type":65},{"name":"msgpartcrc","type":32}],"name":"zosungSendIRCode03Resp"}},"address":53547,"endpoint":1,"linkquality":255,"groupID":null,"wasBroadcast":false,"destinationEndpoint":1}'
2023-06-18T11:09:40.393Z zigbee-herdsman:controller:endpoint Command 0x70ac08fffe22f521/1 zosungIRTransmit.zosungSendIRCode04({"zero0":0,"seq":13,"zero1":0}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
2023-06-18T11:09:40.393Z zigbee-herdsman:deconz:adapter no response expected (22)
2023-06-18T11:09:40.393Z zigbee-herdsman:controller:endpoint DefaultResponse 0x70ac08fffe22f521/1 60672(3, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
2023-06-18T11:09:40.393Z zigbee-herdsman:deconz:adapter no response expected (118)
2023-06-18T11:09:40.393Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
Zigbee2MQTT:debug 2023-06-18 13:09:40: Received Zigbee message from 'IR Blaster', type 'zosungSendIRCode03Resp', cluster 'zosungIRTransmit', data '{"msgpart":{"data":[5,92,35,155,17,64,2,192,1,3,122,6,64,2,224,11,1,64,23,64,3,64,1,64,7,224,11,3,192,1,64,27,224,11,1,64,23,64,3,64,1,64,7,224,3,3,7,175,157,92,35,185,8,64,2],"type":"Buffer"},"msgpartcrc":217,"position":0,"seq":13,"zero":0}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2023-06-18 13:09:40: "IR-Message-Code03" received (msg:{"zero":0,"seq":13,"position":0,"msgpart":{"type":"Buffer","data":[5,92,35,155,17,64,2,192,1,3,122,6,64,2,224,11,1,64,23,64,3,64,1,64,7,224,11,3,192,1,64,27,224,11,1,64,23,64,3,64,1,64,7,224,3,3,7,175,157,92,35,185,8,64,2]},"msgpartcrc":217})
Zigbee2MQTT:debug 2023-06-18 13:09:40: 55 bytes received.
2023-06-18T11:09:40.398Z zigbee-herdsman:deconz:driver DATA_REQUEST - destAddr: 0xd12b EP:1 SeqNr. 108 request id: 35
2023-06-18T11:09:40.403Z zigbee-herdsman:deconz:driver DATA_REQUEST - destAddr: 0xd12b EP:1 SeqNr. 109 request id: 36
2023-06-18T11:09:40.409Z zigbee-herdsman:deconz:frameParser DATA_REQUEST RESPONSE - request id: 35 status: 0
2023-06-18T11:09:40.409Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.409Z zigbee-herdsman:deconz:frameParser DEVICE_STATE changed: 10100110
2023-06-18T11:09:40.409Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.413Z zigbee-herdsman:deconz:driver query aps data confirm
2023-06-18T11:09:40.415Z zigbee-herdsman:deconz:driver DATA_CONFIRM - sending data state request - SeqNr. 110
2023-06-18T11:09:40.417Z zigbee-herdsman:deconz:frameParser DATA_REQUEST RESPONSE - request id: 36 status: 0
2023-06-18T11:09:40.417Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.417Z zigbee-herdsman:deconz:frameParser DEVICE_STATE changed: 10100110
2023-06-18T11:09:40.417Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.417Z zigbee-herdsman:deconz:frameParser DATA_CONFIRM RESPONSE - destAddr: 0xd12b request id: 35 confirm status: 0
2023-06-18T11:09:40.417Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 1 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.417Z zigbee-herdsman:deconz:adapter sendZclFrameToEndpoint - message send with transSeq Nr.: 22
2023-06-18T11:09:40.417Z zigbee-herdsman:deconz:adapter false, true, false, 10000
2023-06-18T11:09:40.417Z zigbee-herdsman:deconz:adapter resolve request (22)
2023-06-18T11:09:40.423Z zigbee-herdsman:deconz:driver query aps data confirm
2023-06-18T11:09:40.425Z zigbee-herdsman:deconz:driver DATA_CONFIRM - sending data state request - SeqNr. 111
2023-06-18T11:09:40.426Z zigbee-herdsman:deconz:frameParser DATA_CONFIRM RESPONSE - destAddr: 0xd12b request id: 36 confirm status: 0
2023-06-18T11:09:40.426Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.426Z zigbee-herdsman:deconz:adapter sendZclFrameToEndpoint - message send with transSeq Nr.: 118
2023-06-18T11:09:40.426Z zigbee-herdsman:deconz:adapter false, true, false, 10000
2023-06-18T11:09:40.426Z zigbee-herdsman:deconz:adapter resolve request (118)
2023-06-18T11:09:40.432Z zigbee-herdsman:deconz:frameParser DEVICE_STATE changed: 10101010
2023-06-18T11:09:40.432Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 1 configChanged: 0 apsRequestFreeSlots: 1
2023-06-18T11:09:40.433Z zigbee-herdsman:deconz:driver query aps data indication
2023-06-18T11:09:40.434Z zigbee-herdsman:deconz:driver DATA_INDICATION - sending read data request - SeqNr. 112
2023-06-18T11:09:40.435Z zigbee-herdsman:deconz:frameParser DATA_INDICATION RESPONSE - seqNr. 112 srcAddr: 0xd12b destAddr: 0x0 profile id: 0x104 cluster id: 0xed00 lqi: 255
2023-06-18T11:09:40.435Z zigbee-herdsman:deconz:frameParser response payload: 9,119,5,13,0,0,0
2023-06-18T11:09:40.436Z zigbee-herdsman:controller:log Received 'zcl' data '{"frame":{"Header":{"frameControl":{"frameType":1,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":false,"reservedBits":0},"transactionSequenceNumber":119,"manufacturerCode":null,"commandIdentifier":5},"Payload":{"seq":13,"zero":0},"Command":{"ID":5,"parameters":[{"name":"seq","type":33},{"name":"zero","type":33}],"name":"zosungSendIRCode05Resp"}},"address":53547,"endpoint":1,"linkquality":255,"groupID":null,"wasBroadcast":false,"destinationEndpoint":1}'
Zigbee2MQTT:debug 2023-06-18 13:09:40: Received Zigbee message from 'IR Blaster', type 'zosungSendIRCode05Resp', cluster 'zosungIRTransmit', data '{"seq":13,"zero":0}' from endpoint 1 with groupID null
Zigbee2MQTT:debug 2023-06-18 13:09:40: "IR-Message-Code05" received (msg:{"seq":13,"zero":0})
Zigbee2MQTT:debug 2023-06-18 13:09:40: Received: BVwjmxFAAsABA3oGQALgCwFAF0ADQAFAB+ALA8ABQBvgCwFAF0ADQAFAB+ADAwevnVwjuQhAAg==
2023-06-18T11:09:40.437Z zigbee-herdsman:controller:endpoint Command 0x70ac08fffe22f521/1 zosungIRControl.zosungControlIRCommand00({"data":{"type":"Buffer","data":[123,34,115,116,117,100,121,34,58,49,125]}}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
2023-06-18T11:09:40.437Z zigbee-herdsman:deconz:adapter no response expected (23)
2023-06-18T11:09:40.437Z zigbee-herdsman:controller:endpoint DefaultResponse 0x70ac08fffe22f521/1 60672(5, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false})
2023-06-18T11:09:40.438Z zigbee-herdsman:deconz:adapter no response expected (119)
2023-06-18T11:09:40.438Z zigbee-herdsman:deconz:driver networkstate: 2 apsDataConfirm: 0 apsDataIndication: 0 configChanged: 0 apsRequestFreeSlots: 1
Zigbee2MQTT:info  2023-06-18 13:09:40: MQTT publish: topic 'zigbee2mqtt/IR Blaster', payload '{"learned_ir_code":"BVwjmxFAAsABA3oGQALgCwFAF0ADQAFAB+ALA8ABQBvgCwFAF0ADQAFAB+ADAwevnVwjuQhAAg==","linkquality":255}'

@BabaIsYou
Copy link
Contributor

BabaIsYou commented Jun 18, 2023

Quite the same as #6814 (comment) but second is more detailed

@Smanar
Copy link
Collaborator

Smanar commented Jun 19, 2023

So If I m right from your link you need to use :

  • cluster 0xed00
  • command 0x01
  • Payload
                 {
                    zero: 0,
                    seq: seq,
                    length: length,
                    unk1: msg.data.unk1,
                    unk2: msg.data.unk2,
                    unk3: msg.data.unk3,
                    cmd: msg.data.cmd,
                    unk4: msg.data.unk4,
                },

But this is an incoming request ? So you need to use parse not write ?

Debug 2023-06-18 12:52:07 Received Zigbee message from '0x70ac08fffe22f521', type 'commandZosungSendIRCode00', cluster 'zosungIRTransmit', data '{"cmd":4,"length":62,"seq":1,"unk1":0,"unk2":57348,"unk3":1,"unk4":0}' from endpoint 1 with groupID null
Debug 2023-06-18 12:52:07 "IR-Message-Code00" received (msg:{"seq":1,"length":62,"unk1":0,"unk2":57348,"unk3":1,"cmd":4,"unk4":0})

And no, from that I m reading there is no base64 converion, just take the bytes in the good order.

I m not sure to understand how work your device:

  • you set the device in learn mode
  • You use a IR remote in front of it
  • it display in log all the IR packet received by the device.

???

@github-actions
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 Jul 11, 2023
@github-actions
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.

@Xyaren
Copy link
Contributor Author

Xyaren commented Jul 18, 2023

I switched to Zigbee2Mqtt and a Sonoff Dongle.
It is working there.

@MarioMarti77
Copy link

there is anyy update on this topic.?

@c4coer
Copy link

c4coer commented Dec 9, 2023

the subject is very interesting. What's new

@c4coer
Copy link

c4coer commented Dec 9, 2023

@c4coer
Copy link

c4coer commented Dec 21, 2023

Koenkk/zigbee2mqtt#11633

@c4coer
Copy link

c4coer commented Dec 23, 2023

@moddavid
Copy link

This ticket was closed automatically a while ago. Does anyone have managed to successfully use this in deconz?

@c4coer
Copy link

c4coer commented Apr 21, 2024 via email

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

No branches or pull requests

8 participants