Git Product home page Git Product logo

wyzesensepy's People

Contributors

hclx avatar jellybob avatar raetha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wyzesensepy's Issues

Query latest states

For the contact switches, is there a way to query their state when i start up the sample.py script?

My sense bridge is on a raspberry pi and I'd like to keep the status of the sensors correct should I reboot the pi and miss a transition of state.

Thanks!

AssertionError in gateway.py

Hi. I'm not positive if this is something you might be able to help with or not, but I have a project (https://github.com/raetha/wyzesense2mqtt) that uses this library as its base to talk to WyzeSense devices and integrate with HA.

Recently one of my users hit an error while pairing a sensor. I'm including the messages they got below, including debug logging from my code.

sensor_mac: 777E2715
Non-state event data: [2020-03-26 00:06:07][777E2715]RawEvent: type=raw_AB, data=b'020000030000000200000002003b00'
sensor_mac: 777E2715
Non-state event data: [2020-03-26 00:06:07][777E2715]RawEvent: type=raw_AB, data=b'020000030000000200000002003b00'
sensor_mac: 777E2715
Non-state event data: [2020-03-26 00:06:07][777E2715]RawEvent: type=raw_AB, data=b'020000030000000200000002003b00'
sensor_mac: 777E2715
Non-state event data: [2020-03-26 00:06:07][777E2715]RawEvent: type=raw_AB, data=b'020000030000000200000002003b00'
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.8/site-packages/wyzesense/gateway.py", line 357, in _Worker
    pkt = Packet.Parse(s)
  File "/usr/lib/python3.8/site-packages/wyzesense/gateway.py", line 129, in Parse
    assert len(s) >= b2 + 4
AssertionError

Wondering if you might have any ideas on if there's something I need to do to fix this, or if maybe it is a bad sensor/bridge, or if maybe something on your side.

Happy to help troubleshoot any way I can, though they did tell me they unpaired the sensor and then paired other sensors without issue. Waiting to hear back if they were able to repair the original sensor or not.

SensorAlarm Payload

I found your blog posts while I was working on solving the same problem, and since I didn't see it here already, I figured I'd share what I found about the SensorAlarm payload for the contact/motion sensor.

8 bytes: big endian timestamp in milliseconds
1 byte:  sensor flags?, 0xa2 for both contact and motion sensor
8 bytes: sensor MAC
1 byte:  sensor type
1 byte:  unknown
1 byte:  remaining battery percentage
1 byte:  unknown, referred to as p1329
1 byte:  unknown
1 byte:  binary sensor state (1: opened/motion detected, 0: closed/no motion detected)
2 bytes: big endian counter for when the sensor is triggered
1 byte:  signal strength, presumably something like absolute value of RSSI (lower is better)

Hope it's helpful.

EDIT: What I had before as 'sensor index' actually looks like the 'sensor type', probably the same value as in the response to dongle_sensor_Random_date_send, where it maps to the dongle_sensor_mode string (DWS3U for contact sensor, PIR3U for the motion sensor)

Potential parsing issue of data received from motion sensor

First of all, huge thanks for the work you've done, reverse engineering the WyzeSense protocol !

I'm actually using gosense library, but also used this package, and appear to be running into this issue.
When Motion sensor detect motion, bridge sees 62 byte frame, and parsing it shows "State: 1".
40 seconds later it receives another frame with 62 bytes, and parsing it shows "state: 0". All good.

However totally unsolicited, at some point after that second message, Wyze bridge receives one more message which is only 39 bytes long.

2020-06-19T19:33:30.561536251Z DEBU[0578] readRawHid: 62 bytes: [ 55aa53193500000172ce123b360ea2373741313742414202010053064655aa531d1900000172ce123b39a2373741313742414202176400010100531606b5 ]
,2020-06-19T19:34:10.558263651Z DEBU[0618] readRawHid: 62 bytes: [ 55aa53193500000172ce12d0230ea237374131374241420200005406c855aa531d1900000172ce12d026a237374131374241420217640001000054170738 ]
,2020-06-19T19:35:30.557162901Z DEBU[0698] readRawHid: 39 bytes: [ 55aa53231900000172ce13f9f7ab37374131374241420200000100000100000100000117000776 ]

I see other threads that might be indicating similar issue?

Sensor with no MAC ID

I've been playing with the sample.py script. I have a whole bunch of sensors, all but one of which reliably generate output like:

[2019-10-14 17:09:08][77835FCF]StateEvent: sensor_type=switch, state=open, battery=94, signal=85
[2019-10-14 17:09:10][77835FCF]StateEvent: sensor_type=switch, state=close, battery=94, signal=94

I keep getting this output when one of my sensors changes state:

[2019-10-14 17:09:08][]StateEvent: sensor_type=switch, state=open, battery=94, signal=85

When I change line 32 in sample.py from:

s = "[%s][%s]" % (e.Timestamp.strftime("%Y-%m-%d %H:%M:%S"), e.MAC)

to:

s = "[%s][%r]" % (e.Timestamp.strftime("%Y-%m-%d %H:%M:%S"), e.MAC)

The data in e.MAC is shown on screen as "u\x00\x00\x00\x00\x00\x00\x00\x00". I'm not really sure what this means. I changed the code in the unpair function (because it won't run unless given precisely eight digits) to just send "\x00\x00\x00\x00\x00\x00\x00\x00" to the hub and that seems to unpair the device. I can pair it up again just fine, but it still has that empty/nonsense MAC ID.

This misbehaving (?) sensor may have something to do with the issue I created earlier.

Shorter reporting time for motion sensors

So by accident I discovered an undocumented feature of the motion sensors, if you simply poke the button quickly instead of hold it for 3 seconds the devices pair in a instant detect mode and will flash on movement without the 40 second cool down time.

I asked in their forums and got a reply that explained what I was experiencing when I paired my sensors this way.

https://forums.wyzecam.com/t/motion-sensor-red-light/88209

Even in this mode the sensors are still reporting to the hub with the 40 second cool down I was wondering if the code could be modified to support this feature so we can have better detection of motion.

Add support for low battery notification events

I don't have details on how this works unfortunately, but Wyze in a recent-ish Testflight build of their app had low battery notifications listed in the release notes, making it possible. I'm still leaning towards the unknown event crash that resulted in PR #14 might actually be those events, but it would need to be determined how to parse them so that they hit the events functions and can be used by other projects.

Quick question: Do you think this repo / integration is stable? It's not.

64 open issue tickets currently on the Wyze Sense repo

All of them revolving around a faulty api, bad code snippets being sent to the hub, broken sensors, hung hassos, everything revolving around this very shoddy api implementation.

I'm all for giving credit where credit is due, but the amount of issues I've seen and experienced myself, along with 100's of others, is too high to not mention.

If you would like me to NOT link this repo on that repo's tickets for further inspection (essentially, the way I see it, if they know that this repo even existed, they would have 2x as many tickets here, as there) I highly suggest you either close the project completely and release us from this nonsense of having broken implementations that barely work, or take a significant amount of time testing this python code, along with that repo's code, and figure out some of these very repetitive tickets.

It's all the same issues, you have said in other tickets on this repo that these issues where "fixed" but I fail to see the solution being as easy as one PR which very obviously only increased the number of new issue tickets made .

Fix it, or I blow the lid off this and start having people submit their issue tickets here. I'm beyond tired of this.

L command in sample.py not working

I'm using sample.py as the basis of a script to publish MQTT messages when connected sensors send their status. I've been playing around with unchanged sample.py over the last couple days, and every time I use the 'L' "L to list" option nothing happens for ~30 seconds and then the script crashes with this output:

  File "./sample.py", line 134, in <module>
    sys.exit(main(docopt(usage)))
  File "./sample.py", line 117, in main
    while HandleCmd():
  File "./sample.py", line 113, in HandleCmd
    handler[1](cmd_and_args[1:])
  File "./sample.py", line 61, in List
    result = ws.List()
  File "/home/wayne/WyzeSensePy/wyzesense/gateway.py", line 497, in List
    sensors = self._GetSensors()
  File "/home/wayne/WyzeSensePy/wyzesense/gateway.py", line 469, in _GetSensors
    self._DoCommand(Packet.GetSensorList(count), cmd_handler, timeout=self._CMD_TIMEOUT * count)
  File "/home/wayne/WyzeSensePy/wyzesense/gateway.py", line 374, in _DoCommand
    raise TimeoutError("_DoCommand")
NameError: global name 'TimeoutError' is not defined

NEW full-featured Python SDK for Wyze

I have recently released a full-featured, reverse-engineered Python SDK for Wyze devices. I would love to work with you to integrate into your project if you see any use for it

If it's not appropriate for an integration, maybe you can link to my project from the front page so others can find it?

Python SDK for Wyze

Signal information if needed

I have also been working on doing this only I took the route of intercepting the data from the signals as they were being sent back to the hub. I dont know if I have anything of value for your project but If you would like to see any of the information I have with regards to how the signals are sent/received I can provide them!

Good luck!

sample.py failing to find sensors

I have a motion sensor I am trying to pair with the hub on a Raspberry Pi 4 (Linux raspberrypi 5.4.83-v7l+ #1379 SMP Mon Dec 14 13:11:54 GMT 2020 armv7l GNU/Linux). I gave read and write privileges to the user using sudo chmod g+rw /dev/hidraw0. The sample is able to find the hub plugged into the Pi, but when I go to pair it is not finding the motion sensor. Here is the flow I have tried:

  • sudo python sample.py --device /dev/hidraw0 --debug
  • Option P for pairing
  • After put into pairing mode, I hold the button on the side of the sensor until the light flashes 3 times, then release
  • The script will say "No sensor found!" every time without pairing to a sensor

Is there a way to enter a sensor strictly by MAC? If not, I am just wondering what I am doing wrong. Here are the debugging logs:

Openning wyzesense gateway ['/dev/hidraw0']
DEBUG 2021-01-18 17:48:38,609 Start Inquiry...
DEBUG 2021-01-18 17:48:38,609 ===> Sending: Packet: Cmd=4327, Payload=
DEBUG 2021-01-18 17:48:38,611 Sending: aa55430327016c
DEBUG 2021-01-18 17:48:38,710 Trying to parse: 55aa43042801016f
DEBUG 2021-01-18 17:48:38,710 Received: 55aa43042801016f
DEBUG 2021-01-18 17:48:38,710 <=== Received: Packet: Cmd=4328, Payload=01
DEBUG 2021-01-18 17:48:38,726 Inquiry returns 1
DEBUG 2021-01-18 17:48:38,727 Start GetEnr...
DEBUG 2021-01-18 17:48:38,727 ===> Sending: Packet: Cmd=4302, Payload=30303030303030303030303030303030
DEBUG 2021-01-18 17:48:38,727 Sending: aa55431302303030303030303030303030303030300457
DEBUG 2021-01-18 17:48:38,811 Trying to parse: 55aa431303e2b1b3f327fbb487a45b716a4e948fa20adb
DEBUG 2021-01-18 17:48:38,811 Received: 55aa431303e2b1b3f327fbb487a45b716a4e948fa20adb
DEBUG 2021-01-18 17:48:38,811 <=== Received: Packet: Cmd=4303, Payload=e2b1b3f327fbb487a45b716a4e948fa2
DEBUG 2021-01-18 17:48:38,843 GetEnr returns e2b1b3f327fbb487a45b716a4e948fa2
DEBUG 2021-01-18 17:48:38,843 Start GetMAC...
DEBUG 2021-01-18 17:48:38,844 ===> Sending: Packet: Cmd=4304, Payload=
DEBUG 2021-01-18 17:48:38,844 Sending: aa554303040149
DEBUG 2021-01-18 17:48:38,912 Trying to parse: 55aa430b053737393236334545031e
DEBUG 2021-01-18 17:48:38,912 Received: 55aa430b053737393236334545031e
DEBUG 2021-01-18 17:48:38,913 <=== Received: Packet: Cmd=4305, Payload=3737393236334545
DEBUG 2021-01-18 17:48:38,961 GetMAC returns 779263EE
DEBUG 2021-01-18 17:48:38,962 Dongle MAC is [779263EE]
DEBUG 2021-01-18 17:48:38,962 Start GetVersion...
DEBUG 2021-01-18 17:48:38,962 ===> Sending: Packet: Cmd=5316, Payload=
DEBUG 2021-01-18 17:48:38,963 Sending: aa55530316016b
DEBUG 2021-01-18 17:48:39,013 Trying to parse: 55aa5316ff026755aa531c17302e302e302e33302056312e3420446f6e676c65205544335507c5
DEBUG 2021-01-18 17:48:39,014 Received: 55aa5316ff0267
DEBUG 2021-01-18 17:48:39,014 <=== Received: Packet: Cmd=53FF, Payload=ACK(5316)
DEBUG 2021-01-18 17:48:39,014 Trying to parse: 55aa531c17302e302e302e33302056312e3420446f6e676c65205544335507c5
DEBUG 2021-01-18 17:48:39,014 Received: 55aa531c17302e302e302e33302056312e3420446f6e676c65205544335507c5
DEBUG 2021-01-18 17:48:39,015 <=== Received: Packet: Cmd=5317, Payload=302e302e302e33302056312e3420446f6e676c652055443355
DEBUG 2021-01-18 17:48:39,015 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5317)
DEBUG 2021-01-18 17:48:39,015 Sending: aa555317ff0268
DEBUG 2021-01-18 17:48:39,029 GetVersion returns 0.0.0.30 V1.4 Dongle UD3U
DEBUG 2021-01-18 17:48:39,029 Dongle version: 0.0.0.30 V1.4 Dongle UD3U
DEBUG 2021-01-18 17:48:39,029 ===> Sending: Packet: Cmd=5314, Payload=ff
DEBUG 2021-01-18 17:48:39,030 Sending: aa55530414ff0269
DEBUG 2021-01-18 17:48:39,117 Trying to parse: 55aa5314ff026555aa530e3500000000000000000314ff02ab55aa530315016a
DEBUG 2021-01-18 17:48:39,117 Received: 55aa5314ff0265
DEBUG 2021-01-18 17:48:39,117 <=== Received: Packet: Cmd=53FF, Payload=ACK(5314)
DEBUG 2021-01-18 17:48:39,117 Trying to parse: 55aa530e3500000000000000000314ff02ab55aa530315016a
DEBUG 2021-01-18 17:48:39,118 Received: 55aa530e3500000000000000000314ff02ab
DEBUG 2021-01-18 17:48:39,118 <=== Received: Packet: Cmd=5335, Payload=00000000000000000314ff
DEBUG 2021-01-18 17:48:39,118 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5335)
DEBUG 2021-01-18 17:48:39,118 Sending: aa555335ff0286
INFO 2021-01-18 17:48:39,120 LOG: time=1970-01-01T01:00:00, data=14ff
DEBUG 2021-01-18 17:48:39,120 Trying to parse: 55aa530315016a
DEBUG 2021-01-18 17:48:39,121 Received: 55aa530315016a
DEBUG 2021-01-18 17:48:39,121 <=== Received: Packet: Cmd=5315, Payload=
DEBUG 2021-01-18 17:48:39,122 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5315)
DEBUG 2021-01-18 17:48:39,122 Sending: aa555315ff0266
Gateway info:
MAC:779263EE
VER:0.0.0.30 V1.4 Dongle UD3U
ENR:e2b1b3f327fbb487a45b716a4e948fa2
P to pair
U to unpair
L to list
X to exit
Action:DEBUG 2021-01-18 17:48:39,225 Trying to parse: 55aa530315016a55aa5303320187
DEBUG 2021-01-18 17:48:39,226 Received: 55aa530315016a
DEBUG 2021-01-18 17:48:39,226 <=== Received: Packet: Cmd=5315, Payload=
DEBUG 2021-01-18 17:48:39,227 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5315)
DEBUG 2021-01-18 17:48:39,227 Sending: aa555315ff0266
DEBUG 2021-01-18 17:48:39,230 Trying to parse: 55aa5303320187
DEBUG 2021-01-18 17:48:39,230 Received: 55aa5303320187
DEBUG 2021-01-18 17:48:39,231 <=== Received: Packet: Cmd=5332, Payload=
DEBUG 2021-01-18 17:48:39,231 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5332)
DEBUG 2021-01-18 17:48:39,232 Sending: aa555332ff0283
DEBUG 2021-01-18 17:48:39,234 ===> Sending: Packet: Cmd=5333, Payload=00000177169cedc2
DEBUG 2021-01-18 17:48:39,235 Sending: aa55530b3300000177169cedc20469
DEBUG 2021-01-18 17:48:39,338 Trying to parse: 55aa5303320187
DEBUG 2021-01-18 17:48:39,338 Received: 55aa5303320187
DEBUG 2021-01-18 17:48:39,339 <=== Received: Packet: Cmd=5332, Payload=
DEBUG 2021-01-18 17:48:39,339 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5332)
DEBUG 2021-01-18 17:48:39,340 Sending: aa555332ff0283
DEBUG 2021-01-18 17:48:39,342 ===> Sending: Packet: Cmd=5333, Payload=00000177169cee2e
DEBUG 2021-01-18 17:48:39,342 Sending: aa55530b3300000177169cee2e03d6
DEBUG 2021-01-18 17:48:39,345 Trying to parse: 55aa5333ff0284
DEBUG 2021-01-18 17:48:39,345 Received: 55aa5333ff0284
DEBUG 2021-01-18 17:48:39,345 <=== Received: Packet: Cmd=53FF, Payload=ACK(5333)
DEBUG 2021-01-18 17:48:39,447 Trying to parse: 55aa5333ff0284
DEBUG 2021-01-18 17:48:39,447 Received: 55aa5333ff0284
DEBUG 2021-01-18 17:48:39,448 <=== Received: Packet: Cmd=53FF, Payload=ACK(5333)
P
DEBUG 2021-01-18 17:49:26,857 Start Scan...
DEBUG 2021-01-18 17:49:26,858 ===> Sending: Packet: Cmd=531C, Payload=01
DEBUG 2021-01-18 17:49:26,859 Sending: aa5553041c010173
DEBUG 2021-01-18 17:49:26,907 Trying to parse: 55aa531cff026d55aa530e3500000177169d9f19031c01039855aa53031d0172
DEBUG 2021-01-18 17:49:26,908 Received: 55aa531cff026d
DEBUG 2021-01-18 17:49:26,908 <=== Received: Packet: Cmd=53FF, Payload=ACK(531C)
DEBUG 2021-01-18 17:49:26,909 Trying to parse: 55aa530e3500000177169d9f19031c01039855aa53031d0172
DEBUG 2021-01-18 17:49:26,910 Received: 55aa530e3500000177169d9f19031c010398
DEBUG 2021-01-18 17:49:26,910 <=== Received: Packet: Cmd=5335, Payload=00000177169d9f19031c01
DEBUG 2021-01-18 17:49:26,910 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5335)
DEBUG 2021-01-18 17:49:26,911 Sending: aa555335ff0286
INFO 2021-01-18 17:49:26,914 LOG: time=2021-01-18T17:49:24.633000, data=1c01
DEBUG 2021-01-18 17:49:26,915 Trying to parse: 55aa53031d0172
DEBUG 2021-01-18 17:49:26,916 Received: 55aa53031d0172
DEBUG 2021-01-18 17:49:26,916 <=== Received: Packet: Cmd=531D, Payload=
DEBUG 2021-01-18 17:49:26,916 ===> Sending: Packet: Cmd=53FF, Payload=ACK(531D)
DEBUG 2021-01-18 17:49:26,917 Sending: aa55531dff026e
DEBUG 2021-01-18 17:50:26,925 Sensor discovery timeout...
DEBUG 2021-01-18 17:50:26,926 ===> Sending: Packet: Cmd=531C, Payload=00
DEBUG 2021-01-18 17:50:26,927 Sending: aa5553041c000172
DEBUG 2021-01-18 17:50:27,014 Trying to parse: 55aa531cff026d55aa530e3500000177169e7ec2031c00042055aa53031d0172
DEBUG 2021-01-18 17:50:27,015 Received: 55aa531cff026d
DEBUG 2021-01-18 17:50:27,015 <=== Received: Packet: Cmd=53FF, Payload=ACK(531C)
DEBUG 2021-01-18 17:50:27,016 Trying to parse: 55aa530e3500000177169e7ec2031c00042055aa53031d0172
DEBUG 2021-01-18 17:50:27,017 Received: 55aa530e3500000177169e7ec2031c000420
DEBUG 2021-01-18 17:50:27,017 <=== Received: Packet: Cmd=5335, Payload=00000177169e7ec2031c00
DEBUG 2021-01-18 17:50:27,018 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5335)
DEBUG 2021-01-18 17:50:27,018 Sending: aa555335ff0286
INFO 2021-01-18 17:50:27,021 LOG: time=2021-01-18T17:50:21.890000, data=1c00
DEBUG 2021-01-18 17:50:27,021 Trying to parse: 55aa53031d0172
DEBUG 2021-01-18 17:50:27,022 Received: 55aa53031d0172
DEBUG 2021-01-18 17:50:27,022 <=== Received: Packet: Cmd=531D, Payload=
DEBUG 2021-01-18 17:50:27,023 ===> Sending: Packet: Cmd=53FF, Payload=ACK(531D)
DEBUG 2021-01-18 17:50:27,023 Sending: aa55531dff026e
DEBUG 2021-01-18 17:50:27,026 Trying to parse: 55aa53031d0172
DEBUG 2021-01-18 17:50:27,026 Received: 55aa53031d0172
DEBUG 2021-01-18 17:50:27,027 <=== Received: Packet: Cmd=531D, Payload=
DEBUG 2021-01-18 17:50:27,027 ===> Sending: Packet: Cmd=53FF, Payload=ACK(531D)
DEBUG 2021-01-18 17:50:27,028 Sending: aa55531dff026e
No sensor found!
DEBUG 2021-01-18 17:50:27,044 No sensor found!
P to pair
U to unpair
L to list
X to exit
Action:P
DEBUG 2021-01-18 17:50:39,782 Start Scan...
DEBUG 2021-01-18 17:50:39,783 ===> Sending: Packet: Cmd=531C, Payload=01
DEBUG 2021-01-18 17:50:39,784 Sending: aa5553041c010173
DEBUG 2021-01-18 17:50:39,874 Trying to parse: 55aa531cff026d55aa530e3500000177169eaea3031c01043255aa53031d0172
DEBUG 2021-01-18 17:50:39,875 Received: 55aa531cff026d
DEBUG 2021-01-18 17:50:39,875 <=== Received: Packet: Cmd=53FF, Payload=ACK(531C)
DEBUG 2021-01-18 17:50:39,876 Trying to parse: 55aa530e3500000177169eaea3031c01043255aa53031d0172
DEBUG 2021-01-18 17:50:39,877 Received: 55aa530e3500000177169eaea3031c010432
DEBUG 2021-01-18 17:50:39,878 <=== Received: Packet: Cmd=5335, Payload=00000177169eaea3031c01
DEBUG 2021-01-18 17:50:39,879 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5335)
DEBUG 2021-01-18 17:50:39,880 Sending: aa555335ff0286
INFO 2021-01-18 17:50:39,882 LOG: time=2021-01-18T17:50:34.147000, data=1c01
DEBUG 2021-01-18 17:50:39,882 Trying to parse: 55aa53031d0172
DEBUG 2021-01-18 17:50:39,885 Received: 55aa53031d0172
DEBUG 2021-01-18 17:50:39,885 <=== Received: Packet: Cmd=531D, Payload=
DEBUG 2021-01-18 17:50:39,886 ===> Sending: Packet: Cmd=53FF, Payload=ACK(531D)
DEBUG 2021-01-18 17:50:39,887 Sending: aa55531dff026e
DEBUG 2021-01-18 17:50:39,891 Trying to parse: 55aa53031d0172
DEBUG 2021-01-18 17:50:39,892 Received: 55aa53031d0172
DEBUG 2021-01-18 17:50:39,893 <=== Received: Packet: Cmd=531D, Payload=
DEBUG 2021-01-18 17:50:39,893 ===> Sending: Packet: Cmd=53FF, Payload=ACK(531D)
DEBUG 2021-01-18 17:50:39,894 Sending: aa55531dff026e
DEBUG 2021-01-18 17:51:39,901 Sensor discovery timeout...
DEBUG 2021-01-18 17:51:39,902 ===> Sending: Packet: Cmd=531C, Payload=00
DEBUG 2021-01-18 17:51:39,902 Sending: aa5553041c000172
DEBUG 2021-01-18 17:51:39,991 Trying to parse: 55aa531cff026d55aa530e3500000177169f8e76031c0003e555aa53031d0172
DEBUG 2021-01-18 17:51:39,992 Received: 55aa531cff026d
DEBUG 2021-01-18 17:51:39,992 <=== Received: Packet: Cmd=53FF, Payload=ACK(531C)
DEBUG 2021-01-18 17:51:39,993 Trying to parse: 55aa530e3500000177169f8e76031c0003e555aa53031d0172
DEBUG 2021-01-18 17:51:39,994 Received: 55aa530e3500000177169f8e76031c0003e5
DEBUG 2021-01-18 17:51:39,994 <=== Received: Packet: Cmd=5335, Payload=00000177169f8e76031c00
DEBUG 2021-01-18 17:51:39,994 ===> Sending: Packet: Cmd=53FF, Payload=ACK(5335)
DEBUG 2021-01-18 17:51:39,995 Sending: aa555335ff0286
INFO 2021-01-18 17:51:39,997 LOG: time=2021-01-18T17:51:31.446000, data=1c00
DEBUG 2021-01-18 17:51:39,998 Trying to parse: 55aa53031d0172
DEBUG 2021-01-18 17:51:39,998 Received: 55aa53031d0172
DEBUG 2021-01-18 17:51:39,999 <=== Received: Packet: Cmd=531D, Payload=
DEBUG 2021-01-18 17:51:39,999 ===> Sending: Packet: Cmd=53FF, Payload=ACK(531D)
DEBUG 2021-01-18 17:51:40,000 Sending: aa55531dff026e
DEBUG 2021-01-18 17:51:40,002 Trying to parse: 55aa53031d0172
DEBUG 2021-01-18 17:51:40,003 Received: 55aa53031d0172
DEBUG 2021-01-18 17:51:40,003 <=== Received: Packet: Cmd=531D, Payload=
DEBUG 2021-01-18 17:51:40,003 ===> Sending: Packet: Cmd=53FF, Payload=ACK(531D)
DEBUG 2021-01-18 17:51:40,004 Sending: aa55531dff026e
No sensor found!
DEBUG 2021-01-18 17:51:40,019 No sensor found!
P to pair
U to unpair
L to list
X to exit
Action:x

Support for hiddev

Some devices, like a Synology NAS, mount the Wyze Bridge as a hiddev device because they don't contain the hidraw drivers. Would it be possible to support both hiddev and hidraw devices?

/dev/hidraw* device not available after reboot

Not sure where the belongs, but...

I have noticed the /dev/hidraw* device is not created for the Wyze device after a reboot or power cycle of my server until the Wyze USB device is physically unplugged and plugged back in. After that all works OK.

Please document development tools

I've tried running this code on two systems. On MacOS X (latest) there's no /dev/hidraw device, and I couldn't find a driver for that available anywhere.

On raspbian, there IS a /dev/hidraw0, but I get:

pi@raspberrypi:~/WyzeSensePy $ python3 sample.py --debug --device /dev/hidraw0 
Openning wyzesense gateway ['/dev/hidraw0']
No device found on path '/dev/hidraw0'

What system are you testing this code on, and did you have to install any drivers to make it work? Documenting this in the README or somewhere would be very useful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.