Best way to configure WiFi Tuya sensors?

Sure ?
I thought, to solve my problem, to buy a hub Matter / Tuya
Wrong idea ?
Here again I’m lost …
All hub that I look for seem to need Tuya app …
Have you got some advises ? Some hubs to buy ?

Wi-Fi . :slight_smile:

Really ! WiFi is WiFi ?
I’m not asking about lower layer (OSI 1,2,3), but upper layer (OSI 4,5,6,7) …

As BT is not necessary Zigbee …

Zigbee is based on the Institute of Electrical and Electronics Engineers (IEEE) Standards Association’s 802.15 specification. Zigbee is built for control and sensor networks on the IEEE 802.15.4 wireless standard for wireless personal area networks (WPANs).

Wi-Fi technology is based on the IEEE 802.11™ series of wireless connectivity standards

Bluetooth is managed by the Bluetooth Special Interest Group (SIG), The IEEE standardized Bluetooth as IEEE 802.15.1 but no longer maintains the standard.

As Franccis has pointed it out already:

Although Zigbee and WiFi are both working on the same 2.4GHz band don’t get confused: They are using different protocols (Zigbee vs. WiFi).

Hence they can not communicate with each other and there is no interoperability between those two protocols.

As for the Zigbee protocol you have to use a Zigbee hub/Coordinator (like the Conbee) and for the WiFi based devices you obviously need a WiFi network. Don’t compare apples and oranges, they are different things.

As Hedda has already pointed it out further up you really should dig deeper into the different protocols used by all sorts of IoT devices you plan to implement until you get at least some basic grip on each of them.
Otherwise it will bring you only frustration (besides it gets hard for the helping community here to support you if you don’t even understand the very basics of those different protocols). HA is still a DIY project after all and expects the user to have some basic knowledge of the latter.

1 Like

No … don’t work …
As I said :


I have a WiFi network, I know all them IPv4
My HA is on the same network.
Then, I thought to use them directly (without cloud)
I never had answer to my title : “Best way to configure WiFi Tuya sensors ?”

I toke time because I had to learn how to use Python … :smiling_face:
Great ! :+1:
I finally have Local KeyS (I thought only 1 by home)

But Local Tuya seem unable to integrate my sensors :frowning:

Sensor :
IP = 192.168.1.57
Device ID = bfbe90ad2493d662bb3diy
Local Key = Hnui>I(=W6u)ECQg

ERROR (MainThread) [homeassistant.helpers.dispatcher] Exception in async_discover_device when dispatching ‘tuya_discovery_new’: ([‘bfbe90ad2493d662bb3diy’],)

KeyError: ‘bfbe90ad2493d662bb3diy’

Every MilliSeconds :
ERROR (MainThread) [homeassistant.components.sensor] Platform tuya does not generate unique IDs. ID tuya.bfbe90ad2493d662bb3diyva_temperature already exists - ignoring sensor.temperature_and_humidity_sensor_n07_temperature

ERROR (MainThread) [custom_components.localtuya.config_flow] Unexpected exception: [Errno 113] Connect call failed (‘192.168.1.57’, 6668)

OSError: [Errno 113] Connect call failed (‘192.168.1.57’, 6668)

If a WiFi based product does not use the Matter standard then they use their own propriatory protocol (or implement a propriatory protocol from someone else like example Espressif), and that works basically the way for practically all commercial hubs/gateways/bridges. Home Assistent does not know what protocol they use to communicate with its devices as they all abstract that away and instead present their own custom API that third-party applications can integrate with.

Tuya is so large that their WiFi-based products use their Tuya’s own propriatory protocol(s) for communication between their devices and their hubs, then their hub offer an open API which third-party applications like Home Assistent’s Tuya integration can use without having to know what protocols the Tuya hub uses to control its devices.

That means; unless the product clearly state that it is using a standard protocol like Zigbee, Z-Wave, or Matter, then there is no native integration for Home Assistant and you will therefore more than likely need to use the manufacturs own hub/bridge/gateway.

Not sure what you mean. Bluetooth is never Zigbee, and Zigbee is never Bluetooth. Again, you should really research this a little more.

1 Like

By the way, I asked a forum moderator to move this away from the Zigbee forum because your main question was about Tuya WiFi sensors. You posting in the wrong forum and not separating post for each separate product might also be why you not getting better answers. Suggest you post new separate threads for each different type of products.

2 Likes

Ok, thank you.
Right, now I understand that’s not a Zigbee question.
Just a Tuya question.
I made the amalgamation between Zigbee and Tuya.

(P.S. : I don’t see Tuya forum … because it’s an addon ?)

There is not a dedicated Tuya forum because it is not a standard. There is however a generic ”Configuration” forum (where this has now been moved to), and it is when you need a propriatory hub, like Tuya’s hubs. FYI, is also a forum for ”Third-party integrations” for when there is no integration yet in Home Assistant Core.

Anyway, if need help with the native Zigbee Home Automation (ZHA) integation or connecting Zigbee device to the ZHA integation then recommend post a new separate topic in that forum for each Zigbee product

PS: Note that the Zigbee Home Automation (ZHA) integation is among the most popular integrations for good reasons, but also note that Tuya integration is popular because Tuya sell a lot of hubs and devices:

Nice.

And there is one individual key for each Tuya WiFi device. Which means as for multiple Tuya devices like sensors etc. you’ll have multiple keys, each assigned to an individual device (don’t mix them up).

Looks like you already have successfully added that “temperature_and_humidity_sensor_n07” using the Tuya integration. You can not add the very same device to the Tuya integration and to LocalTuya at the same time.

Remove “temperature_and_humidity_sensor_n07” from your HA Tuya integration and only then you can add that sensor to LocalTuya.

I have this kind of error every millisecond during 400 milliseconds.
This sensor was removed from HA and from SmartLife.
I will wait to receive a new sensor to test again to be 100% sure.

After LocalTuya, I tryed with tuya-local, unable to connect :
WARNING (SyncWorker_8) [custom_components.tuya_local.device] Test protocol error 901: Network Error: Unable to Connect

N.B.
When I test sensor connection with SmartLife, that also never connect with battery sensors (connect with a powered sensor)
Maybe because LowPower state ? (connected only very short time)
I Also will redo all tests with this powered sensor.

As I understand, I no have Zigbee sensor :frowning:

Should I use a Tuya hub ?
HA => ZHA => Combee3 => Tuya hub => all my sensors
But that would be possible to integrate new sensors easily by HA ?

How does this fit together? :thinking:

The ConBee III Stick is a universal Zigbee USB gateway and has nothing to do with Tuya WiFi.

HA <==> Your WiFi Access Point(s) <==> all your Tuya WiFi based sensors

You should uninstall the ZHA integration and put away the ConBee dongle until you have actually bought some Zigbee devices. ZHA integration is only for Zigbee devices, and a ConBee radio dongle are also only for Zigbee devices. Thus if you do not have any Zigbee devices then there is not yet any point in you using either or those, as you can only use those if and when you have Zigbee devices. And understand that ZHA and ConBee has nothing to do with a Tuya hub. Tuya hubs only use the Tuya integration, regardless of what type of protocols the devices connected to it are actually using.

You can connect all Tuya devices to newer Tuya hubs (read model specification what protocols each different Tuya hub supports, some
Tuya hubs even sypport Tuya branded Zigbee devices however it does then still use the Tuya integation and not the ZHA integration). If you use ZHA and ConBee the it can only connect Zigbee devices, so only if your Tuya devices are using Zigbee can you use ZHA and ConBee. Understand that Tuya do not just make Zigbee devices but instead makes various different variant of the same or similar products that use different wireless protocols, and some may use Zigbee but other use WiFi, Bluetooth, or Thread, and for nieter or those can you use ZHA or ConBee. This means that you can not blindly buy a Tuya product and expect it to use Zigbee or any other specific protocol.

Again you need to do a little more reading yourself. Read the ZHA integration documentation, at least the introduction and the section about what (Zigbee) devices are supported.

Zigbee

It was my question !!! How to do it ???

Again, I read …
Just sometime you don’t understand my mind …
Combee3 => Tuya hub seem logic
Tuya hub => all my sensors seem logic
I said nothing else … Just asked if possible without cloud …
Almost all seller sell hubs in saying that “by this, no need cloud” …

Now that I have Device IDs & Local Keys
I tried again with a very new another sensor :
_ Tuya Local
It find itself Device IDs & Local Keys !
But still unable to connect the sensor
_ Local Tuya
Hundreds error as previous sensor
ERROR (MainThread) [homeassistant.helpers.dispatcher] Exception in async_discover_device when dispatching ‘tuya_discovery_new’: ([‘bfa9c81c254cf10223zgym’],)
KeyError: ‘bfa9c81c254cf10223zgym’
Every MilliSeconds, something like :
ERROR (MainThread) [homeassistant.components.sensor] Platform tuya does not generate unique IDs. ID tuya.bfa9c81c254cf10223zgymva_temperature already exists - ignoring sensor.capteur_de_temperature_et_dhumidite_temperature
ERROR (MainThread) [custom_components.localtuya.config_flow] Unexpected exception: [Errno 113] Connect call failed (‘192.168.1.61’, 6668)
OSError: [Errno 113] Connect call failed (‘192.168.1.61’, 6668)

Then, I will close because IMPOSSIBLE to have my Tuya sensors without cloud … no way, impossible
We tried all during 1 month here …
_ Sensors are not Zigbee
_ No Tuya Local, no Local Tuya
_ Seem no hub possible

this is quite a long thread, and i think there is some unneeded confusion. hopefully i’ll try to clarify… at least for anyone who might try to make sense of this in the future… and minimize false information.

many folks are pointing to zha/zigbee (conbee3) but i believe @Goood purely has wifi tuya/smartlife devices. so everything regarding zha/zigbee is irrelevant unless someone is recommending/asserting that @Goood should toss the existing devices already purchased and start over (which i personally don’t think is necessary). zigbee has nothing to do with wifi other than they happen to use the same radio frequency range and interfere with each other sometimes.

if you have wifi tuya devices, you don’t need any hub or any other accessory as long as you have good solid wifi connectivity.

localtuya supports a lot of sensors, but not all sensors. i don’t know what sensors you have so i can’t attest whether localtuya does or doesn’t support them, but even if it doesn’t have native support, it’s usually possible to get it at least recognized and somewhat working (heck, just did an oil diffuser!)

@Goood has asserted that it’s impossible to get local key (but later figured it out). and asserted it’s impossible to get the client id (which it’s not) and it’s impossible to have tuya sensors without the cloud (which i don’t believe is true either). [yeah, i’m minimally helpful because i’m not too interested in going into it given the tone so far.

but hopefully if anyone decides to continue to work on this question (or another day when i have my patience reserve refilled), the right path is just to get localtuya working.

Battery based sensors are difficult to connect to local tuya, but not impossible. The problem is, they are asleep most of the time, and only connect to to Wifi a short time when they are triggered.
So you need to trigger them while trying to configure them, a painful job, but not entirely impossible.

1 Like