I have Tuya wifi door sensors that typically works with cloud ,but in my case I do not have internet (country house) . So I plan to use ESP32 as soft AP and default GW to capture the packets sent by the sensors. The issue I am facing and looking for advice is how to interecept the packet to the cloud and make the sensor think that the cloud is responfng when it is actually the ESP32 .
I monitored this with wireshark at my home(with internet) and noticed that the sensor when triggered sends TCP connection to an IP add that belongs to AWS and then TLS hello and server done packets.
The TLS part I am not so concerned, since I have the keys and similar project has been done here EspTuya/readme.md at main · FrBerger83/EspTuya · GitHub
,but in that case they use to control Tuya devices (like switches) and the sensor behavior is different .
To confirm: the arrangement you have will not be connected to the internet, yes?
To be clear I don't know the answer but if this were my project, given there is no internet connection then you are free to allocate any IP address you like on the local network, you are not restricted to ranges reserved for local networks. So, configure the subnet to include the AWS address the Tuya device sends to and put your code at that IP address.
Xfpd, this is not my scenario,since what you posted is ESP32 <=> ESP32 and in my case, i have Tuya sensor <=> ESP32 . Thanks anyway .
Actually there are some integrations with Home Assistance App, called local Tuya , but that requires minimum raspberry pi and was looking some simpler and cheaper.
Yes, you are rigth . On final destination will not have internet, so yes, your suggestion is pretty simple and great . My only concern here is that for the first time I need to register the sensor with cloud . So, right now the sensor (has been already registered) has a private IP address , and when moving to the field,was planning to have same SSID and pass like now at home ,so the sensor would not see the change.
cheers,martin