-
Notifications
You must be signed in to change notification settings - Fork 484
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
Comments
Please add all requested screenshots. |
What are you missing ? |
Please read the the template. It clearly states what we need :) |
Updated |
thanks :) |
I think that Basic cluster is still mssing. |
Agree. It was there before, in his 3rd edit. @Xyaren canyou make sure Basic is back? |
BTW not sure that we could answer something more than previous @Smanar answer : #6470 (comment) |
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. |
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
Extrapolation from : https://github.com/ferehcarb/zha-device-handlers/blob/039fe46b57328584d13036541558bb6fed72291a/zhaquirks/tuya/ts1201.py#L53 and zigpy/zha-device-handlers#1687 |
Good start ! <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 It's not working though:
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. |
Had no hope to have it working at first try ! ;-( 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. |
I noticed that too but in the xml it is typed as
What makes you think that ? All existing Implementations do use Json data to trigger any action on the device. |
I think I figured out where the "3" is comming from. |
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 |
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. 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 |
I tried blindly adding some more attributes and found this, after unplugging/replugging the device: the |
Can you try that for the enable/disable
|
I don't think this device has an attribute for "learning mode". |
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) |
Would be interesting to grab log when sending command. |
Where do you see the boolean part? How do I get the log? |
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 |
You’re right. But it couldn’t be an attribute, that should be part of the payload as a json. |
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
But thats it :/ |
Then seems that command 0x00 is sent to the device … that’s a good beginning.
We have to find a way to give the associated payload to active the learning on the device
thought initially that could be something like this
<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>
But we can change the values 0x01 by {study:1} and assure the command number (if it’s 0x00 or 0x01 for learning mode)
|
<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="{"study":0}"></value>-->
<!--<value name="On" value="{"study":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. |
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) |
Then this one |
Thats 14 characters ;) I thought so aswell but console.log(Buffer.from(JSON.stringify({'study': 0})))
11 Characters |
You're right ... I would write |
I think we already have it, have a look to :
|
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
{"study" : 0} for On
{"study" : 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="{"study" : 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) 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 |
I updated the script in my message above. (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. |
So you are trying to send |
The latter. But I'm afraid I'm stuck now. I don't see any way to send a command from the script. |
I don’t know if « write » function can use a script |
I'm afraid this would not help, as i need to send a command from within 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
|
Thanks for the Hint ! I'll look into it. 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: I'll still need to figure out how to "listen" for multiple different commands without repurposing a bunch of attributes... |
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. |
Here is a log from zigbee2mqtt:
Here is another try with more detailed logging enabled:
|
Quite the same as #6814 (comment) but second is more detailed |
So If I m right from your link you need to use :
But this is an incoming request ? So you need to use parse not write ?
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:
??? |
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. |
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. |
I switched to Zigbee2Mqtt and a Sonoff Dongle. |
there is anyy update on this topic.? |
the subject is very interesting. What's new |
This ticket was closed automatically a while ago. Does anyone have managed to successfully use this in deconz? |
no
Le dim. 21 avr. 2024, 13:43, moddavid ***@***.***> a écrit :
… This ticket was closed automatically a while ago. Does anyone have managed
to successfully use this in deconz?
—
Reply to this email directly, view it on GitHub
<#6814 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGJOOHQR5U5Y6725SP6GKDDY6OQ5ZAVCNFSM6AAAAAAWDPYFR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRYGAYTIMJRGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Device
ZS seems to stand for ZOSUNG
Bought at https://www.aliexpress.com/item/1005003878194474.html
Device Image
Screenshots
Basic & Device
Node Info
![image](https://user-images.githubusercontent.com/5864045/226848071-32dc16fd-b37b-485e-9bee-e96935fecffe.png)
Basic
Groups
Scenes
Identify
ED00 Unknown
Empty
ED04 Unknown
Empty
On/Off
OTAU
Time
Green Power
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.
The text was updated successfully, but these errors were encountered: