Thursday, July 10, 2025

How to connect Tuya device to Node-Red

Here is the process how to get Device ID and Local Key for Tuya device.   

  1. Create a Tuya Developer Account
    • Go to https://iot.tuya.com and register for a developer account. 
  2. Create a Cloud Project
  3. Link Tuya App Account
    • In your cloud project, navigate to the "Devices" tab and select "Link Tuya App Account." You'll typically scan a QR code with your Immax NEO PRO app (or Tuya Smart/Smart Life app) to authorize the link.
  4. Get Device ID
    • Once linked, your devices from the app should appear under the "Devices" tab in your cloud project. Note down the "Device ID" for each Tuya device you want to control. 
  5. Create API Subscription
    • Go to "Cloud" > "Cloud Services"
    • Subscribe to
      •  IoT Core Services
  6. Still within the "Cloud Services" section, after subscribing, click on "My Service"
    • For each of the services you just subscribed to, click "View Details"
    • Go to the "Authorized Projects" tab 
    • Ensure your specific cloud project is listed and authorized here. If not, you may need to click "Add Authorization" and select your project.
  7. Get Local Key
    • Go to "Cloud" -> "API Explorer."
    • Under "Smart Home Device Control" (or similar), look for an option like "Query Device Details in Bulk" or "Get Device Specification Attribute."
      • Device Management > Query Device Details 
    • Input your Device ID and submit the request.
      • The "Local Key" should be in the JSON response.

 

 

Tuesday, July 8, 2025

Home LAN (Cat5e vs WiFi) network throughputs

Home LAN zones

  • Area 1: 10+ Gb
    • VMware Virtual Network within single VMware ESXi hypervisor
      • physically unlimited network, limited only by software and server hardware
  • Area 2: 1Gb
    • 1 Gb LAN over Cat5e structured cabling
  • Area 3 : WiFi 5 (802.11ac)
    •  Amazon eero Mesh (core AP)
      • Gateway eero 6 (2nd Floor - work room)
  •  Area 4a : WiFi 5 (802.11ac)
    •  Amazon eero Mesh (AP extender connected to core AP over wireless back-haul)
      • eero 6 Extender 1 (1st Floor - living room)
  • Area 4b : WiFi 5 (802.11ac)
    • Amazon eero Mesh (AP extender connected to core AP over wireless back-haul)
      • eero 6 Extender 2 (1st Floor - guest room)

Network Devices 

  • 192.168.8.11 wired connection @ Area 1
    • iperf server on VMware VM with FreeBSD 14.2 in home lab rack
      • VMXNET3 
  • 192.168.8.12 wired connection @ Area 1 
    • iperf client on VMware VM with FreeBSD 14.2 in home lab rack
      • VMXNET3 
  • 10.0.4.214 wired connection @ Area 2
    • iperf client on MacBook Pro (13-inch, 2016) with MacOS Monteray (12.7.6)
      • 1 Gb USB NIC
  • 10.0.4.74 @ 802.11ac wireless connection @ various Areas
    • iperf client on MacBook Pro (13-inch, 2016) with MacOS Monteray (12.7.6)
      • WiFi 802.11ac (Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1710.4)

Network Throughput Methodology 

Server @ Area 1 (192.168.8.11)

  • iperf3 -s 

Clients @ various areas 

  • upload
    • iperf3 -c 192.168.8.11 -t60 -i5 -P4
  • download
    • iperf3 -c 192.168.8.11 -t60 -i5 -P4 -R

iPerf Throughput Tests

Throughput within Area 1 (192.168.8.11 <---> 192.168.8.12) 

  • Expected Throughput: 10+ Gbits/sec 
  • Upload: 13.8 Gbits/sec
  • Download: 13.8 Gbits/sec

Throughput between Area 1 and Area 2 (192.168.8.11 <---> 10.0.4.214) 

  • Expected Throughput: 1000 Mbit/s
  • Upload: 790 Mbits/sec 
  • Download: 932 Mbits/sec

Throughput between Area 1 and Area 3 (192.168.8.11 <---> 10.0.4.74) 

  • Expected Throughput:
    • ~200-300 Mbps for single-stream devices
    • ~500-700 Mbps for devices with 2 or 3 spatial streams in good conditions
    • In optimal conditions, with high-end devices and close proximity to the router, speeds can reach ~900 Mbps or slightly higher, approaching Gigabit Ethernet speeds. 
  • Upload: 532 Mbits/sec
  • Download: 651 Mbits/sec

Throughput between Area 1 and Area 4a (192.168.8.11 <---> 10.0.4.74) 

  • Expected Throughput:
    • ~200-300 Mbps for single-stream devices
    • ~500-700 Mbps for devices with 2 or 3 spatial streams in good conditions
    • In optimal conditions, with high-end devices and close proximity to the router, speeds can reach ~900 Mbps or slightly higher, approaching Gigabit Ethernet speeds. 
  • Upload: 97 Mbits/sec
  • Download: 126 Mbits/sec

Throughput between Area 1 and Area 4b (192.168.8.11 <---> 10.0.4.74) 

  • Expected Throughput:
    • ~200-300 Mbps for single-stream devices
    • ~500-700 Mbps for devices with 2 or 3 spatial streams in good conditions
    • In optimal conditions, with high-end devices and close proximity to the router, speeds can reach ~900 Mbps or slightly higher, approaching Gigabit Ethernet speeds. 
  • Upload: 78 Mbits/sec
  • Download: 114 Mbits/sec