With a Raspberry Pi gateway, you can collect data from RS-485 devices such as temperature and humidity sensors and door sensors to achieve remote control of relay actions.
Python3.0
PyCharm 2021.2.3
new_temp_hum_door.py
Two demos are used to build a Raspberry Pi gateway. One demo in Python works for communication with RS-485 devices. The other demo in C works for communication with the Tuya IoT Development Platform.
Download the demo (in Python) at: https://github.com/Tuya-Community/485_sub-devices_connect_to_the_Raspberry_PI_gateway.git
Download the demo (in C) at: https://github.com/Tuya-Community/Raspberry_PI_Gateway_connects_to_iot_platform.git