Thanks I look forward to.
Mmmm, this is in contrast with what you originally wrote :
ID4= heating mode (manual, auto, holiday)
Now you are saying that the allowed values are Program/Manual/Holiday. If you look at the code, currently when you set a HVAC mode, the main switch is turned to on, AND the related command is sent to DP 4. If you donât see the mode change it means that we are sending the wrong command (and as we are seeing, probably the it is case sensitive).
So, the challenge here is to develop the component such that it is usable for you AND general enough for other Tuya devices. Probably weâll have to define the commands as options like we have done for covers. In the meantime, please confirm that the modes you see (with tyadebug) are Program/Manual/Holiday.
What happens if you set âProgramâ? I donât know how HA is supposed to handle programming. Also the Preset thing is a bit tricky to setup, I have to do some thinkingâŠ
OK I got it. Previous ID were from tuya app (heating mode (manual, auto, holiday) just to show ID meaning). Now what I can exactly see in the tuya_debug log for modes is (âProgramâ,âManualâ,âHolidayâ). But I can understand its only for my case, general tuya device can be different from this. Yes it may be probalbly case sensitive beacuse it doesnt change mode. From Off state both buttons in HA card change it ON and to heating.mode.
Hi folks,
I have a noob question, how do you folks get the local_key? I have followed the instruction in:
without success. Is there a much easier way to get the local_key or am I out of luck?
Oh, I am also on Android and I used my Raspberry Pi4 to run the tuya-cli.
Thanks heaps in advance
Hello, this video helped me a lot!
Try it.
I got the following logs:
devices 192.168.1.109 and 248 are 2 identical zemismart covers.
@Alloc186 OK I have something in mind but will take some time to code it.
@juan11perez sorry I was not clear enough with what I meant with âtuyadebugâ. I mean to download tuyadebug.tgz from the main page of localtuya integration, unzip it and launch the test.py script with the correct parameters for your device, for example:
./test.py device_id device_ip local_key
This should return the current status of the device (the list you get in the DPs drop-down menu). Launch it in the 4 situations you posted before so we can see whatâs going on.
The only thing is that you are getting connection errors so maybe youâll get a connection failure when operating with Tuya app because some devices donât allow multiple connections. In this case, when you try with the remote control, please disconnect your app (i.e., kill it or put the phone in airplane mode). Let us knowâŠ
thank you
to clarify Iâm running HA in docker. so do I run this debug from HA docker or any linux machne in the network will do?
I also am running HA in docker, you can run the script from outside the docker, or from any other linux machine. If you have configured the devices in HA, remove them or stop HA since it could not allow multiple connections.
I have hacked something together that you can try:
Itâs not tested as I donât have any light, but I hope it works. I believe the range is ok, but you might to have tweak at least the lower limit in case the light doesnât turn off at precisely 0.
Thanks, as soon as I get home I try!
Hi @postlund,
I tried the new code, but unfortunately it canât handle the bulb well.
When I bring the brightness to maximum it is unavailable.
Often the slider fails to vary the brightness of the bulb and when it starts working again, it makes all the single past variations. But this only happens if you change the brightness repeatedly, normally I never would!
Here are some errors:
âŠ
EDIT
Setting these values, it seems not to turn off when it reaches the maximum level:
DEFAULT_LOWER_BRIGHTNESS = 10
DEFAULT_UPPER_BRIGHTNESS = 1000
GREAT job, THANKS!!!
I noticed that this version is not the âpytuya_asyncioâ.
Could inserting those parameters improve the speed of changes?
Tomorrow I will try to report the changes occurred in the âRe-map light brightness rangeâ inside Convert pytuya to asyncio.
THANKS again MYTHICAL Pierre
Good Night
good day, so here it goes
stopped homeassistant and disconnected phone
Sounds great! Thatâs what I meant with âyou have to tweak the limitsâ. You should not change the code though, you can do that from from Options in Integrations (if you added via config flow) or by specifying brightness_lower:
and brightness_upper:
.
We will likely merger the asyncio branch today, that should likely make the updates instant as well.
There we have it. You should probably use ZZ
to as close command and FZ
as open command.
Thank you. So something like this
def open_cover(self, **kwargs):
âââOpen the cover.â""
_LOGGER.debug("Launching command %s to cover ", self._ZZ_cmd)
self._device.set_dps(self._ZZ_cmd.upper(), self._dps_id)
?
More like:
def open_cover(self, **kwargs):
âââOpen the cover.â""
_LOGGER.debug("Launching command %s to cover ", "ZZ")
self._device.set_dps("FZ", self._dps_id)
And corresponding to close. @rospogrigio can then add this command set after you have verified that it works.
âŠI remember someone asking: âhow many different commands could there be???â
I could expect some numeric command but I would have NEVER imagined something like FZ-ZZ
OK I prepared the PR : https://github.com/rospogrigio/localtuya-homeassistant/pull/81, please try it @juan11perez and review it @postlund .
No, thatâs kinda ridiculous I believe DPS above 100 are custom DPs by the vendor, so I guess the vendor decided this was good. Maybe it maps to some other system or old standardâŠ
Yeah, this device is rather peculiar. Also, itâs the first one that does not even provide DP 1⊠very weird.