Code completion in editor don't work properly, unlike the Python/IPython console

From<EMAIL_ADDRESS>on 2015-02-06T08:44:55Z
Spyder Version:  2.4.0dev
Python Version:  3.4.1
Qt Version    :  4.8.6, PyQt4 (API v2) 4.10.4 on Windows
pyflakes >=0.6.0:  0.7.3 (OK)
pep8 >=0.6      :  1.4.6 (OK)
IPython >=1.0   :  2.3.1 (OK)
zmq >=2.1.11    :  14.4.1 (OK)
pygments >=1.6  :  2.0.1 (OK)
pandas >=0.13.1 :  0.14.1 (OK)
sphinx >=0.6.6  :  1.2.3 (OK)
jedi >=0.8.1    :  0.8.1-final0 (OK)
rope >=0.9.2    :  0.9.4-1 (OK)
matplotlib >=1.0:  1.4.0 (OK)
sympy >=0.7.0   :  0.7.5 (OK)
pylint >=0.25   :  1.4.1 (OK)
What steps will reproduce the problem?

Import module
Create a local variable using class from the module
Write the name of the variable, put the dot and call the autocompletion (TAB or CTRL+SPACE)

What is the expected output? What do you see instead?
In the editor:
I expected popup box with available methods and members, but it don't appear.
In the console:
All is OK.
Please provide any additional information below
. I tried numpy and cv2:
import numpy as np # 'imp' completion works, 'num' completion works
arr = np.array([1,2,3,4,5]) # 'np.' completion works
arr. # completion don't work
import cv2
cap = cv2.VideoCapture(0) # 'cv2.' completion works
cap. # completion don't work
Same code in console work fine. I use Anaconda and last spyder version from bitbucket and run it like follow:
"python bootstrap.py --debug"
When I call completion for variable arr. or cap.  I got next debug output:
completions request:
[]
completions request from jedi complete: "[]" in 0.1 sec
completions request from rope complete: "[]" in 0.2 sec
got timeout
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=2162

From ccordoba12 on 2015-02-08T09:36:09Z
Steven, do you think we can do something about this? I see two options here:

See if Jedi supports something like type hinting that can help us in this case.

I did a bit of research on the Canopy's architecture and noticed its Editor seems to do code completions using an IPython kernel in the background. Of course, the problem in this case is that code in the Editor can be syntactically incorrect, but given we can verify that by using pyflakes, it could be worth investigating this option.

Status: Accepted
Cc<EMAIL_ADDRESS>Labels: Cat-Editor MS-v2.4

From ccordoba12 on 2015-02-08T09:43:05Z
issue #1816 has been merged into this issue.

From<EMAIL_ADDRESS>on 2015-02-08T10:20:18Z
This is a really tough one, because it is a compiled module, the best I can suggest is to try docstring typehinting: http://jedi.jedidjah.ch/en/latest/docs/features.html#type-hinting .

From<EMAIL_ADDRESS>on 2015-02-08T11:19:39Z
Ah, I missed the numpy.array part.  There is an open issue for that: https://github.com/davidhalter/jedi/issues/372 .
As far as IPython goes, I don't think it makes sense, because you don't want your code executing behind your back.  What if it is creating/deleting files or doing long-running operations?

From ccordoba12 on 2015-02-08T11:14:02Z
I see, but that wouldn't help for the code reported by the OP, would it?
And what do you think about option 2? Is it feasible?

From ccordoba12 on 2015-02-08T11:52:28Z
Oh yeah! I missed that one, a crucial point.
Another idea then: does Jedi support a hooks concept for completions? I mean, if jedi knows an object's type (for example, that arr's is a numpy.array), we could add a hook to show completions for it, either by passing the completion widget a list (saved somewhere in our source code) of np.array's completions, or by evaluating this simple statement in an IPython kernel
 import numpy as np
 arr = np.array

then getting the list of completions the kernel returns for foo, and passing it to our widget.
Of course, the crucial point here is that Jedi could give us the type of an introspected object.

From ccordoba12 on 2015-02-08T12:12:12Z
Well, according to this SO answer http://stackoverflow.com/a/14710037/438386 Jedi does give completions for np.arrays, but it seems to have problems in virtualenvs. Steven, can you test it in your side?

From<EMAIL_ADDRESS>on 2015-02-08T18:47:38Z
I tried the following from IPython (Anaconda Python 3.4) and got an empty list:
import jedi; jedi.Script('import numpy; a = numpy.array().m').completions()

From<EMAIL_ADDRESS>on 2015-02-09T08:10:11Z
Carlos, we could back-track to the object definition, then load that in IPython, but there is a snag: np.array is a function, not a class.  It also requires an object as its first parameter.  We could special case for np.array since it it used so often...
d = jedi.Script('import numpy; a = numpy.array').definition()[0]
if d.name == 'array' and d.module_name == 'numpy.core.multiarray':
completions = [c for c in dir(np.array(1)) if c.startswith(completion_text)]
elif d.type == 'class':
mod = import(d.module_name)
cls = getattr(mod, d.name)
completions = [c for c in dir(cls) if c.startswith(completion_text)]

From ccordoba12 on 2015-02-12T08:43:41Z
Yes, I was thinking exactly that. Could we make this mechanism extendable? I mean, we don't just need np.array, but also pyplot.figure, pd.groupby, and who knows how many others :-)

From<EMAIL_ADDRESS>on 2015-02-12T16:40:53Z
Yes, I suppose we could keep a list of (name, module_name, args) tuples.

From ccordoba12 on 2015-02-13T12:15:15Z
Great!! I promise (really promise) to move to GH this weekend so you can start to work on this :-)

@blink1073, have you had time to look at this issue? People continues to ask for it. See for example:
http://stackoverflow.com/questions/28513322/biopython-intellisense-iin-spyder

No, not as of yet...

+1 on this!

As far as I know, the jedi devs are currently working on the exact same thing (https://github.com/davidhalter/jedi/issues/372). Therefore this issue might solve itself with the next release of jedi.

@blink1073 can you give me some pointers to the completion code, so I can take a look at this ?

This code would go here, where you'd implement this code, using a constant list of (name, module_name, args) defined in the module.

:+1:

hi I am using Spyder 2.3.8 (anaconda) and have similar problem code completion is not working in editor or IPython Console .But it is working in Python console . to regenerate the problem use following code
from lxml import etree
R1 = etree.Element("root")
R1.

"Spyder 2.3.9"
import pandas as pd
df = pd.read_csv("file.csv")
df.(NO code completion)

Completions on assignations is the most desired feature.
Some update on this issue?
Tks

Completions for DataFrames will work in Spyder 3.0. For other types we will need to implement the solution proposed here, which is not so easy ;-)

Thank you Cordoba.
I found an interesting workaround for DataFrame Column Names.
df = pd.read_csv("credit-training.csv") # read dataset
>>> df.columns # print columns names

I copy the result and paste it in the bottom of my file as a comment:
... my python code ...

'''
credit-training.csv columns
['serious_dlqin2yrs','revolving_utilization_of_unsecured_lines','age','number_of_time30_59_days_past_due_not_worse','debt_ratio','monthly_income','number_of_open_credit_lines_and_loans','number_of_times90_days_late','number_real_estate_loans_or_lines','number_of_time60_89_days_past_due_not_worse','number_of_dependents']
'''

Now, these "words" are on the editor environment and when I type:
df['m<ctrl+space>']
Spyder will show a window with words starting with 'm' and I choose what I want:
df['monthly_income']
This workaround save me a lot of time ;)
John

I didn't write this code but this jedi pull request actually implements parsing the numpydoc doc strings for call return types:
davidhalter/jedi#796
https://github.com/Erotemic/jedi/tree/parse_google_docstr
After some effort, I was able to get this:
import jedi; jedi.Script('import numpy; a = numpy.ones().m').completions()
to actually return something:

Things I did to make this work:

I'm using Anaconda on Ubuntu and Python 3.5
I had to change the doc string for numpy.ones from out : ndarray to out : numpy.ndarray. adarray isn't a type known to jedi.
I was only able to get this to work by importing the jedi code from the source folder. The installed (python setup.py install) versions didn't work.  As a result I couldn't get it to work with Spyder. I'm probably doing something wring here.
I have to run it 3 times(it's consistent too).  According to the Jedi debug function the first two times jedi doesn't even find the numpy.ones function.

My set up:
jedi >=0.8.1     :  0.10.0 (OK)
matplotlib >=1.0 :  1.5.3 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
numpy >=1.7      :  1.11.1 (OK)
pandas >=0.13.1  :  0.18.1 (OK)
pep8 >=0.6       :  1.7.0 (OK)
psutil >=0.3     :  4.3.1 (OK)
pyflakes >=0.6.0 :  1.3.0 (OK)
pygments >=2.0   :  2.1.3 (OK)
pylint >=0.25    :  1.6.4 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.4.6 (OK)
sympy >=0.7.3    :  1.0 (OK)
I don't know if this is useful but I spent a couple hours on it so I might as well document it here to see if anyone else has better luck.
I might try out matplotlib in the future.

@bcolsen, thanks for looking into this!! I think the real solution is what Steve proposed in this comment: https://github.com/spyder-ide/spyder/issues/2162#issuecomment-74779242
I'm going to assign one of our juniors to work on this one for 3.2.

@mariacamilaremolinagutierrez, this will be one of your projects for 3.2. Not for you to worry about this one for 3.1 :-)

@ccordoba12 You are right. The solution for numpy in general is difficult because of the compiled functions from numpy.multiarray like all of these:
[arange, array, broadcast, can_cast, compare_chararrays,
concatenate, copyto, count_nonzero, dot, dtype, empty,
empty_like, flatiter, frombuffer, fromfile, fromiter, fromstring,
inner, int_asbuffer, lexsort, matmul, may_share_memory,
min_scalar_type, ndarray, nditer, nested_iters, promote_types,
putmask, result_type, set_numeric_ops, shares_memory, vdot, where,
zeros]

Jedi can't find the docstrings for these, because they are not in the function headers.
However, presently I have the Jedi patch working now in Spyder without too much funny business(I didn't have to change numpy or spyder at all):

I did have to add numpy.ndarry as a type in the jedi patch.  My comment there has the code: davidhalter/jedi#796
To install it correctly I had to remove the Jedi that came with Anaconda(which unfortunately removes Spyder) and install the patched Jedi and Spyder manually. Now I don't have to run it three times and I can run it anywhere. np.array doesn't work but my present work around is to use np.asarray instead.
Other good news,  Matplotlib also completes (somewhat) with this patch:

I really wanted this...It's hard to remember all the methods for an Axes object
They need to add more numpydoc docstrings to Matplotlib but plt.figure works out of the box. I got subplot and axes to work by writing this at the top of the docstrings for Figure.add_axes and Figure.add_subplot in matplotlib/figure.py
    Returns
    -------
    axes : Axes
       The Axes you made

    Examples
    --------

I'm going to write an issue to Matplotlib and see if the docstrings can be improved. Maybe I can even fix them, though I suspect they will want a better effort than the one I wrote above :-)

@bcolsen, this is very, very interesting progress!! Thanks a lot for looking at it :-)
Would you like to create a PR with the Jedi patches here in Spyder? We already have some patches for rope, so we could do the same for Jedi, and have support for this in Spyder 3.1 (until Jedi maintainer merges the PR you mentioned above and release a new version).

Of course, what we'd need is the part related to Numpy docstrings and not Google ones in davidhalter/jedi#796

Patching Jedi. Good idea. I can give that a shot. I should have some time around the end of the month.
I also think I'm close to a hack on Jedi to return types for compiled functions like np.array and scipy stuff, but I'll start with a simple pull first.

Great! Thanks a lot for looking at it :-)

Sorry for hijacking this issue more....but I wanted to share my success. I got compiled objects in Jedi to return numpydoc return types. So now np.array() (and most of the other numpy stuff) now completes:

The code is still a little messy but I'm going to attempt to make a usable Jedi branch with the code and maybe another patch for Spyder.

This is really cool!! Thanks a lot for taking the time to look into it.
It'd be great if you could have a patch for Spyder before January 7, which is the feature freeze date for Spyder 3.1 :-)


net core console signalr client fail

I have some problem with my project. My signalr server write in asp.net(not asp.net core)：
using Microsoft.AspNet.SignalR;

namespace iotAC_SignalR_Server
{
    public class BroadcastHub : Hub
    {
        public void broadcast(string command)
        {
            Clients.All.messageReceived(command);
        }
    }
}
-----------------------------------------------------------
using Microsoft.Owin;
using Owin;

[assembly: OwinStartup(typeof(iotAC_SignalR_Server.Startup))]

namespace iotAC_SignalR_Server
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
        }
    }
}

My UWP signalr client works fine,but my net core 2.0 console signalr client is failed.This client just needs to receive data but dosen't need to send data.
code：
using Microsoft.AspNetCore.SignalR.Client;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;

namespace netcoreConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            connet().Wait();
        }
        static async Task connet()
        {
            HubConnection connection = await ConnectAsync("http://iotac-signalr-server20170913.azurewebsites.net/");
            connection.On("messageReceived", Console.WriteLine);
        }
        public static async Task<HubConnection> ConnectAsync(string baseUrl)
        {
            // Keep trying to until we can start
            while (true)
            {
                var connection = new HubConnectionBuilder()
                                .WithUrl(baseUrl)
                                .WithConsoleLogger(LogLevel.Trace)
                                .Build();
                try
                {
                    await connection.StartAsync();
                    return connection;
                }
                catch (Exception)
                {
                    await Task.Delay(1000);
                }
            }
        }
    }
}

error：
Hello World!
dbug: Microsoft.AspNetCore.Sockets.Client.HttpConnection[0]
      09/15/2017 17:41:09: Starting connection.
dbug: Microsoft.AspNetCore.Sockets.Client.HttpConnection[7]
      09/15/2017 17:41:09: Establishing Connection at: http://iotac-signalr-server20170913.azurewebsites.net/.
fail: Microsoft.AspNetCore.Sockets.Client.HttpConnection[8]
      09/15/2017 17:41:09: Failed to start connection. Error getting negotiation response from 'http://iotac-signalr-server20170913.azurewebsites.net/'.
System.FormatException: Invalid negotiation response received.
   at Microsoft.AspNetCore.Sockets.Client.HttpConnection.<ParseNegotiateResponse>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Sockets.Client.HttpConnection.<Negotiate>d__42.MoveNext()

Please help me, thank you very much.

SignalR for ASP.NET Core is not compatible with previous versions of SignalR. This means that you cannot use the old server with the new clients or the old clients with the new server. Below are the features which have been removed or changed in the new version of SignalR.

https://blogs.msdn.microsoft.com/webdev/2017/09/14/announcing-signalr-for-asp-net-core-2-0/

@BrennanConroy You just beat me to that 😉 🤔 Is it possible to run the different SignalR client/servers side by side or possibly doing a bridging api 🤔

@grahamehorner with enough work anything is possible but we have no plans to build to bridge between the 2 versions. There are fundamental differences between the 2 versions.

@davidfowl - can we close this?

Yep

Is there any library for Android(java) which is compatible with Asp.Net Core 2.0 SignalR.
Thanks.

We don't have a Java client at the moment. If you are feeling adventurous you may try using bare websocket to connect to the server. Here you can find what it would take to do that.


Directly use column as reconciliation results

This adds a new operation to reconcile a column of identifiers without hitting the reconciliation service. The operation can be found in the Reconcile... menu of each column.
This closes #1596.

Merging this in a few days.


Update enabling-message-signaled-interrupts-in-the-registry.md

Clarify valid values for MessageNumberLimit registry key, and under what conditions.

Thanks @minsang-msft, this will be on the live site momentarily.


[Device Support Request] Tuya _TZE200_2aaelwxk presence sensor

Problem description
Purchase Link: [https://www.aliexpress.us/item/3256805723461135.html]
Another flavor of the M100 Tuya Presence Sensor.
Clone of:
Model ZY-M100-24G manufactured by Tuya
Zigbee ID: TS0601 | _TZE204_ijxvkhd0
and
Model ZY-M100-S manufactured by Tuya
Zigbee ID: TS0601 | _TZE204_ztc6ggyl | _TZE204_sxm7l9xa
This devices information:
Model: ZG-205Z
Zigbee info:
TS0225 | _TZE200_2aaelwxk
The "CurrentlyInUse.zip" quirk exposes the configuration parameters for my other unit; this one does not.
I'm assuming a tweak to the quirk and an update to the production version is required.
Solution description
Please support in quirk and eventually, the Production mainline.
Screenshots/Video
No response
Device signature
Device signature
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0402",
      "input_clusters": [
        "0x0000",
        "0x0003",
        "0x0400",
        "0x0500",
        "0xe000",
        "0xe002",
        "0xee00",
        "0xef00"
      ],
      "output_clusters": []
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "_TZE200_2aaelwxk",
  "model": "TS0225",
  "class": "zigpy.device.Device"
}

Diagnostic information
Not able to obtain that information at the moment.
Logs
Logs
[Paste the logs here]

Custom quirk
Custom quirk
[Paste your custom quirk here]

Additional information
No response

TS0225_TZE200_2aaelwxk_base.zip
Let's try to start with this one, I created it based on DPs from Z2M but this device is a bit tricky with lots of Clusters. Some are unknown, and some are strange to see on this device.
You should get:
Illuminance (not sure how it is made, there is an Illuminance Cluster but also Illuminance_value in Tuya manufacturer Cluster, if the current way does not work I can implement it via manufacturer Cluster),
Motion,
TemperatureHumidityAlarm (if cluster 0xE002 for it)
Presence
All settings DPs are described, you can get access via the Device page >3-dots >Manage Zigbee Device,
see attributes of MmwRadarManufCluster:
0xEF02: ("motion_detection_sensitivity", t.uint32_t, True),
0xEF03: ("mov_minimum_distance", t.uint32_t, True),
0xEF04: ("motion_detection_distance", t.uint32_t, True),
0xEF05: ("human_motion_state", t.enum8, True),
0xEF65: ("fading_time", t.uint32_t, True),
0xEF66: ("motion_false_detection", t.uint32_t, True),
0xEF67: ("small_motion_detection_distance", t.uint32_t, True),
0xEF69: ("small_motion_detection_sensitivity", t.uint32_t, True),
0xEF6A: ("illuminance_value", t.uint32_t, True),
0xEF6B: ("indicator", t.enum8, True),
0xEF6C: ("static_detection_distance", t.uint32_t, True),
0xEF06: ("static_detection_sensitivity", t.uint32_t, True),
0xEF07: ("micro_minimum_distance", t.uint32_t, True),
0xEF08: ("motionless_minimum_distance", t.uint32_t, True),
0xEF09: ("reset_setting", t.uint32_t, True),
0xEF0A: ("breathe_false_detection", t.uint32_t, True),
0xEF0B: ("time", t.uint32_t, True),
0xEF0C: ("alarm_time", t.uint32_t, True),
0xEF0D: ("alarm_volume", t.enum8, True),
0xEF0E: ("working_mode", t.enum8, True),
0xEF0F: ("auto1", t.uint32_t, True),
0xEF10: ("auto2", t.uint32_t, True),
0xEF11: ("auto3", t.uint32_t, True)

I have this device attached in Home Assistant - showing only a couple of sensors (illuminance and "basic" motion - but I know it should be able to report much more)..
I'm willing to help but I don't know how. Feel free to ask, I'll try to contribute somehow.

@lucapierobon Did you try Custom quirk I posted?

@lucapierobon Did you try Custom quirk I posted?

not yet, how do I try it? I downloaded the py file, but where do I put it into?

I added the quirks folder in the config, restarted HA, removed and readded to ZHA the device, and this is how sensors look like now

Humidity and temperature are probably not available, I added them just because there was an appropriate cluster, but seems it does nothing, to be removed. Does Illuminance, Motion, and Presence (Occupancy) work?

Illuminance seems fine. Motion seems to work. Occupancy, so far, seems to match motion readings but seems slower to turn off when I leave the room (maybe there is some setting to tweak sensor reporting speed for the different sensor classes..)
Tomorrow will do more tests and report

Also, you can try changing radar settings via the Device page >3-dots >Manage Zigbee Device by reading/writing values for attributes of MmwRadarManufCluster

I will try to update the quirk to expose the settings to UI at some point this week, at the moment I bit limited in time

I see several interesting attributes here, but most of them are "none" in that cluster, so I'm a bit puzzled about what is ok to write into those values..
Anyway don't hurry, and thanks for the help so far!

Hope this help
e.numeric('fading_time', ea.STATE_SET).withValueMin(0).withValueMax(600).withValueStep(1).withUnit('s')
.withDescription('Presence keep time'),
e.numeric('large_motion_detection_distance', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(0.01).withUnit('m')
.withDescription('Large motion detection distance'),
e.numeric('large_motion_detection_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
.withDescription('Large motion detection sensitivity'),
e.numeric('small_motion_detection_distance', ea.STATE_SET).withValueMin(0).withValueMax(6).withValueStep(0.01).withUnit('m')
.withDescription('Small motion detection distance'),
e.numeric('small_motion_detection_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
.withDescription('Small motion detection sensitivity'),
e.numeric('static_detection_distance', ea.STATE_SET).withValueMin(0).withValueMax(6).withValueStep(0.01).withUnit('m')
.withDescription('Static detection distance'),
e.numeric('static_detection_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('x')
.withDescription('Static detection sensitivity'),
e.binary('indicator', ea.STATE_SET, 'ON', 'OFF').withDescription('LED indicator mode'),

Humidity and temperature are probably not available, I added them just because there was an appropriate cluster, but seems it does nothing, to be removed. Does Illuminance, Motion, and Presence (Occupancy) work?

If I try reading values on this set of attributes, it fails, so I guess you're right about them not being implemented

It's not a cluster you need
Select MmwRadarManufCluster in top dropdown

Just note distance attributes actually are integers in centimeters

It's not a cluster you need Select MmwRadarManufCluster in top dropdown

yes, I got that.
I was just exploring the humidity set to see if it was readable or not.. and it was not.
But I can read and write in the MmwRadarManufCluster and now I can try fiddling with some values as you suggested above

also I notice that I don't get "large motion" or "small motion" events, that I'd guess from the settings above.. just a generic "motion" event gets fired.. and occupancy turns off 20s after motion has turned off

Ok, good. Tip You can try to write something like<PHONE_NUMBER>, and then read again, It should reset to max or recent value so this way you can find the min-max range of allowed values (some times it does not work or resets with time depending on device )

Regarding motions, I will take a look if it is possible to get other states via quirk, It's easy by creating new ZHA sensor but I have no idea how long it will take to make it available in the official HA build

this morning I was in that room for more time and I saw that the motion was detected several times, but the occupancy was stable on for all the time I was inside

Just bought one so will hopefully be able to contribute once it turns up.

TS0225_TZE200_2aaelwxk_with config.zip
In this one, I added basic configuration entries to UI, and removed unsupported sensors. So you will have a usable device.
At the moment I don't see a way to add motion states via quirk without changes to ZHA

I just bought a _TZE204_ijxvkhd0 and _TZE204_e5m9c5hl, and neither are recognized either. Even reusing one of the custom quirks like this one and adding the new manufacturer IDs doesn't seem to work.

I just got a Tuya _TZE200_2aaelwxk sensor but for some reason the custom_quirk for this device is not loaded.
A custom quirk for the Tuya TS0601_TZE204_ztc6ggyl which sits in the same folder is loaded and working just fine.
I assume something inside the Tuya _TZE200_2aaelwxk quirk prevents it from being loaded. But since i don't no any python i have no idea where to look for a solution.

I'm using the custom_quirk presented here for some time and the illuminance was working fine. Yesterday after upgrading the HA to 2023.11.1 it stop working. I can read at "IlluminanceMeasurement (Endpoint id: 1, Id: 0x0400, Type: in)/ measured_value (id: 0x0000)" allways "1000", but at "MmwRadarManufCluster (Endpoint id: 1, Id: 0xef00, Type: in) / illuminance_value (id: 0xef6a)" I can read the real values. My problem is, I don't know how to change the custom_quirk to reflect this. Grateful

I just got a Tuya _TZE200_2aaelwxk sensor but for some reason the custom_quirk for this device is not loaded. A custom quirk for the Tuya TS0601_TZE204_ztc6ggyl which sits in the same folder is loaded and working just fine. I assume something inside the Tuya _TZE200_2aaelwxk quirk prevents it from being loaded. But since i don't no any python i have no idea where to look for a solution.

Same here

For those looking for a working quirk for _TZE204_ijxvkhd0, then go here:
https://github.com/zigpy/zha-device-handlers/issues/2378
And use this file:-
https://github.com/zigpy/zha-device-handlers/files/12269600/ts0601_qasjif9e.zip
You'll need to add the _TZE204_ijxvkhd0 models list, but it appears to work fine.

Neither version of the quirk is loading for me either, but enabling zha debug logging managed to shed some light on why:
2023-11-25 22:50:43.156 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for _TZE200_2aaelwxk TS0225 ([REDACTED])
2023-11-25 22:50:43.156 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'ts0225_presence.TS0225Radar'>
2023-11-25 22:50:43.156 DEBUG (MainThread) [zigpy.quirks.registry] Fail because output cluster mismatch on at least one endpoint

My device's signature includes several output clusters on endpoint 1, whereas the signature in the original post (and thus the custom quirks provided by @evgenln) has none.  The rest of the signature is identical:
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0402",
      "input_clusters": [
        "0x0000",
        "0x0003",
        "0x0400",
        "0x0500",
        "0xe000",
        "0xe002",
        "0xee00",
        "0xef00"
      ],
      "output_clusters": [
        "0x0003",
        "0xe000",
        "0xe002",
        "0xee00",
        "0xef00"
      ]
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "_TZE200_2aaelwxk",
  "model": "TS0225",
  "class": "zigpy.device.Device"
}

I don't have time right now to dig in to this any further, but wanted to at least report my findings (and device signature).  I wonder whether this difference in output clusters is caused by differing firmware versions, or if there are actually multiple hardware versions (with different capabilities) using the same model number?

Adding the output clusters from my device signature into the custom quirk from @evgenln has allowed it to use the quirk, resulting in functioning illuminance, motion and presence sensors.  I haven't tried adjusting any of the exposed settings yet, but here's a tweaked version of the quirk - those who weren't seeing the custom quirk applied (such as @corchat and @Tarod1977) may want to give this a go:
ts0225_presence.zip

@pauln thanks, your quirk worked for my sensor.

Adding the output clusters from my device signature into the custom quirk from @evgenln has allowed it to use the quirk, resulting in functioning illuminance, motion and presence sensors. I haven't tried adjusting any of the exposed settings yet, but here's a tweaked version of the quirk - those who weren't seeing the custom quirk applied (such as @corchat and @Tarod1977) may want to give this a go: ts0225_presence.zip

Thanks, the quirk is finally loaded 🥳 However I am not sure whether the displayed settings actually have an effect on the device itself.
When setting something like the "Fading Time" or "Small Motion Detection Distance", I cannot retrieve these values from the device itself. It always shows None as the current value.
See here for example:

I am not sure how this attribute addresses inside the MmwRadarManufCluster work but I think these would reassemble the ones used in zigbee2mqtt, which I've found here: https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/devices/tuya.ts#L5065C71-L5122
0xEF01: ("presence", t.uint32_t, True), # should this exist?
0xEF02: ("large_motion_detection_sensitivity", t.uint32_t, True),
0xEF04: ("large_motion_detection_distance", t.uint32_t, True),
0xEF65: ("human_motion_state", t.enum8, True), # 0=none, 1=large, 2=medium, 3=small
0xEF66: ("fading_time", t.uint32_t, True),
0xEF68: ("medium_motion_detection_distance", t.uint32_t, True),
0xEF69: ("medium_motion_detection_sensitivity", t.uint32_t, True),
0xEF6A: ("illuminance_value", t.uint32_t, True),
0xEF6B: ("indicator", t.enum8, True),
0xEF6C: ("small_detection_distance", t.uint32_t, True),
0xEF6D: ("small_detection_sensitivity", t.uint32_t, True),

Even with these I could not prove or notice any effect on the settings, so further input is appreciated 😃

For this sensor TZE200_2aaelwxk, it doesn't work like the time seconds in fading time, I set 3 seconds but it takes at least 1 minute if everything goes well, please help me

TS0225_TZE200_2aaelwxk_with config.zip In this one, I added basic configuration entries to UI, and removed unsupported sensors. So you will have a usable device. At the moment I don't see a way to add motion states via quirk without changes to ZHA

For this sensor TZE200_2aaelwxk, it doesn't work like the time seconds in fading time, I set 3 seconds but it takes at least 1 minute if everything goes well, please help me

I'm running into the same problems. I bought the "TS0225 / _TZE200_2aaelwxk". Never tried z2m, but in zha I got only the motion und luminance sensor. With pauln's quirks I got all the settings, advertised on aliexpress but no matter what I'm setting up, the sensor reacts all the same. Even when set to 10cm it recognises me at 6meters. However, if I read out the values, it shows what I set up.

I'd love to see this thing work properly,

I'm running into the same problems. I bought the "TS0225 / _TZE200_2aaelwxk". Never tried z2m, but in zha I got only the motion und luminance sensor. With pauln's quirks I got all the settings, advertised on aliexpress but no matter what I'm setting up, the sensor reacts all the same. Even when set to 10cm it recognises me at 6meters. However, if I read out the values, it shows what I set up.
I'd love to see this thing work properly,

I have similar experience, moreover my occupancy sensor get staked on without any possibility to reset it. May this help the developer?

I checked it again with Z2M and it works without any problems.

That's good to know - if the settings work in Z2M, it should be possible to get it working in ZHA.  I'll try to have a closer look at some point (all I did before was tweak the device signature to match my device, so that the quirk would actually be applied) - but if somebody who actually knows about ZHA quirks is able to either update the custom quirk or offer some guidance on what might need to be done to make the settings work, that'd be much appreciated.

Having the same issue, device works, presence, motion and light sensors all work, but unable to change the settings to anything useful. Real shame because I bought the device since I don't require great accuracy in the room it's in, but the default settings are way to sensitive and trigger the device if I walk past in the hallway, making it currently unusable. If I could get some pointers on what to try to set it manually and leave it at that I would be pleased, because I just want to set it once and once set I don't have to tinker with it constantly. So any help would be welcome and appreciated.

Same here, hoping that this one can get fixed now that they're widely available on Amazon.
Also not sure if it can be fixed via the quirk, but this thing really spams the Zigbee network by constantly reporting status every second or so. I had to remove it for now as it was causing responsiveness issues for other devices.

i'n having the same sensor and really miss some sorts of configuration for the sensor.
Currently it's so sensitive so if light in the room next door lightens up, then this sensor registrate presense.
It also takes 5 seconds from detecting presence (i can see from the LED that it's pretty fast at discovering presence, but it takes 5 seconds before it delievers data to HA and the automation kicks in)

I checked it again with Z2M and it works without any problems.

That's good to know - if the settings work in Z2M, it should be possible to get it working in ZHA. I'll try to have a closer look at some point (all I did before was tweak the device signature to match my device, so that the quirk would actually be applied) - but if somebody who actually knows about ZHA quirks is able to either update the custom quirk or offer some guidance on what might need to be done to make the settings work, that'd be much appreciated.

hey @pauln Strange.  I had @evgenln quirk "mostly" working earlier and decided to give your posted quirk a whirl since you said it was built on top of @evgenln.  The strangeness:

@evgenln give me very quick Illuminance feedback when I shine a flashlight on it.  It also showed it was using custom quirks as shown below.  I get the full menu with sliders for Small/Med/etc.  This is why I said mostly, but the most important part was the motion and occupancy which was flakey and  key.  Which lead me to:

your quirk.  I repeated the process replacing the *.py, restarted etc.  The device will pair, but doesn't show that it's utilizing the custom quirk no matter what I do.

I feel like I'm close, but something is not clicking.

@niveknow I suspect that there are (at least) two versions of the device (either hardware or firmware - I'm not sure which) with the same device ID.  Literally the only change I made to the quirk was to add the output clusters reported by my device to the signature in order to make ZHA use the quirk for my device - so if my version of the quirk isn't being applied to your device, all I can suggest (for the moment, at least) is to go back to the latest version provided by @evgenln.
When I have time, I might try pairing one of mine with a Tuya zigbee hub / the Smart Life app to see whether it offers me a firmware update - and if so, whether that update changes reported clusters.  If you have a Tuya hub and matching app, it might be interesting for you to also check for firmware updates - it's not obvious to me which version would be newer (did they add the output clusters, or did they remove them?).

Both @pauln and @evgenln quirks are partly working. But... Very slow and unpredictable detecting and clearing and some warnings/errors in the system logs:
Logger: zigpy.zcl
Source: components/zha/core/cluster_handlers/init.py:84
First occurred: 21:09:23 (30 occurrences)
Last logged: 21:14:41
[0x8D49:1:0xef00] no MCU command for data TuyaClusterData(endpoint_id=3, cluster_name='analog_output', cluster_attr='present_value', attr_value=6, expect_reply=False)
[0x8D49:1:0xef00] No cluster_dp found for 5, present_value
[0x8D49:1:0xef00] no MCU command for data TuyaClusterData(endpoint_id=5, cluster_name='analog_output', cluster_attr='present_value', attr_value=6, expect_reply=False)
[0x8D49:1:0xef00] No cluster_dp found for 7, present_value
[0x8D49:1:0xef00] no MCU command for data TuyaClusterData(endpoint_id=7, cluster_name='analog_output', cluster_attr='present_value', attr_value=6, expect_reply=False)
I hope that someone has a perfect quirk for this TS0225 and is willing to post it here...

@niveknow I suspect that there are (at least) two versions of the device (either hardware or firmware - I'm not sure which) with the same device ID. Literally the only change I made to the quirk was to add the output clusters reported by my device to the signature in order to make ZHA use the quirk for my device - so if my version of the quirk isn't being applied to your device, all I can suggest (for the moment, at least) is to go back to the latest version provided by @evgenln.
When I have time, I might try pairing one of mine with a Tuya zigbee hub / the Smart Life app to see whether it offers me a firmware update - and if so, whether that update changes reported clusters. If you have a Tuya hub and matching app, it might be interesting for you to also check for firmware updates - it's not obvious to me which version would be newer (did they add the output clusters, or did they remove them?).

Hi.  Happy to support any way I can to this community.  If I'm doing it correctly, the firmware I am on now is:  '0122052017'.  And this is obtained by reading the Basic Cluster -> sw_build_id.
I did a firmware upgrade via ZHA and it seems to go through the motion and even gave me a 'success', but I'm not sure it it did anything since the pre & post upgrade firmware is the same.  This could be that I'm already on the latest.  Does that firmware<PHONE_NUMBER> echo with anyone else here?
On a side note, I'm still debating if it's worth buying a tuya zigbee gateway to set aside to do only firmware upgrade to zigbee devices since I'm not sure I can depend on the ZHA methods.  Is anyone keeping their devices updated this way outside of HA?

@niveknow I confirm that I also have<PHONE_NUMBER>.

@niveknow Mine also reports the same sw_build_id, so that doesn't seem to be helpful in determining which signature your device will have... I see there are a few other attributes which could possibly specify the version; here are the values for my device:
app_version: 161
cluster_revision: 1
hw_version: 1
stack_version: 2
zcl_version: 3

Do any of those differ from what your device is reporting?  There are also a couple of other plausible-sounding attributes on the basic cluster, but none of them have a value.
How did you attempt a firmware upgrade via ZHA?  As far as I'm aware, you'd need to track down a copy of the OTA update file in order to be able to update via ZHA.  That said, I've just tried connecting my device up to a Tuya zigbee hub using the Smart Life app, and it didn't offer a firmware update (but changes to the detection config within Smart Life definitely seemed to be applying to the device).  It claims that the zigbee and MCU versions are both 2.2.1 (from the presence sensor device, tap the pencil icon in the top right corner, then scroll down and tap on the "Device Update" row, which in my case then says "No updates available" and lists the zigbee and MCU version numbers).

@pauln   All 5 of those attributes match yours from above when I read them.
Re: ZHA firmware.  I grabbed the latest OTA json file off the link below and dropped them into the zipy config zha ota directory and used ZHAtoolkit firmware upgrade service to kick off the upgrade.   This showed 'success' at the bottom of the upgrade logs, but admittedly the details were lacking in the process so I can't be sure it did anything honestly.  That's why I asked about the firmware version.  It wasn't as verbose as I expected from a firmware upgrade, but it appears I am on the current firmware.  Not sure if my device came that way or if the firmware upgrade did the trick.
Like I mentioned, it kinda works, but the motion part doesn't seem to reset in a timely manner.  For example, I can reset the device via the back button.  It'll detect the motion and then clear 1 min afterwards.  However won't detect for 20-60+mins later according to the device logbook.  Shining a flashlight at the device will get the Illuminance to react accordingly.
https://github.com/Koenkk/zigbee-OTA

@niveknow That's interesting - perhaps the actual firmware version is hiding somewhere in one of the unknown clusters, rather than in anything that's currently known/exposed.
As for the firmware update, I don't see anything in the JSON file or zigbee-OTA repo for this device, so it may be that you get the "success" message if there's no firmware update available for the device.  If you do pick up a Tuya zigbee hub (or somebody else has one and also has one of these devices with the same signature as yours), it'd be interesting to see what version(s) the Smart Life app reports for your device and whether it offers you an update; if there's an update available, perhaps you can attempt to capture the update file / URL and share that (via the zigbee-OTA repo)?  It'd also be interesting to know whether applying the update (assuming one is available) results in the device's signature changing to include the output clusters (meaning that you'd have to switch to my version of the quirk).
My device (using my version of the quirk) seems to work fine - though as others have noted, changes to the detection configuration parameters don't seem to actually be applied to the device, which isn't ideal.  When I paired it with the Tuya hub, I was able to successfully change the parameters via Smart Life - but everything was unfortunately reset to the defaults when I then unpaired it and repaired it with ZHA.

I use the ts0225_presence.zip by @pauln and I think the settings are not working.
I have this sensor 2m behind me, all set to max, even 10 minutes fade time but still have bad presence detection.
I sit on the chair and work on my computer, so it shouldn't be hard for the sensor to detect my small movements.

I can set sensitivity to 1 or 10 and it doesn't have any effect, based on my observation.
Is there a new quirk which has settings working properly?

Are there any news? I just installed one of those devices. Did you manage to adjust something in terms of human recognistion / sensitivity / pet recognition?

With this file if they update the values
"""Device handler for Tuya ZG-205Z-A Mini 24Ghz human presence sensor."""

import math
from typing import Dict, Optional, Tuple, Union
from zigpy.profiles import zgp, zha
from zigpy.profiles.zha import DeviceType
from zigpy.quirks import CustomCluster, CustomDevice
import zigpy.types as t
from zigpy.zcl import foundation

from zigpy.zcl.clusters.general import Basic, Identify, Ota, GreenPowerProxy, AnalogOutput, OnOff
from zigpy.zcl.clusters.security import IasZone
from zigpy.zcl.clusters.measurement import (
    IlluminanceMeasurement,
    OccupancySensing,
)

from zhaquirks import MotionWithReset
from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya import TuyaLocalCluster, TuyaManufCluster, TuyaNewManufCluster, TuyaZBE000Cluster, NoManufacturerCluster

from zhaquirks.tuya.mcu import (
    DPToAttributeMapping,
    TuyaAttributesCluster,
    TuyaMCUCluster,
)

class MotionCluster(MotionWithReset):
    """Motion cluster."""

    reset_s: int = 60

class TuyaOccupancySensing(OccupancySensing, TuyaLocalCluster):
    """Tuya local OccupancySensing cluster."""

class TuyaMmwRadarIndicator(TuyaAttributesCluster, OnOff):
    """AnalogOutput cluster for Large motion detection sensitivity."""

class TuyaMmwMotionState(TuyaAttributesCluster, AnalogOutput):
    """AnalogOutput cluster for Large motion detection sensitivity."""

class TuyaMmwRadarFadingTime(TuyaAttributesCluster, AnalogOutput):
    """AnalogOutput cluster for fading time."""

    def __init__(self, *args, **kwargs):
        """Init."""
        super().__init__(*args, **kwargs)
        self._update_attribute(self.attributes_by_name["description"].id, "fading_time")
        self._update_attribute(self.attributes_by_name["min_present_value"].id, 0)
        self._update_attribute(self.attributes_by_name["max_present_value"].id, 600)
        self._update_attribute(self.attributes_by_name["resolution"].id, 1)
        self._update_attribute(
            self.attributes_by_name["engineering_units"].id, 73
        )

class TuyaMmwRadarLargeMotionDetectionSensitivity(TuyaAttributesCluster, AnalogOutput):
    """AnalogOutput cluster for Large motion detection sensitivity."""

    def __init__(self, *args, **kwargs):
        """Init."""
        super().__init__(*args, **kwargs)
        self._update_attribute(self.attributes_by_name["description"].id, "large_sensitivity")
        self._update_attribute(self.attributes_by_name["min_present_value"].id, 0)
        self._update_attribute(self.attributes_by_name["max_present_value"].id, 10)
        self._update_attribute(self.attributes_by_name["resolution"].id, 1)

class TuyaMmwRadarLargeMotionDetectionDistance(TuyaAttributesCluster, AnalogOutput):
    """AnalogOutput cluster for Large motion detection distance."""

    def __init__(self, *args, **kwargs):
        """Init."""
        super().__init__(*args, **kwargs)
        self._update_attribute(self.attributes_by_name["description"].id, "large_distance")
        self._update_attribute(self.attributes_by_name["min_present_value"].id, 0)
        self._update_attribute(self.attributes_by_name["max_present_value"].id, 1000)
        self._update_attribute(self.attributes_by_name["resolution"].id, 10)
        self._update_attribute(
            self.attributes_by_name["engineering_units"].id, 118
        )

class TuyaMmwRadarSmallMotionDetectionSensitivity(TuyaAttributesCluster, AnalogOutput):
    """AnalogOutput cluster for Small motion detection sensitivity."""

    def __init__(self, *args, **kwargs):
        """Init."""
        super().__init__(*args, **kwargs)
        self._update_attribute(self.attributes_by_name["description"].id, "small_sensitivity")
        self._update_attribute(self.attributes_by_name["min_present_value"].id, 0)
        self._update_attribute(self.attributes_by_name["max_present_value"].id, 10)
        self._update_attribute(self.attributes_by_name["resolution"].id, 1)

class TuyaMmwRadarSmallMotionDetectionDistance(TuyaAttributesCluster, AnalogOutput):
    """AnalogOutput cluster for Small motion detection distance."""

    def __init__(self, *args, **kwargs):
        """Init."""
        super().__init__(*args, **kwargs)
        self._update_attribute(self.attributes_by_name["description"].id, "small_distance")
        self._update_attribute(self.attributes_by_name["min_present_value"].id, 0)
        self._update_attribute(self.attributes_by_name["max_present_value"].id, 600)
        self._update_attribute(self.attributes_by_name["resolution"].id, 10)
        self._update_attribute(
            self.attributes_by_name["engineering_units"].id, 118
        )

class TuyaMmwRadarStaticMotionDetectionSensitivity(TuyaAttributesCluster, AnalogOutput):
    """AnalogOutput cluster for Static motion detection sensitivity."""

    def __init__(self, *args, **kwargs):
        """Init."""
        super().__init__(*args, **kwargs)
        self._update_attribute(self.attributes_by_name["description"].id, "static_sensitivity")
        self._update_attribute(self.attributes_by_name["min_present_value"].id, 0)
        self._update_attribute(self.attributes_by_name["max_present_value"].id, 10)
        self._update_attribute(self.attributes_by_name["resolution"].id, 1)

class TuyaMmwRadarStaticMotionDetectionDistance(TuyaAttributesCluster, AnalogOutput):
    """AnalogOutput cluster for Static motion detection distance."""

    def __init__(self, *args, **kwargs):
        """Init."""
        super().__init__(*args, **kwargs)
        self._update_attribute(self.attributes_by_name["description"].id, "static_distance")
        self._update_attribute(self.attributes_by_name["min_present_value"].id, 0)
        self._update_attribute(self.attributes_by_name["max_present_value"].id, 600)
        self._update_attribute(self.attributes_by_name["resolution"].id, 10)
        self._update_attribute(
            self.attributes_by_name["engineering_units"].id, 118
        )

class TuyaMotionState(t.enum8):
    NONE = 0
    LARGE = 1
    SMALL = 2
    STATIC = 3

class MmwRadarManufCluster (NoManufacturerCluster,TuyaMCUCluster):
    """Tuya ZG-205Z-A Mini 24Ghz human presence sensor cluster."""

    attributes = TuyaMCUCluster.attributes.copy()
    attributes.update(
        {
            # ramdom attribute IDs
            0xEF01: ("presence", t.uint32_t, True),
            0xEF6A: ("illuminance_lux", t.uint32_t, True),
            0xEF65: ("motion_state", TuyaMotionState, True),
            0xEF66: ("fading_time", t.uint32_t, True),
            0xEF04: ("large_distance", t.uint32_t, True),
            0xEF02: ("large_sensitivity", t.uint32_t, True),
            0xEF68: ("small_distance", t.uint32_t, True),
            0xEF69: ("small_sensitivity", t.uint32_t, True),
            0xEF6C: ("static_disdtance", t.uint32_t, True),
            0xEF6D: ("static_sensitivity", t.uint32_t, True),
            0xEF6B: ("indicator", t.enum8, True),
        }
    )

    dp_to_attribute: Dict[int, DPToAttributeMapping] = {

        102: DPToAttributeMapping(
            TuyaMmwRadarFadingTime.ep_attribute,
            "present_value",
            endpoint_id=2,
        ),
        2: DPToAttributeMapping(
            TuyaMmwRadarLargeMotionDetectionDistance.ep_attribute,
            "present_value",
            endpoint_id=3,
        ),
        4: DPToAttributeMapping(
            TuyaMmwRadarLargeMotionDetectionSensitivity.ep_attribute,
            "present_value",
            endpoint_id=4,
        ),
        105: DPToAttributeMapping(
            TuyaMmwRadarSmallMotionDetectionDistance.ep_attribute,
            "present_value",
            endpoint_id=5,
        ),
        104: DPToAttributeMapping(
            TuyaMmwRadarSmallMotionDetectionSensitivity.ep_attribute,
            "present_value",
            endpoint_id=6,
        ),
        109: DPToAttributeMapping(
            TuyaMmwRadarStaticMotionDetectionDistance.ep_attribute,
            "present_value",
            endpoint_id=7,
        ),
        108: DPToAttributeMapping(
            TuyaMmwRadarStaticMotionDetectionSensitivity.ep_attribute,
            "present_value",
            endpoint_id=8,
        ),
    }

    data_point_handlers = {
        102: "_dp_2_attr_update",
        4: "_dp_2_attr_update",
        2: "_dp_2_attr_update",
        104: "_dp_2_attr_update",
        105: "_dp_2_attr_update",
        108: "_dp_2_attr_update",
        109: "_dp_2_attr_update",
    }

class TS0225Radar(CustomDevice):
    """Quirk for Tuya ZG-205Z-A Mini 24Ghz human presence sensor."""

    signature = {
        #  endpoint=1, profile=260, device_type=1026, device_version=1,
        #  input_clusters=["0x0000", "0x0003", "0x0400", "0x0500","0xe000","0xe002", "0xee00", "0xef00"], output_clusters=[])
        MODELS_INFO: [("_TZE200_2aaelwxk", "TS0225")],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Identify.cluster_id,
                    IlluminanceMeasurement.cluster_id,
                    IasZone.cluster_id,
                    TuyaZBE000Cluster.cluster_id,
                    0xE002, # Unknown
                    0xEE00, # Unknown
                    TuyaNewManufCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [0x0003,0xe000,0xe002,0xee00,0xef00],
            },
            242: {
                # "profile_id": "0xA1E0", "device_type": "0x0061",
                # "in_clusters": [], "out_clusters": ["0x0021"]
                PROFILE_ID: zgp.PROFILE_ID,
                DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
                INPUT_CLUSTERS: [],
                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
            },
        },
    }
    replacement = {
        ENDPOINTS: {
            1: {
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Identify.cluster_id,
                    IlluminanceMeasurement.cluster_id,
                    MotionCluster,
                    TuyaZBE000Cluster,
                    MmwRadarManufCluster,
                ],
                OUTPUT_CLUSTERS: [],
            },
            2: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COMBINED_INTERFACE,
                INPUT_CLUSTERS: [
                    TuyaMmwRadarFadingTime,
                ],
                OUTPUT_CLUSTERS: [],
            },
            3: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COMBINED_INTERFACE,
                INPUT_CLUSTERS: [
                    TuyaMmwRadarLargeMotionDetectionSensitivity,
                ],
                OUTPUT_CLUSTERS: [],
            },
            4: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COMBINED_INTERFACE,
                INPUT_CLUSTERS: [
                    TuyaMmwRadarLargeMotionDetectionDistance,
                ],
                OUTPUT_CLUSTERS: [],
            },
            5: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COMBINED_INTERFACE,
                INPUT_CLUSTERS: [
                    TuyaMmwRadarSmallMotionDetectionSensitivity,
                ],
                OUTPUT_CLUSTERS: [],
            },
            6: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COMBINED_INTERFACE,
                INPUT_CLUSTERS: [
                    TuyaMmwRadarSmallMotionDetectionDistance,
                ],
                OUTPUT_CLUSTERS: [],
            },
            7: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COMBINED_INTERFACE,
                INPUT_CLUSTERS: [
                    TuyaMmwRadarStaticMotionDetectionSensitivity,
                ],
                OUTPUT_CLUSTERS: [],
            },
            8: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COMBINED_INTERFACE,
                INPUT_CLUSTERS: [
                    TuyaMmwRadarStaticMotionDetectionDistance,
                ],
                OUTPUT_CLUSTERS: [],
            },
            9: {
                PROFILE_ID: zgp.PROFILE_ID,
                DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
                INPUT_CLUSTERS: [],
                OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
            },
        },
    }

@albalaing Does your quirk not report occupancy, only motion?

If we look at zigbee2mqtt it only has the occupancy sensor and not the motion sensor. The sensor that appears as motion is actually occupancy. I can try to change the quirk to get it out of occupation.

The Motion state is not a standard motion sensor but rather tells us if it has detected motion and the cause. Since it is not a standard motion detector, I don't know how to put it in, I will investigate to see if I can put it in.
Motion state (enum)
State of the motion. Value can be found in the published state on the motion_state property.
It's not possible to read (/get) or write (/set) this value. The possible values are: none, small, medium, large.

@albalaing
Possible typo in line 168?
0xEF6C: ("static_**disdtance**", t.uint32_t, True),

ts0225_presence_combined.zip
I've combined @albalaing's quirk with @evgenln's (and my variant) - and added an extra class so that it should support both versions of the device (with or without output quirks in its signature), though I only have the version with output quirks so can't confirm that whether it works on the version without - maybe @niveknow can test it and let us know.  The sensitivity/distance definitely seem to be working, but it's a little hard to tell whether the fading time is working - sometimes it seems like it's being obeyed, but other times it seems to linger for longer than configured.  I've added the occupancy back in (which was missing in @albalaing's quirk), and confirmed that it's independent of the motion state.

Tuya_radar_ZG-205Z.zip
I have made the following changes to the quirk to improve it:

I have changed the motion detector to the occupancy detector.
I have corrected the numbers of the endpoints and the PD of tuya, which although it worked, were changed.
I have added the indicator switch.
I have added the motion state sensor but I code it to create the entity in home assistant. So it does not appear in the interface. I have put it in a multiestateinput cluster, I don't know if that is correct. The value can be accessed by reading the cluster directly.

Tuya_radar_ZG-205Z.zip
I have made the following changes to the quirk to improve it:

I get an error with this one:
2024-02-23 17:04:18.353 INFO (MainThread) [zigpy.device] [0x46b3] Read model 'TS0225' and manufacturer '_TZE200_2aaelwxk' from <Endpoint id=1 in=
[basic:0x0000, identify:0x0003, ias_zone:0x0500, None:0xE002, None:0xEF00, None:0xEE00, None:0xE000, illuminance:0x0400] out=[] status=<Status.ZD
O_INIT: 1>>
2024-02-23 17:04:18.354 INFO (MainThread) [zigpy.device] [0x46b3] Discovered basic device information for
2024-02-23 17:04:18.354 DEBUG (MainThread) [zigpy.application] Device is initialized
2024-02-23 17:04:18.359 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for _TZE200_2aaelwxk TS0225 (a4:c1:38:d5:9b:5f:9d:bc)
2024-02-23 17:04:18.360 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'Tuya_radad_ZG-205Z.TS0225Radar'>
2024-02-23 17:04:18.360 DEBUG (MainThread) [zigpy.quirks.registry] Fail because output cluster mismatch on at least one endpoint

It may be a variant of the same model and may not have the same signature. If you can put his signature I can check it and if possible I will include it.

Hello I extracted the diagnostics. Hope it helps.
zha-23321cc5d43258d9cb4f3a99d3bb5e86-_TZE200_2aaelwxk TS0225-99fbcf85b6cbc6f4105ea78398ac236e.json

The signature of the model you have does not match the one I have. The output cluster of endpoint 1 does not match.
In the quirk file change the line
OUTPUT_CLUSTERS: [0x0003,0xe000,0xe002,0xee00,0xef00],
by:
OUTPUT_CLUSTERS: [],

@albalaing : The quirk was applied now thanks.
The presence is kind of working but I have no idea how fast it is to detect. And has some false positives during the evening.
The motion and Luminance are gone now (Luminance used to work)
What are good values to setup on those sliders? And what that switch is?

The settings you have to set depend on the room. You must adjust the sensitivity and distance of the Large so that it does not give you false positives. If you lower the sensitivity it will trigger less and if you lower the distance it will not trigger with movements beyond that distance.
The switch is so that the LED does not turn on when it detects movement.
The lighting sensor should come out, this is what it says to me:

Quirk is working for my TS0225 by _TZE200_2aaelwxk but I do not see illuminance...it says unavailable but occupancy is working fine.
This is how it looks here

Tuya_radar_ZG-205Z.zip
I have made the following changes to the quirk to improve it:

I have changed the motion detector to the occupancy detector.
I have corrected the numbers of the endpoints and the PD of tuya, which although it worked, were changed.
I have added the indicator switch.
I have added the motion state sensor but I code it to create the entity in home assistant. So it does not appear in the interface. I have put it in a multiestateinput cluster, I don't know if that is correct. The value can be accessed by reading the cluster directly.

hey @albalaing I am trying your quirk and doesn't seem to be recognized, Any other quirk I added works just fine.
This is my device signature, made sure everything matched and restart HA with no luck... any ideas to debug this?
"endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0402",
      "input_clusters": [
        "0x0000",
        "0x0003",
        "0x0400",
        "0x0500",
        "0xe000",
        "0xe002",
        "0xee00",
        "0xef00"
      ],
      "output_clusters": [
        "0x0003",
        "0xe000",
        "0xe002",
        "0xee00",
        "0xef00"
      ]
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "_TZE200_2aaelwxk",
  "model": "TS0225",
  "class": "zigpy.device.Device"

I have checked the signature with mine and it is identical so I had to get it from you.
The only thing that occurs is that you look at the log to see if there are any errors when loading the quirks and that you activate the following logs:
  zigpy.quirks.registry: debug
  zigpy.quirks:debug
And then look at the log to see if you get the following lines:
[zigpy.quirks.registry] Checking quirks for _TZE200_2aaelwxk TS0225 (a4:c1:38:bc:32:2e:55:f5)
[zigpy.quirks.registry] Considering <class 'Tuya_radad_ZG-205Z.TS0225Radar'>
[zigpy.quirks] Device matches filter signature - device ieee[a4:c1:38:bc:32:2e:55:f5]: filter signature[{'models_info': [('_TZE200_2aaelwxk', 'TS0225')], 'endpoints': {1: {'profile_id': 260, 'device_type': <DeviceType.IAS_ZONE: 1026>, 'input_clusters': [0, 3, 1024, 1280, 57344, 57346, 60928, 61184], 'output_clusters': [3, 57344, 57346, 60928, 61184]}, 242: {'profile_id': 41440, 'device_type': <DeviceType.PROXY_BASIC: 97>, 'input_clusters': [], 'output_clusters': [33]}}}]
[zigpy.quirks.registry] Found custom device replacement for a4:c1:38:bc:32:2e:55:f5: <class 'Tuya_radad_ZG-205Z.TS0225Radar'>

I have checked the signature with mine and it is identical so I had to get it from you. The only thing that occurs is that you look at the log to see if there are any errors when loading the quirks and that you activate the following logs:
 zigpy.quirks.registry: debug  zigpy.quirks:debug
And then look at the log to see if you get the following lines:
[zigpy.quirks.registry] Checking quirks for _TZE200_2aaelwxk TS0225 (a4:c1:38:bc:32:2e:55:f5)
[zigpy.quirks.registry] Considering <class 'Tuya_radad_ZG-205Z.TS0225Radar'>
[zigpy.quirks] Device matches filter signature - device ieee[a4:c1:38:bc:32:2e:55:f5]: filter signature[{'models_info': [('_TZE200_2aaelwxk', 'TS0225')], 'endpoints': {1: {'profile_id': 260, 'device_type': <DeviceType.IAS_ZONE: 1026>, 'input_clusters': [0, 3, 1024, 1280, 57344, 57346, 60928, 61184], 'output_clusters': [3, 57344, 57346, 60928, 61184]}, 242: {'profile_id': 41440, 'device_type': <DeviceType.PROXY_BASIC: 97>, 'input_clusters': [], 'output_clusters': [33]}}}]
[zigpy.quirks.registry] Found custom device replacement for a4:c1:38:bc:32:2e:55:f5: <class 'Tuya_radad_ZG-205Z.TS0225Radar'>

@albalaing thanks for the response
it is failing:
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for _TZE200_2aaelwxk TS0225 (a4:c1:38:ab:07:a4:9f:6f)
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {232, 230} {1, 242}
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {232, 230} {1, 242}
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.tuya.ts0201.MoesTemperatureHumidtySensorWithScreen'>
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1} {1, 242}
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1} {1, 242}
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1} {1, 242}
2024-03-13 19:31:34.775 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
2024-03-13 19:31:34.776 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1} {1, 242}
2024-03-13 19:31:34.776 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
2024-03-13 19:31:34.776 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {11, 13} {1, 242}

this is my setup in case there is something wrong here

What happens to you is that you don't have the quirks installed correctly, or you don't get it for some reason.
You have to copy the file Tuya_radad_ZG-205Z.py in the custom_zha_quirks directory of the configuration directory and restart home assistant.
It will be fully charged when you get the line:
[zigpy.quirks.registry] Considering <class 'Tuya_radad_ZG-205Z.TS0225Radar'
This is my configuration:
zha:
  custom_quirks_path: /config/custom_quirks

I had some trouble as well...this is my yaml config part for zha:
zha:
  custom_quirks_path: zha_quirks/

the last / is important...
My quirk folder "zha_quirks" is directly located in the homeassistant/ folder
If I put it in codig I have no clue why it's not working. This is how the qurik folder looks like:

Does it make a difference if you have a previous directory you are using custom_zha_quirks and place it in that as opposed to zha_quirks. It doesnt read it as shown
zha:
enable_quirks: true
custom_quirks_path: /config/custom_zha_quirks/

hi @albalaing
for some reason I don't get any data in the sensor - the data I do get is not real and not being updated
motion doesn't work and illumination doesn't change when I cover it
presence is not there at all.... could you please tell me how to fix

this is the device signature:
{   "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",   "endpoints": {     "1": {       "profile_id": "0x0104",       "device_type": "0x0402",       "input_clusters": [         "0x0000",         "0x0003",         "0x0400",         "0x0500",         "0xe000",         "0xef00"       ],       "output_clusters": []     },     "2": {       "profile_id": "0x0104",       "device_type": "0x0007",       "input_clusters": [         "0x000d"       ],       "output_clusters": []     },     "3": {       "profile_id": "0x0104",       "device_type": "0x0007",       "input_clusters": [         "0x000d"       ],       "output_clusters": []     },     "4": {       "profile_id": "0x0104",       "device_type": "0x0007",       "input_clusters": [         "0x000d"       ],       "output_clusters": []     },     "5": {       "profile_id": "0x0104",       "device_type": "0x0007",       "input_clusters": [         "0x000d"       ],       "output_clusters": []     },     "6": {       "profile_id": "0x0104",       "device_type": "0x0007",       "input_clusters": [         "0x000d"       ],       "output_clusters": []     },     "7": {       "profile_id": "0x0104",       "device_type": "0x0007",       "input_clusters": [         "0x000d"       ],       "output_clusters": []     },     "8": {       "profile_id": "0x0104",       "device_type": "0x0007",       "input_clusters": [         "0x000d"       ],       "output_clusters": []     },     "9": {       "profile_id": "0xa1e0",       "device_type": "0x0061",       "input_clusters": [],       "output_clusters": [         "0x0021"       ]     }   },   "manufacturer": "_TZE200_2aaelwxk",   "model": "TS0225",   "class": "TZE200_2aaelwxk_presense.TS0225Radar" }

I've just received what I believe to 'basically' be same sensor and I odn't know if it's something I'm doing or not, but I have no idea how to get it working. The model listed is different - it's listed in ZHA as a TS0601 by "_TZE200_2aaelwxk". Box for it says it's a ZG-204ZS OR a ZG-204ZM (I don't know which). But when I google TS0601 mostly light switches come up, and when I google the number on the box I get nothing, really. Bought here: https://www.aliexpress.us/item/1005005909775887.html
After connecting it to Zigbee which worked fine, it's now showing a constant motion detected and no toher attributes other than illuminance. The quirks in this thread don't seem to work for me after adjusting for model and manufacturer name, so I don't really know where to go from here. Googling it comes up with 0 hits for the combination of model and manufacturer number.
Where do I go from here?

I've just received what I believe to 'basically' be same sensor and I odn't know if it's something I'm doing or not, but I have no idea how to get it working. The model listed is different - it's listed in ZHA as a TS0601 by "_TZE200_2aaelwxk". Box for it says it's a ZG-204ZS OR a ZG-204ZM (I don't know which). But when I google TS0601 mostly light switches come up, and when I google the number on the box I get nothing, really. Bought here: https://www.aliexpress.us/item/1005005909775887.html
After connecting it to Zigbee which worked fine, it's now showing a constant motion detected and no toher attributes other than illuminance. The quirks in this thread don't seem to work for me after adjusting for model and manufacturer name, so I don't really know where to go from here. Googling it comes up with 0 hits for the combination of model and manufacturer number.
Where do I go from here?

Hello.
Managed to solve?
I have the same problem with this product.

I've just received what I believe to 'basically' be same sensor and I odn't know if it's something I'm doing or not, but I have no idea how to get it working. The model listed is different - it's listed in ZHA as a TS0601 by "_TZE200_2aaelwxk". Box for it says it's a ZG-204ZS OR a ZG-204ZM (I don't know which). But when I google TS0601 mostly light switches come up, and when I google the number on the box I get nothing, really. Bought here: https://www.aliexpress.us/item/1005005909775887.html
After connecting it to Zigbee which worked fine, it's now showing a constant motion detected and no toher attributes other than illuminance. The quirks in this thread don't seem to work for me after adjusting for model and manufacturer name, so I don't really know where to go from here. Googling it comes up with 0 hits for the combination of model and manufacturer number.
Where do I go from here?

Hello. Managed to solve? I have the same problem with this product.
It worked... the file works fine.
* Removed the ZHA sensor

* I added it to the configuration.yaml file:
  `zha:`
  `    enable_quirks: true`
  `    custom_quirks_path: /config/custom_zha_quirks/`

* I added the file Tuya_radad_ZG-205Z.py inside \config\custom_zha_quirks.

* I restarted the HA (you have to do a full restart, not Reload)

* I added the sensor again and it appeared and recognized everything.

Not working for me still... I confirmed the quirk is working (it's making a copy in my pycache folder) but it's still only showing illuminance and motion with no editable parameters etc. So no different from before. Are you sure you've got the exact same one as me?

Works for me. Only thing I'm having trouble with is the cool down time. When playing around with the settings I had the cool down too low, at 10 seconds, but it worked. Now I've it set at 20 and it doesn't work. Always takes a minute. However, if I set it back to 10,it also sticks to a minute. Don't know what makes this setting work sometimes and not other times...

Works for me. Only thing I'm having trouble with is the cool down time. When playing around with the settings I had the cool down too low, at 10 seconds, but it worked. Now I've it set at 20 and it doesn't work. Always takes a minute. However, if I set it back to 10,it also sticks to a minute. Don't know what makes this setting work sometimes and not other times...

The same thing happens to me, I believe it's the sensor. I had already tested it with zigbee2mqtt and the same thing happened. Unfortunately I don't have another presence sensor from another brand to know the behavior to say if this is the case for all presence sensors or is it something from this sensor model. It is cheaper than the others.

I've just received what I believe to 'basically' be same sensor and I odn't know if it's something I'm doing or not, but I have no idea how to get it working. The model listed is different - it's listed in ZHA as a TS0601 by "_TZE200_2aaelwxk". Box for it says it's a ZG-204ZS OR a ZG-204ZM (I don't know which). But when I google TS0601 mostly light switches come up, and when I google the number on the box I get nothing, really. Bought here: https://www.aliexpress.us/item/1005005909775887.html
After connecting it to Zigbee which worked fine, it's now showing a constant motion detected and no toher attributes other than illuminance. The quirks in this thread don't seem to work for me after adjusting for model and manufacturer name, so I don't really know where to go from here. Googling it comes up with 0 hits for the combination of model and manufacturer number.
Where do I go from here?

Hello. Managed to solve? I have the same problem with this product.
It worked... the file works fine.
* Removed the ZHA sensor

* I added it to the configuration.yaml file:
  `zha:`
  `    enable_quirks: true`
  `    custom_quirks_path: /config/custom_zha_quirks/`

* I added the file Tuya_radad_ZG-205Z.py inside \config\custom_zha_quirks.

* I restarted the HA (you have to do a full restart, not Reload)

* I added the sensor again and it appeared and recognized everything.

Not working for me still... I confirmed the quirk is working (it's making a copy in my pycache folder) but it's still only showing illuminance and motion with no editable parameters etc. So no different from before. Are you sure you've got the exact same one as me?

Try redoing step by step and restarting HA instead of QuickReload.

Hi, what is the "fading time" exactly for?

I had to change the OUTPUT_CLUSTERS (at line 264 of the quirk) to match those to the signature of my device ([0x0003,0x000a]). Now the quirk works great, thanks!
For anyone asking what values should be used for the different sliders, this official manual has some descriptions about them and proposed values per typical room: https://doc.szalarm.com/zg-205Z/en/

After couple of hours to debug this. I think I have a different model of this sensor (ZG-205Z/C), so I had to customize the quirk file. I revised the INPUT_CLUSTERS and OUTPUT_CLUSTERS to the following configuration at line 254.
INPUT_CLUSTERS: [
    Basic.cluster_id,
    Identify.cluster_id,
    IlluminanceMeasurement.cluster_id,
    IasZone.cluster_id,
    0xE002, # Unknown
    0xEF00, # Unknown
],
OUTPUT_CLUSTERS: [0x0003, 0x000A],

and finally, it works. Thanks for the quirk!!.

I've just received what I believe to 'basically' be same sensor and I odn't know if it's something I'm doing or not, but I have no idea how to get it working. The model listed is different - it's listed in ZHA as a TS0601 by "_TZE200_2aaelwxk". Box for it says it's a ZG-204ZS OR a ZG-204ZM (I don't know which). But when I google TS0601 mostly light switches come up, and when I google the number on the box I get nothing, really. Bought here: https://www.aliexpress.us/item/1005005909775887.html
After connecting it to Zigbee which worked fine, it's now showing a constant motion detected and no toher attributes other than illuminance. The quirks in this thread don't seem to work for me after adjusting for model and manufacturer name, so I don't really know where to go from here. Googling it comes up with 0 hits for the combination of model and manufacturer number.
Where do I go from here?

Hello. Managed to solve? I have the same problem with this product.
It worked... the file works fine.
* Removed the ZHA sensor

* I added it to the configuration.yaml file:
  `zha:`
  `    enable_quirks: true`
  `    custom_quirks_path: /config/custom_zha_quirks/`

* I added the file Tuya_radad_ZG-205Z.py inside \config\custom_zha_quirks.

* I restarted the HA (you have to do a full restart, not Reload)

* I added the sensor again and it appeared and recognized everything.

Not working for me still... I confirmed the quirk is working (it's making a copy in my pycache folder) but it's still only showing illuminance and motion with no editable parameters etc. So no different from before. Are you sure you've got the exact same one as me?

Did you get anywhere with this? Currently experiencing the same issue.
Tried several of quirk files in this thread, tried changing input and out clusters as others, still not loading the quirk...only get motion and lumiance...

I've just received what I believe to 'basically' be same sensor and I odn't know if it's something I'm doing or not, but I have no idea how to get it working. The model listed is different - it's listed in ZHA as a TS0601 by "_TZE200_2aaelwxk". Box for it says it's a ZG-204ZS OR a ZG-204ZM (I don't know which). But when I google TS0601 mostly light switches come up, and when I google the number on the box I get nothing, really. Bought here: https://www.aliexpress.us/item/1005005909775887.html
After connecting it to Zigbee which worked fine, it's now showing a constant motion detected and no toher attributes other than illuminance. The quirks in this thread don't seem to work for me after adjusting for model and manufacturer name, so I don't really know where to go from here. Googling it comes up with 0 hits for the combination of model and manufacturer number.
Where do I go from here?

Hello. Managed to solve? I have the same problem with this product.
It worked... the file works fine.
* Removed the ZHA sensor

* I added it to the configuration.yaml file:
  `zha:`
  `    enable_quirks: true`
  `    custom_quirks_path: /config/custom_zha_quirks/`

* I added the file Tuya_radad_ZG-205Z.py inside \config\custom_zha_quirks.

* I restarted the HA (you have to do a full restart, not Reload)

* I added the sensor again and it appeared and recognized everything.

Not working for me still... I confirmed the quirk is working (it's making a copy in my pycache folder) but it's still only showing illuminance and motion with no editable parameters etc. So no different from before. Are you sure you've got the exact same one as me?

Did you get anywhere with this? Currently experiencing the same issue.
Tried several of quirk files in this thread, tried changing input and out clusters as others, still not loading the quirk...only get motion and lumiance...

Are you sure the quirk has been loaded? To check, go to the device and expand the "Device Info" section. Look at the last line; it should show "Quirk: Tuya_radad_ZG-205Z.TS0225Radar." If you only see "Power Source: Mains," it means the quirk hasn't been loaded yet.
I faced this issue before and recommend trying to remove the leading "/" from the custom path. In my case, "/config/custom_zha_quirks/" didn't work, but changing it to "config/custom_zha_quirks/" then restart and everything worked perfectly.
In case of quirk is already loaded and still not working, try to share your diagnostics file and quirk that you use.

I had to change the OUTPUT_CLUSTERS (at line 264 of the quirk) to match those to the signature of my device ([0x0003,0x000a]). Now the quirk works great, thanks!
For anyone asking what values should be used for the different sliders, this official manual has some descriptions about them and proposed values per typical room: https://doc.szalarm.com/zg-205Z/en/

Mind sharing the file you used? I have tried and am failing miserably.

Mind sharing the file you used? I have tried and am failing miserably.

I used the latest file shared in this thread by @albalaing: https://github.com/zigpy/zha-device-handlers/issues/2551#issuecomment-1924459205

It wasn't loading the quirk at all, until I tried as @rolandboon suggested, I changed the output clusters and now it does load the quirk, but it doesn't seem to be working correctly.. I tried @PitsanuM 's changes to the input clusters and the quirk stopped loading entirely.
I have tons of adjustment sliders, but motion is showing unavailable, lumiance is always 1, and occupancy is always clear...
zha-01J21QD04M8BDT7GKW8BEKEJX2-_TZE200_2aaelwxk TS0225-e16cd0218d7d0a54a2b8944fbf3c9301.json

So far, it wasn't loading the quirk at all, until I tried as @rolandboon suggested, I changed the output clusters and now it does load the quirk, but it doesn't seem to be working correctly.. I tried @PitsanuM 's changes to the input clusters and the quirk stopped loading entirely.
I have tons of adjustment sliders, but motion is showing unavailable, lumiance is always 1, and occupancy is always clear...
zha-01J21QD04M8BDT7GKW8BEKEJX2-_TZE200_2aaelwxk TS0225-e16cd0218d7d0a54a2b8944fbf3c9301.json
Attaching the diags if anyone can take a look and advise whats up, thanks.
 The sensor I was expecting readings on and getting nothing, was another sensor in an empty room and not the one I was focusing on....so it is detecting presence and luminance.

Thanks for the file. I did a quick check, and it seems your device is not the same as mine. Anyway, if you used the file from #2551(Comment) it might not work because all the input and output clusters are incorrect. I believe your device has only three values based on the diagnostics file:
OnOff Cluster (0x0006) – I assume that you're always seeing the luminance as 1 because of this.
IlluminanceMeasurement (0x0400)
OccupancySensing (0x0406)
Since I don’t have that device, debugging is quite difficult, but it's worth trying the following edits:

Start from line no.13 change: (We need to import OnOff because your need this
from zigpy.zcl.clusters.general import Basic, Identify,  GreenPowerProxy, AnalogOutput,  MultistateInput,
to:
from zigpy.zcl.clusters.general import Basic, Identify,  GreenPowerProxy, AnalogOutput,  MultistateInput, OnOff,

Starting from line 254, change: (Make it matched with your diags.)
INPUT_CLUSTERS: [                  Basic.cluster_id,                  Identify.cluster_id,                  IlluminanceMeasurement.cluster_id,                  IasZone.cluster_id,                  TuyaZBE000Cluster.cluster_id,                  0xE002, # Unknown                  0xEE00, # Unknown                  TuyaNewManufCluster.cluster_id,              ],              OUTPUT_CLUSTERS: [0x0003,0xe000,0xe002,0xee00,0xef00],
to
INPUT_CLUSTERS: [                  Basic.cluster_id,                  Identify.cluster_id,                  OnOff.cluster_id,                  IlluminanceMeasurement.cluster_id,                  OccupancySensing.cluster_id,                  0xE000, # Unknown                  0xEF00, # Unknown              ],              OUTPUT_CLUSTERS: [],

Remove > Restart > Pair.
You might still see the bunch of settings, ignore them for now.

In case of quirk is already loaded and still not working, try to share your diagnostics file and quirk that you use.

So mine is definitely still not working. I just kind of gave up until I see a new post in this thread then try whatever my (probably mis)interpretation of the advice given is and find out it still doesn't work.
I get a message in my system log saying custom quirks are loaded, but it doesn't seem to load this one, since no quirk is mentioned in the device info. I see it on another device I have a quirk for, so something is definitely off there. But I'm not sure how to make it connect. Probably I have a slightly different one that has a different model number or device type or something? But I'm not really sure where to find it. Sorry if I'm being stupid but the way some of these things are discussed are as if everyone knows (and you are probably right that I should) but I have no idea how to even go about finding them out lol.

In case of quirk is already loaded and still not working, try to share your diagnostics file and quirk that you use.

So mine is definitely still not working. I just kind of gave up until I see a new post in this thread then try whatever my (probably mis)interpretation of the advice given is and find out it still doesn't work.
I get a message in my system log saying custom quirks are loaded, but it doesn't seem to load this one, since no quirk is mentioned in the device info. I see it on another device I have a quirk for, so something is definitely off there. But I'm not sure how to make it connect. Probably I have a slightly different one that has a different model number or device type or something? But I'm not really sure where to find it. Sorry if I'm being stupid but the way some of these things are discussed are as if everyone knows (and you are probably right that I should) but I have no idea how to even go about finding them out lol.

First, review your diagnostics file and verify the input and output clusters. I often encounter cases where a device quirk does not match my mine device, which can prevent it from being loaded properly.

After applying quirk I have switch entity not sure what it will do but I found also light meter are about 10 times higher than real. I'll try to figure out formula to fix this. You can check by yourself using android app (if only your phone have real sensor, some of them uses front camera).

I have yet another variant of the ZG-205Z sensor. Had to add output clusters 3 and 10 to the first endpoint to get the TS0225Radar quirk to load.

I'm kind of one step behind getting the device running at all... together with chatgpt I try since half an hour to fix the following error that prevents the quirk for this device from loading (fyi: I have two other devices with quirks that work fine)
2024-12-29 00:06:01.948 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Device: a4:c1:38:07:8c:ce:c3:02-_TZE200_2aaelwxk TS0225 is not a quirks v2 device - skipping discover_quirks_v2_entities
Chatgpt suggested to force quirks v1 inside the quirk but I'm still getting this error in the log. What can I do?


[FEATURE] Add user profile in the Navbar

Description
We could add the logged in user's profile in the navbar instead of them having to search their own profile

Screenshots
No response
Additional information
No response

That would be really helpful. 👍

I will fix this issue.

Hey @ElvisJin , Maybe we could let the maintainers take a look and triage the issue then it will get assigned to you. Thank you!

This is a great idea. As we have the paid for Tailwind pre-built component, I will assign this to @eddiejaoude
https://tailwindui.com/components/application-ui/navigation/navbars

Can I work on this issue ??

Can I work on this issue ??

As you can see from the conversation above this has already been assigned (and is being done as part of #5575 . Please pick an issue which has not been assigned.

Sorry, I just had some accident, now I'm working on it.
Will update soon.

Hey! I can't see any update from my last comment. If there is no working happening. Can I take it and try to work on it?

@Vishrut19 I replied to your comment of the 3 April on the same day.  Please read the comment history - this issue is being done as part of #5575 and therefore the two week non-activity does not apply here.
As suggested by me a few moments ago in https://github.com/EddieHubCommunity/LinkFree/issues/6874 please look for unassigned issues such as: https://github.com/EddieHubCommunity/LinkFree/issues/7575.
By spamming issues which are already assigned and people are working on, as you have done in the last few days, this is creating unnecessary notifications for maintainers as well as noise in the issue's history - we have drawn this to your attention a number of times. Any questions please ask on Discord.


Hunger Games (tracker)

What
### Tasks
- [ ] https://github.com/openfoodfacts/smooth-app/issues/3236
- [ ] https://github.com/openfoodfacts/smooth-app/issues/3317
- [ ] https://github.com/openfoodfacts/smooth-app/issues/3705
- [ ] https://github.com/openfoodfacts/smooth-app/issues/4016
- [ ] Add a link on "On-Page Robotoff Questions" to a version of Hunger Games filtered on a specific value (eg: Lamb meat)
- [ ] https://github.com/openfoodfacts/smooth-app/issues/4086

Part of

#525

@teolemon Not particularly for the moment. I'm currently more interested in background tasks, indeed for hunger games (for an instant result - as far as the UX goes). And then possibly background tasks for offline bulk download.
It depends on the priorities.

@monsieurtanuki  It's relatively low profile compared to editing for now. Note that we don't yet track usage of the mini Hunger Games in Matomo.


Docs: Set Datastructure

The set data structure should be added to https://phel-lang.org/documentation/array-table-and-struct/

I can work on it. Since I implemented this data structure, I would like to do it to the end.


[MR] cherry-pick packaging stuff

@SchrodingersGat I would like to cherry-pick the packaging stuff to stable to enable a test package-release before the release and notifications for 0.9.0 go out.
Is that ok?

Yeah, makes sense :) submit a PR to stable

Closed by #3972


"Deny consent" returns to a page of the OP

Good afternoon,
I would like to tell you that when I'm going to deny consent I see OP not returning to my RP callback page, but to the same URL on OP domain. I obtain the same problem when I use the preconfigured RP. Can it be fixed? Thanks.
Luca Montano

Resolved by https://github.com/italia/spid-cie-oidc-django/releases/tag/v1.1.2


Required Operations

I miss some info in the paper.
You report the number of parameters of the network, but could you report the number of estimated floating point operations of the inference network?

Hi,
You can use the comp_multadds function in  /utils/multadds_count.py
FYR: mult_adds = comp_multadds(model, input_size=(3,192, 192))
We tested the FLOPs for the inference network is around 323M (considering input size 1921923).
Cheers,
Xuelian

thank you !

Thank you so much!


Distributed tracing support

As Imgproxy works as http server and http client it would be great to have support for distributed tracing like
https://opentelemetry.io/    (if not abstracted that zipkin or https://www.jaegertracing.io/)

OTel is supported since v3.8.0 https://docs.imgproxy.net/open_telemetry


Discord channel for item tags

Add a channel to the discord for people to share their item tags. It's a shame that the tag exporter doesn't get much use and it would make sense for the discord to have one.

The gear discord has channel for bank tags. Also, discord-related stuff has no place on this issue tracker


How set a layout in a controller ?

How set a layout in a controller ?
Here my controller
namespace App\Modules\Blog\Http\Controllers;

use App\Http\Controllers\Controller;

class BlogController extends Controller
{
    public function home()
    {
        return '111';
        exit;
    }
}

In your controllers constructor, use:
Theme::setLayout('reference.to.layout');

This would be best placed in your base controller.

See here for more information: https://github.com/caffeinated/themes/wiki/Views-And-Responses#extending-theme-views


The launch image set name "LaunchImage" did not have any applicable content.

Xcode throws that error on compile.
My setup:
Xcode 7
RN 0.34
Apparently the LaunchImage set is generated but with missing iPhone 5,6 images

Hi @DenJohX, thanks for reporting the issue! 🚀
I'm on Xcode 8.0 myself and it works even with the missing images for iOS 5,6. iOS 5 and 6 are not supported by React Native anyway :)
Is is possible for you to update?
If not, it seems according to this answer that it might be due to a size problem.
What was the size of your original image? Was it bigger than 2208x2208px?

Closing the issue

I'm actually running into this at the moment.

My image was bigger than 2208 x 2208


Release: 2.14.5

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.


error: uses unchecked or unsafe operations.

Error: Program type already present: com.tencent.smtt.export.external.DexClassLoaderProvider
please help.

Error: Program type already present: com.tencent.smtt.export.external.DexClassLoaderProvider
please help.

Can u give more error info?

When I tried to compile project it gives me compile time errors as follows
error: package com.tencent.smtt.sdk does not exist
error: cannot find symbol variable QbSdk
error: package com.tencent.smtt.sdk does not exist
error: cannot find symbol class WebView
error: cannot access TbsReaderView class file for com.tencent.smtt.sdk.TbsReaderView not found
So I added tbs_.jar file in libs folder and above errors gone but  now It gives error as
'Error: Program type already present: MTT.ThirdAppInfoNew'

When I tried to compile project it gives me compile time errors as follows
error: package com.tencent.smtt.sdk does not exist
error: cannot find symbol variable QbSdk
error: package com.tencent.smtt.sdk does not exist
error: cannot find symbol class WebView
error: cannot access TbsReaderView class file for com.tencent.smtt.sdk.TbsReaderView not found
So I added tbs_.jar file in libs folder and above errors gone but now It gives error as
'Error: Program type already present: MTT.ThirdAppInfoNew'

I think u project have init issues
Did you cloning my whole repo  And open it with AndroidStudio directly, When U open it, if AndroidStudio  prompt you to upgrade gradle version， if there is and u click update, you should clone a new repo, and open it again, then ignore the gradle upgrade dialog.


Sync issue between Video and Audio

I've been noticing a sync issue on recorded videos between the audio and video. Doesn't seem to depend on the FPS settings or the video size. Unsure if it's a bug or something I haven't set correctly?

These things can be very hard to track down...
Have you tried experimenting with different video/audio encoders?

Closing as nog update anymore


drop user from ticket

add first name, last name, email to ticket, drop user.
Simplifies issues around setting/changing names.

done a better way


Failing samples tests

@ace-n

Sadly I think we technically own this one @bcoe

Looks to be fixed in #334


Fix CNI config insertion on files that don't contain .plugins[]

Closes: #3.

Looks good...  I'm reviewing and testing.

@jwendell I ran this on a ubuntu system with plugin conf file with this content:

It looks like it replaces just the type field in the top level dict

@tiswanso thanks for testing it, I've updated the jq filter. Please, try again.
It looks like we need a testsuite though.

The jq filter seems to be working now.  I checked it for both a file without any plugins array and one with an existing plugins array.


Use of forward declarations in VRDisplayDevice

Hey Michael,
Why use forward declarations in VRDisplayDevice?  Why not just include the file (i.e. "VRDataIndex.h")?  What is the reasoning here?  It seems to be breaking the plugins as Tom has mentioned.  According to the Google Style guide, this is something that should be avoided if possible since the main plus is to save on compile time:
https://google.github.io/styleguide/cppguide.html#Forward_Declaration
Thanks,
Dan

Old implementation error.