Local Control of Tuya Devices // No Cloud Needed // LocalTuya
Vložit
- čas přidán 24. 07. 2024
- Today we take a look at the LocalTuya project for Home Assistant. this really cool project will allow you to locally control your Tuya based devices either by using a developer account or manually grabbing the security keys.
This means that at the minimum all you need is to allow your Home Assistant instance to talk to the to your cloud but your devices do not have to.
I take you through the background of the project, how to get your developer keys, and setting up a few example devices.
Let me know if this works for devices in the comments.
❓What future topics would you like me to cover??❓
▶ Buy Me A Beer 🍻: www.buymeacoffee.com/ThisSmar...
▶ Have A Question? Join Our Discord ⁉️: tshouse.link/discord
▶ Timestamps ⌚:
00:00 - Opening
00:19 - Project Introduction
02:22 - Tuya Developer Keys
05:15 - Set up Local Tuya Integration
07:18 - Add Smart Switch
09:26 - Find Device PD_IDs
12:31 - Add Fan / Light Combo
15:35 - Closing
▶ Product Links: (When available, we use affiliate links and may earn a commission!)
Tuya Based Fan/Light Controller - amzn.to/3ta1Hir
My Main Home Automation Gear (Kit.co): tshouse.link/homekit
My Z-Wave Home Automation Gear (Kit.co): tshouse.link/zwave
▶ Links in Video 🔗:
Tuya Developer Portal - iot.tuya.com
How to Find DP_IP - tsh.li/tuyadpid
LocalTuya GitHub - tsh.li/localtuya
▶ Get a One-Month Trial of Great Music for Creators (This is where I get my music and sound effects): tshouse.link/sound
▶ Website: thissmart.house
▶ Recommended Playlists:
Smart Home 101 (Basics): • How to Wire A Smart Sw...
Home Assistant Add-ons: • Severe Weather Alerts ...
#localtuya #tuya #automation #localcontrol #smarthome #homeautomation - Jak na to + styl
If you are still struggling to get your DP ID. Check out the updated guide posted by the Zigbee2MQTT project here: tsh.li/tuyadpid
Feels like this is made intentionally complex. Why is't there some autodiscovery or fetch-from-cloud feature of devices and values and whatever. A bad joke. And I'm an IT guy...
This video helped me a lot! I've been trying to add in my Smart Life devices since I got my HA a few months ago, but never got around to it. Without needing a HA Cloud account and fees, this solution seemed too good to be true. After watching both of these videos (including creating the dev account for tuya) I got both my devices into HA and are working flawlessly with no cloud account need or extra $$$! Now to try and experiment with some automation with the new Tuya switches (turn on lights) and my Ring camera when it senses motion. Thanks again!
"This is not your email address"....the most useful words I've heard this year. Thanks!
Well I am glad to have helped!
Well done your video is one of the best for local tuya setup ... I only needed a refresher as its been a while and it was perfect with all the new updated info too Thank you
This video is clutch for me as I’m just starting with HA. Thank you for making it. I have the Feit Costco switches and they work great through this integration. Also I set them up as a light not a switch to get dimmer control. I had the localTuya set up before but could only see the device ID not the name. After adding the Device Query Log and using the UUID instead of a user I had added, I could then see the Name of the device and all of the info for the device was auto populated. Find the “code” was also key especially for color lights (also Costco) and some guys based fans.
This is a great new resource for Local Tuya. I set up mine a couple of years ago before some of these resources were available (or they were more limited). Mine was done by guesswork and trial/error.
Thanks - this is very useful. Well done. I might have to reconfigure some of my devices to make sure I am getting everything I need. I have cut mine off from the internet and they are all still working as expected, although the Zemismart wifi blinds are a bit hit and missing with their position reporting.
I wanted to make sure I found a definitive way to figure out the IDS. I wish they would just list them in the developer portal. So glad it helped!
OMG you're a lifesaver!! There was absolutely no way I was going to be able to decipher the codes from my new Tuya Range Hood. Thanks bro!
You are so welcome!
Great video, you finally helped me fix an issue that was stopping my Tuya lights working with scenes in HA! Hours of frustration fixed thanks to your Dev. Tools tip in the Browser! Thank you!
Super useful. I was ready to write my hardware off until I found this video. Many many thanks 🙏
Dude! Thank you so much. Finally fixed my smart plugs for my night time automation with help from this video.
Yikes, that background music is WAY louder and BOOMY that it is in Premiere (my video editor). Sorry about that! I have started using less background music and also using a different method to blend. Thank you for the (mostly) constructive feedback!
Yeah with current hardware there is NO need for background music, if we want music we multitask and put our own on. ;-)
Just put ASMR in the title and have even more viewers. hahaha Thanks for the info anyway!👍
Couldn't you have re-mixed the audio and re-uploaded?
Outside that... I tried the Local Tuya integration. Got it working initially (kinda). RGBW lights would turn on/off but couldn't adjust color... no color picker available in HA. Ha! Then found I needed to add in a bunch of totally non-obviousl variables when adding in each device. I edit the lights, but... hey, each light is disappearing when I do so, or the device hangs around but the entity disappears. What the what? I delete the Local Tuya integration, re-install, and try again. Now one of the lights is no longer in the pull-down list for devices to add, can't get to it. Well, what's up with that?
In the end, the more I tried to fix things, the worse it go. Removed Local Tuya from HA and installed Tuya and that worked... with a bit of lag but 80% there. The local Tuya was just buggy. Dunno why the values for those codes for device attributes is *way* too manual. I do appreciate that you provided a method, however circuitous, to get a definitive value.
Nope because then you lose all of the views and comments on the video....
Why do you need background music at all? It's just annoying. It doesn't add anything whatsoever to the quality of your content.
If your read the original comment, I had already addressed this... I don't even use music anymore
Thanks for the video. it was VERY helpful and got my switches set up.
Thanks Man, I could not undertand any documentation and I was stuck on User ID. Saved me ❤
Thank you, your video helped me to figure out how connect my tuya devices and start to explore the IoT world!
Great to hear!
Great video! Clear explanation, helped me a lot! Thanx!
u are awsome !
searched for a solution for local network command to my Tuya devices for ages
The tip with how to obtain the ID is great. Thank you!!!
Hi and thank you for the great tutorial. Can you update on the current status of your Local Tuya? I ask as there is an update for Local Tuya 5.0 in HA. Have you had any issues with devices failing, or not responding?
Thank you for this tutorial!
I was about to give up to set up my plug with HA.
Thaaanks!!!
Glad I could help!
2024 still working. Thanks for your help and this method!
Excellent video with some neat tricks (such as ID debugging) that will surely save me hours of pulling my hair out.
Question: Once locally integrated, will I be able to set firewall rules to prevent my Tuya devices from phoning home to motherland after setup? Or does it still require periodic internet to resume function.
This video us a MUST ! Thanks a lot as it helps understand how to set it UP correctly for all the entities. 👍
Thanks for this! Quick question before I start. After implementing this, can I/should I delete the Tuya cloud integration, both in HA and in Tuya, should I do this in a particular order?
I have some tuya slider blinds that I can add to local tuya but for whatever reason I can't use the open/close buttons I can only use the position slider. I've tried every combination of IDs I can think of and it just doesn't work.
Hi, thank you so much for your tutorial. H've a question. I've a combo fan+light like you. I have configurated weel in home assistant. For the fan, when I use the remote I have the fan speed in home assistant that is correctly updated (16% 33% ... 100%) for the 6 speeds. BUT when I want to change the speed from home assistant i've ONLY 50% (i i set 16% it slider go to 50% same for all speeds). Any idea ?
Still working.
Great Job! Thank you
You're welcome!
This is fantastic. Thank you
This video is fantastic!
Why thank you!
works perfect, thanks! Can you add support for IR controller which control my AC?
Thank you for this. I added a Smart plug with this method. However, I can't add the power consuption to the energy energy tap because I can't find the entity. How can I fix this?
This is so useful! Kind of a pain to get setup but once its setup its great! I was able to take some "dumb" strip lights, get a tuya controller, set it up in Tuya, then connect it to Home Assistant with Local Tuya. That opens the door for so many other projects. Thank you for this video!
Nice vídeo, 15 days ago I was looking for videos to setup localtuya and all the popular ones poping up in the searches were a bit outdated
I am glad you liked it. It is all thanks to my neighbor, the video was on my list but he asked about it for his new lights. So I decided to get it made!
I find this hilarious. I understand that Dexter said Do not press that button! ... but that was a cartoon 😂 ohhh that blackberry keyboard i miss it soooo much
How to make pull-requests from the devices?
I have a Tuya Smart-Meter-Plug, the switch works well but the sensors (current, voltage, power) don't update often (only around once an hour). Only when I have the TuyaApp open on my smartphone it updates frequently (like all 5 seconds).
Is there a way to make HomeAssistant pull the sensor values like e.g. all 30 seconds?
Thanks for this video. I decided to reinstall homeassist and the way I use to get the id's doesn't exist anymore. You have saved me many hours of struggle!
So glad I could help!!!
The request tab seems to be missing in Chrome Developer Tools for me. Tried with both Brave and Chrome.
Awesome tutorial! Thank you for the methodical step by step! But what if I’m from South America? Are the only options EU, US, CH and IN? 6:27
Thanks for the video, I followed exactly what you did. There is only one bug, when I change the slider of the fan speed nothing happens, my fan the same you have 3 speed level.
Can you help?
Thanks
I tried LocalTuya a couple of years ago and had some problems with devices not showing up as available to integrate. Has the integration improved since then?
Thank you so much!
Thanks for this video. Very clear.
But no, the same question as other, I think. How do you manage the change in the policy in Tuya ? Is it possible to do the same without paying for their iot platform ? Is it needed to create a new account after the one month ? Every advised are welcome.
Thank you so muchhh dude !!!!
Glad the video helped!
Hi, should there be any changes in the process? I follow your steps and tuya says that "Smart Home Scene Linkage" and "Device Log Query" are [Deprecate], maybe there are some updates?
Nice video. My account on tuya expired and now get after scanning the QR code: The number of projects linked with this Tuya Smart App account has reached the upper limit of 2. Unlink the account from existing projects and try again.
Any tips to get the needed keys?
thanks a lot
my problem was uid and you solve it with your note
thanks thanks thanks
❤❤❤❤❤❤❤❤❤❤
Hi, what happens if my Tuya trial account expires and I buy a new Tuya device after that ? Can I still get the device ID for the new Tuya device ? Can I still setup/configure the new Tuya device when my Tuya account is expired ?
how do you manually add device ? because they are not discovered on the network ( but you do have other device )
Hi! Do both "Tuya" and "Local Tuya" integrations work at the same time on HA/ZHA? Or should I disable/uninstall my current "Tuya" integration, before using the "Local Tuya" one? This question because I may need several weeks before finishing the process on all my devices, and don't want to lose control on the devices which are currently working, while I am switching the other ones, one by one, from cloud to local. Thanks!
You can use both. You will just have double the devices.
I will be using the TUYA APP for a EVERSECU SECURITY CAMERA. My last camera wanted me to subscribe to the Cloud Service in order to view video from the camera. My question is, Will I have the same problem with the Tuya App. Thanks..
The console let's me select the Device Log Query but it says it's deprecated. What's the alternative once they remove it from the console completely?
Thanks for the video. But I cant see the Hacs section on the side panel. Also cant find the local tuya integration. Just the standard tuya. Have they updated the HA platform? How can I find them
LocalTuya won't show up if you didn't install the integration in HACS. If you're missing HACS on the side panel you may not have it installed under integrations. If you're using the Docker install of HA I don't think HACS is available on it.
I've been running the Local Tuya integration and the devices respond nearly instantly...when it works. The integration seems to break often, needing constant reloading, which I've set up through an automation. However, there are times in which the reloading causes a need for Home Assistant to restart for the integration to reload. Anyone else experience this? Any thoughts on how I can fix this issue?
Is it possible to integrate Tuya with Hubitat?
Why the heck do you play that noise while you're talking?
Are you talking about the music? Or the SFX?
@ThisSmartHouse your music volume is so high that its distracting from your voice over.
I have been working on dialing it in. Everything sounds balanced on my studio speakers but I realize it isn't the same on all. Thanks for the helpful feedback.
@@ThisSmartHouse both ;)
Yikes people are very opinionated about sound... I've been working on improving them in later videos.
Can I have 2 Kerui Alarms on the same router and access either with the same phone?
I have a set of smart curtains/blinds that I set up in local Tuya, but I can only open or close them, I can't set their position. This would be fine normally, but the automations only accept position inputs so I can't have it open and close automatically. What am I doing wrong?
Were you able to add any additional PD_ID's for the position? I would assume it works light brightness on lights. There should be another value in the dev console for the position of the cover.
Great content as always.
Can I give some constructive feedback. Background music is the bane of my life. If your hearing is not 100% it can make it a real struggle to pick out the narration. I'm not anti atmospheric music as such and your video deals with it well as it is just added to intro / exit chapters. For me if it was a touch quieter it would add ambiance rather than an audio distraction.
I've followed your channel for about a year now and really appreciate your videos. They are easy to follow and packed with great information. You have covered many of the topics that interest me with HA and I look forward to future videos.
~Brian
Thank you Brian, I appreciate the feedback and I hadn't looked at it that way. I try and use the music to keep the pace going through slower sections but it makes since, I don't want to muddy the message. I typically let Premiere duck the music and then push it down another 3 to 5 db. In the future I will be more cognisant of this and either reduce the use or use more filters to make it easier to hear.
Thank you again!
Have you tried turning on captions and then displaying the transcript? Can help sometimes. Captions are the gear symbol, transcript is the three dots on right of the download command.
Hi, thanks for this, the device log query is now deprecated, which one should we use?
Yeah same here. I went ahead anyway and added my devices locally following this approach -- worked for all 5 minutes before they dropped / greyed out -- "this entity is no longer being provided by the localtuya integration." Deprecated: feature that is tolerated or supported but not recommended". Clearly not the case here.
obrigado por compartilhar conhecimento!
You are welcome! Thanks for watching. (De nada! Obrigado por assistir!)
When I restart localtuya integrations all devices become unavailable, they only show their values on status change. How to make the update automatically??
I’ve gotta say the new beta Smartlife makes this an utter breeze now . Appreciate this is older now in this fast paced integration world
Hi, thanks for a grate video! Does this local tuya survive the expiration of the free iot core license from iot tuya?
The way the integration works is every time it's restarted it pulls your keys from the dev console. So unfortunately it will fail when starting up if your account expires.
You can probably set it to not automatically pull the keys but you will have to find something once those keys expire.
I'm looking into alternate ways for the folks who are getting kicked out of their Dev accounts.
Hi, I tell you that I've been going crazy for days, I wanted to integrate my alarm system already working with Smart Life into a home assistant!
I have already installed other roller shutter devices with local tuya (cover entity) by putting name, host ip, device id, and local key.
Doing the same thing with the control unit I can't understand which entity to choose, I used switch with the first id value:disarmed (only disarmed makes me choose), and obviously when I save it only makes me deactivate the alarm! How can I also give it the arm activation command? The problem is that if I go ahead and choose another entity localtuya no longer shows me the id 1 but goes forward to other boolean information, everything is in the first Id! I would be really grateful if you could help me !
master_mode Enum
{
"range": [
"disarmed",
"arm",
"home",
"sos"
]
}
When I tried to add local tuya integration:
Failed to retrieve device list. Error 28841002: No permissions. Your subscription to cloud development plan has expired.
Hi am having a problem when I scan the QR code amd hetting this message
"Data centers inconsistency, App account cannot be linked. Please select the data center matching the App account in the upper right corner of the page. If you are unsure of the data center for your App account, please refer to the App Account Data Center Distribution"
I have the "Device Log Query" added and it say in service. I also choose estern amareica and in the app I have NY/america
What am missing?
Hello, how can I integrate a TUYA curtain switch. If I integrate it as a normal "switch" I can only drive the curtain upwards but not downwards. Or is it not possible to integrate a curtain switch at all? Greetings from Germany.
Try configuring it as a "cover", I got better progress with that
Have you managed to get any bluetooth hubs in? I'm finding that to be a brick wall despite it showing as supported.
I don't have any Bluetooth Tuya gear, sorry.
How do you add devices that are on different vlans where they don't pop up on the configure screen?
I haven't tested multiple vlans with this project. Can you just type in all of the manual data?
Hey, Just a quick question. So swapped from Tuya Cloud to Tuya Local after 1 year am i going to need to go back to to Tuya IoT and extend my project time?
I haven't gotten to that point yet. You might want to set a calendar reminder to check after a year.
With the Tuya Key Extactor: One of the devices is showing Nothing as Local Key (blank) . I repated the process more than 5 times and thats the only device it shows blank as Local Key
thx for the detailed video. Very helpfull. In chrome I cant find dat ID for the integration, none of the responses got code in it.
I just tested this a couple weeks ago and I was able to see the response. Are you using Chrome or another browser?
@@ThisSmartHouse Hi, using Chrome and found it somehow, thx.
Thanks!
Thank you Jure!
Great video, but there is a lurking problem. My roller blinds have stopped working as my Tuya Dev account 1 month free trial has expired. I tried to renew it but I am getting a message saying I have already used my maximum allowance of 1. Any thoughts?
They changed the accounts some time ago and removed the free tier. I was grandfathered in so I didn't run into this issue. Unfortunately there doesn't seem to be a good solution moving forward.
Can you teach another way to get the keys? I have problems when I make my account in tuya iot, I add the app smart home account, but it never appears, in the list of the Link Tuya App Account page. But if I add it to other projects, it tells me that it is already registered and has reached the limits.
So you have already created the Tuya Dev account and were able to link your device account (with the QR code)?
After the initial set up do I need to have an Internet or I can operate locally with Home assistant without connecting it to the Internet?
If you have the automated key checking enabled in configuration then it will require an internet connection each time home assistant restarts. Alternatively you can set everything up and then disable the automated checking and it shouldn't require an internet connection.
so can i connect my light bulbs on my laptop?
Hi, can you please advise ? My provider internet changes my IP every 2 months. ( I don't have a fixed IP) How do I change my IP in Tuya ? I am using Smart Life program on my mobile to control lights. I also use Lumiastream on my computer, which is not functional without Tuya. Thank you for your help.
I don't think that should matter. Your Tuya devices reach out and make the connection if you are using the cloud. If you are doing this project, then all of the traffic is inside your network (except for retrieving keys).
Hello, Thanks for the video, but my tuya account expired a few days ago, and I cant connect localtuya. Getting Error that my tuya account is expired. Is there any way around it? I sent application to extend trial period, and it's being reviewed, but so far no luck.
Same problem of me...
if I configure the device in Local tuya, I have to write HOST - What is it? device id - ok, local key - what is it?
Hey, worked well up to the QR code part, the Smart Home app says "Logging in "Non-Mobile devices", please make sure it was you" -- this is on an Android phone! When I click "Conform Login", I get "No Access"
I get the same. did you ever fix it?
Is it possible to pair tuya zigbee devices with other zigbee gateways such as HA and hubitat?
Yes. As long as the particular Zigbee hub / software supports it. Check out Zigbee2MQTT, they have a lot of devices supported (including Tuya Bluetooth).
Device Log Query is missing in the API Services list. What to do then?
I am following you all the way to the step where you need to use the Tuya iphone app to scan the qr code. WHen I do that I get a reply that i'm logging in as and there is chinese writing in quotes. I would expect that it would show my login account there. Is this normal or am I doing something wrong?
I changed my server to be western US and now it connects and shows all the devices as active. I add the TUYA Local integration and it now connects. For some reason, it does not show the previously connected devices. What might cause this?
Device log query is deprecated now, any other suggestion?
Is there a way to get Push notifications on my phone from e.g. a door sensor?
If you are using home assistant then it would be easy. The home assistant app can have notifications sent to it. Here is a reddit post with a quick how to: www.reddit.com/r/homeassistant/s/7RxAXCi0r2
So is this allowing me to use tuya app on my phone and Home Assistant OS simultaneously?
Yes it should.
If I implement this local Tuya solution does this mean that push notifications won't work remotely when I'm away from home ?
If you get push notifications through Home Assistant, then yes (where Home Assistant is notifying you of a state change). If you are wanting to get it directly from the device, then I think you still need the cloud.
how can i add a bluetooth sensor? I don't have an IP address.
Nice vídeo, I wanted to ask if it is possible to hub zigbee tuya?
I don't have a tuya Zignee hub but I've seen people in some of the discussion groups talking about it. You might want to check with the developer and see if it's possible.
In HACS, "install" seems to have been replaced with "download."
Good to know. They are always changing things. Thanks!
9:52 "make sure it is selected here on the left" when I select a device in the left side like you say I get this error toast: "no permission"
I did everything correctly and I get Login error (1106): permission deny. Im using Home Assistant 2023.5.3. Well, it actually worked with the account email address, the on I use on my app.
Thanks Thanks Tanks!!!!
hi,recently it stops working, and when i set my user id and secret in home assistant which i gather from tuya iot platform i get authentication failed ... have you experience this issue?
How long ago did you set it up? I know that Tuya changed the free tier to make it more annoying for devs.
For the one that live in Eastern area like me ( Montreal) choose Western instead before scanning the code with the cellular otherwise it will show you (0 device found) it took me a while to figure it out ; )
You sir are a GOTA. THANK YOU
Hello i have a problem, the tuya doesnt detect any devices therefore i have tu add it manually but i dont know the devices ip adress (Host) :/ where i can find it?
But what happens if my platform is NOT listed? I want to add a shutter\blinds but it does not show. What to do from here?
It may not be supported under the project. Did you check the GitHub to see if it's on the compatibility list?
This integration went pretty well for me, Plugs or Switches, But will only allow on/off for lights. It Will Not allow color changes or dimming.
Any ideas or suggestions?
Did you set them up as lights? Confirmed that you had the correct IDs?
@@ThisSmartHouse
Diagnostics download says
""friendly_name": "Bed 3",
"restore_on_reconnect": false,
"id": 20,
"platform": "switch"
"
SO where do I make the needed changes?
Thanks for your help..
BTW: Works perfectly on the Smart Life App on my Android Phone.
You'll need to remove the device and re-add it as a light. It looks like you added it as a switch which does not have the capability of controlling things like brightness or color.
Hi, can you create a video on how to set up HACS ? Thanks !
Waaayy ahead of you: czcams.com/video/wZLOTzpiELs/video.html
It is older but should be relevant.
hello all i got the entity's added from a wifi dualct clamp meter but cant get them to work in HAs power skreen do eny one know how to add state_class: on to the entity's i added them in dev tools but when the sensor s update the state class fals away agane