jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
923 stars 165 forks source link

Can't connect to smoke detector PD-8912 #299

Open fhempy opened 1 year ago

fhempy commented 1 year ago

Hi,

I bought the following smoke detector: https://www.action.com/de-at/p/lsc-smart-connect-rauchmelder/

I know that it is battery powered and therefore I can't connect to it when offline. The device goes online when sending an alarm, but I still can't connect to it. Other battery powered devices are working that way (e.g. temperature sensors or other smoke detectors). I try to connect to battery powered devices each second and if they go online to send data, they respond to queries as well.

It's interesting that this device doesn't have an open 6668 port. It replies to ping when online, but doesn't let connect to 6668. I tried nmap to see if the port is open, but also nmap says closed.

Any ideas? Main version is 2.1.0 and MCU is 1.0.0. Thx!

uzlonewolf commented 1 year ago

If you run a scan while it's connected, does it show up? You can increase the default scan time with something like python -m tinytuya scan 9999

fhempy commented 1 year ago

Unfortunately the scan didn't found the device either. I checked it several times during the alarm. The alarm was also displayed in smartlife, therefore it was definitely online.

jasonacox commented 1 year ago

Interesting. Did you also try with the Smartlife app closed? Sometimes the devices will stop broadcasting or accepting incoming requests if the app is open.

fhempy commented 1 year ago

Yes, it was closed all the time.

jasonacox commented 1 year ago

Interesting. I wonder if there are a class of battery powered tuya devices that don't open a TCP socket when the wake up to send the update to the cloud. This may be the case here. Or perhaps the port is open for such a short time that it is difficult to hit.