Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Added a device YAML file for the lightless Casafan Eco Genuino #2773

Closed
wants to merge 2 commits into from

Conversation

tschiex
Copy link

@tschiex tschiex commented Jan 13, 2025

The YAML file has been tested with the corresponding model (1.8 meters diameter model, it's possible that other diameters have different model ids). The information has been extracted from Tuya Cloud Platform.

@make-all
Copy link
Owner

This is identical to the already existing reiga_ceiling_fan config.

I would add the new product in, but the product id does not appear to be correct (I think it is taken from "model id" returned by one of the cloud API functions, judging by the format, which is not the same as product id).

@tschiex
Copy link
Author

tschiex commented Jan 13, 2025

Ok. I thought the Cloud model id in the answer of the PAI Query was the correct source.
The Tuya device id (to be used with the local key) is "bffeb165510fdf5a48vjrq".
If that's the correct source :-/

@make-all
Copy link
Owner

make-all commented Jan 13, 2025

The product id is neither the device id, nor the model id.

You can find the product id in the same Tuya cloud API functions that return the local key. You can also get it from the local discovery using python -m tinytuya scan from a PC on the same network (you may need to pip install tinytuya first, and you may need to disable the device in tuya-local to unblock local connections if it is a device that only accepts one local connection at a time).

Sometimes the local and cloud product ids are different (the local one seems to always start with "key" in these cases). Currently we only search for configs by product id when using the cloud config flow, so we will always have the cloud one in these cases, we may not have the local one if discovery is blocked by localtuya being installed or a complex network setup.

@tschiex
Copy link
Author

tschiex commented Jan 13, 2025

Sincere apologies for not RTFM'ing. Did it with tinytuya:

    "product_name": "Ceiling  Fan",
    "product_id": "aktxh7558udrex8a"

Hope I'm doing it the right way now :-)

@make-all
Copy link
Owner

The product id is also identical to the Reiga one, so they are obviously just rebadged.

make-all added a commit that referenced this pull request Jan 13, 2025
Identical product id, not sure if the German or the US brand is the original,
or maybe they both use a control unit from another manufacturer.

Closes PR #2773
@make-all make-all closed this Jan 13, 2025
@tschiex
Copy link
Author

tschiex commented Jan 13, 2025

Thanks. Sorry for generating time losses (four both of us).

BTW, it would be nice if available YAMLs that precisely match the device (same DPs, same Product Id) could be clearly presnted as "matching". When I added the fan, I was presented with a list of several fans models, with just their stripped filenames.

I selected the casafan one (with lights) hoping it would work based on the brand.
Then, it didn't work and there was no other casafan models. So I decided to create a YAML.

Having matching DPs and ProductId could be enough to select the YAML 'automatically' possibly?

Tuya Local is great!
I will uninstall Local Tuya this evening.

@make-all
Copy link
Owner

make-all commented Jan 13, 2025

Usually the closest match is highlighted by default. In this case, there is also a Skyfan DC fan with exactly the same dps but only 5 speeds, which cannot be distinguished by a snapshot of current values alone, so it is possible that the Reiga one is not selected by default. The product id probably should be taken into account for this process, I guess it could be done by giving a product_id match a score of 101% instead of 100%, so it gets boosted above a perfect dps only match.

make-all added a commit that referenced this pull request Jan 13, 2025
A product id match signals a perfect match, but at 100% it does not
appear any better than dps that happen to match.

Also do not require all non-optional keys to match when the product id
is already matched. A partial match is still likely to be the correct
device. Only discard the match if there are mismatches in the dps
types.

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

Successfully merging this pull request may close these issues.

2 participants