SMR-CZ-040W-WIF-16A-POW-US - Have 12 on Networks, but latest additions not seen #510
Replies: 8 comments 27 replies
-
This is the JSON from devices.json for the device that is not seen by the scan
|
Beta Was this translation helpful? Give feedback.
-
Hi @MarkCupitt, First, have you made sure the Smart Life app and any other Tuya implementations (LocalTuya, HomeAssistant, etc) are closed? A lot of devices stop broadcasting once a connection is established. What version of TinyTuya do you have? Have you tried running a force scan? If those don't work then does a scan with debug enabled show anything? |
Beta Was this translation helpful? Give feedback.
-
@uzlonewolf I noticed this in tinytuya scanner.,py, shodul I uncomment?
|
Beta Was this translation helpful? Give feedback.
-
Scanner.py, around line 182, Im wondering if teh empty version is forcing a "3.1" an dit needs a 3.5
|
Beta Was this translation helpful? Give feedback.
-
@uzlonewolf I have two Public Ip addresses, (2 Starlinks on a LB Router), I see the Fridge backup is on a 14.1.64.* address when I check teh network on teh app, nut the Fridge Main which tinytuya cannot see is on a 65.* network Im not sure how the UDP listening is configured, but there would be different gateways I guess COudl this be related?? |
Beta Was this translation helpful? Give feedback.
-
@jasonacox @uzlonewolf Yep, I actually had disabled wifi for my phone with Smartlife on it, and restarted all the devices. The pull request does address the 3.5 issue which was the root cause of my issue, and I accept that the devices are "different" and do something different with Broadcast packets. Ill adjust my use case to work with this approach as I will know the IP addresses and can access them directly. Im comfortable with that, so I would say the PR is Ok Thanks for the prompt fixes and responses, they are very much appreciated |
Beta Was this translation helpful? Give feedback.
-
Just FYI, my approach will be something like the following: Add New Device There may be a need to access the Tuya API directly for some devices, like sensors that only emit occasionally, I am still looking into this I will probably need another map file to keep this all together Once I am able to access all the known devices, I will poll them on specific intervals, with the interval determined by a value in the map file to get status and publish to MQTT for consumption in my Farm Management System I am doing this because I have Weather, Solar Inverter, and Battery Systems I also monitor via MQTT and want to build an integrated management system. I was using HA, but I have not found it to be too unreliable for my needs Ill likely share what I have done via PR's, Ill try an bundle it as a separate service, if any interest you will be welcome to include it in tinytuya |
Beta Was this translation helpful? Give feedback.
-
Just curious, if you run this in one terminal: import tinytuya
import socket
import time
bcast = b'{"from":"app","ip":"192.168.2.1"}'
bcast_port = 7000
bcast_to = '255.255.255.255'
bcast_idx = 0
bcast_cmd = 0x25
bcast_retcode = None
bsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
bsock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
while True:
bcast_msg = tinytuya.TuyaMessage( bcast_idx, bcast_cmd, bcast_retcode, bcast, 0, True, tinytuya.PREFIX_6699_VALUE, True )
bcast_data = tinytuya.pack_message( bcast_msg, hmac_key=tinytuya.udpkey )
print("broadcast encrypted=%r" % bcast_data.hex() )
bsock.sendto( bcast_data, (bcast_to, bcast_port) )
time.sleep(5) Does |
Beta Was this translation helpful? Give feedback.
-
Hi All, I have a bunch of Switches SMR-CZ-040W-WIF-16A-POW-US on my network. Up until recently, I have been seeing them in tiny-tuya.
I started adding additional switches last couple of days, SmartLife sees and controls them happily, they are in iot.tuya.com quite happily, they are downloaded in devices.json, I see them with an Ip Address in my DHCP Server quite happily, but the tinytuya scan does not see the newer Ones
I have tried using a 120 second timeout
It seems that all newer ones are not seen, and a couple of older ones are not seen by tinytuya
I double checked taht all my devices were on the same subnet as well
Here are two screenshots of the same model, one that is seen and one that is not
Its almost like there is a limit on the number of a specific model that can be scanned, but I cannot see anything like that in the code
Any thoughts, happy to debug, but not quite sure where to start
Many thanks
Beta Was this translation helpful? Give feedback.
All reactions