-
Hello, i need to make tuya-local work with more than 20 custom devices made by a company that im working with, all devices powered by tuya....
im able to use tinytuya to change all thoses DP though code, and im already able to use the first and second DP though the HA UI, but not yet both at same time... idk why or what im missing
then i tried adding the rest of the DPS, this way, and it just recognized 1 entity....
then i tried to change the one with binary sensor to switch, it didnt recognized too, but then i moved this second DPS to be together with the primary entity(inside), and it worked, ofc that not in the right manner, but for test purposes....(i tried to choosing only one DP only at time( 1 per time) as a primary entity, and it works well too) ) so what im missing is how to use them all in the same .yaml file being them as 1 entity each or something like that after that i tried several yaml file configurations, looked into others devices configs and nothing... wasted more than 4 hours on this yesterday, made more than 30 yaml file and nothing works.... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Each entity type has specific requirements for the naming of the dps inside them. These requirements are listed in custom_components/tuya_local/devices/README.md There is a pytest test in I think the following should work (first line is only required the first time you do this):
It is also recommended to use venv, if you are doing other python development then you should already be familiar with that, but if this is the only thing you are using python for, then messing up your global environment isn't going to be a concern. You can also run pytest with no arguments to run all the tests, but if you are only adding new config files the other tests are not relevant to what you have changed, and it takes a long time to run all of them. This will be done when you submit the PR, so if you can't get it set up locally, it is not the end of the world, just with so many devices it might help to have the tests locally. |
Beta Was this translation helpful? Give feedback.
-
I totally forgot about answering this discussion... sorry.. with this msg by you i was able to make this work already on 5 devices, one is already on my fork... Thank you so much, soon all them and + will be at my fork to maybe someday i git push to the main repo <3 OR MAYBE SOMETHING LIKE THAT, RIGHT? bc i see that the tinytua wizard only provides the cloud info and there it only shows(obvisly) the ipv4 host ip for the gateway device, not the local ip that is needed to this config.. so idk how could i retrieve this ip though tinytua to maybe create this feature.... maybe someday i will dig more about it and try to implement this feature.... |
Beta Was this translation helpful? Give feedback.
Each entity type has specific requirements for the naming of the dps inside them. These requirements are listed in custom_components/tuya_local/devices/README.md
There is a pytest test in
tests/test_device_config.py
that can catch issues like this, with 20 devices in your plans, I would recommend getting pytest working locally.I think the following should work (first line is only required the first time you do this):
It is also recommended to use venv, if you are doing other python development then you should already be familiar with that, but if this is the only thing you are using python for, then messing up your g…