Comments (3)
OK, noticed some more nuances, let's look at two cases:
- Motion is detected, and MQTT message with "state:1" is generated. Then, there is no motion happening anymore and 40 seconds later MQTT message with "state:0" is generated again.
- Motion is detected, and MQTT message with "state:1" is generated. Then, additional motion is made in front of the sensor. Not instantly, rather few moments later a message with "battery:0" and some strange looking "data" string shows up. Then 30 seconds later a "state:0" message shows up.
It almost seems that when PIR detects additional motion event but before the original event had "expired", sensor generates some data that is being incorrectly parsed by gosense.
Here are logs with timestamps. First you'll see the #1 case, and right after - #2.
2020-06-19T07:41:21.600391811Z INFO[1443] LOG: time=19 Jun 20 07:41 +0000, data=�77A17BAB���
2020-06-19T07:41:21.600485005Z INFO[1443] ALARM: time=19 Jun 20 07:41 +0000, mac: 77A17BAB, type: 2, battery: 100, signal: 21, state: 1, data=64000101000f15
2020-06-19T07:41:21.600505236Z INFO[1443] ALARM: 77A17BAB, state: 1
2020-06-19T07:42:01.594729111Z INFO[1483] LOG: time=19 Jun 20 07:41 +0000, data=�77A17BAB��
2020-06-19T07:42:01.595161311Z INFO[1483] ALARM: time=19 Jun 20 07:41 +0000, mac: 77A17BAB, type: 2, battery: 100, signal: 21, state: 0, data=64000100001015
2020-06-19T07:42:01.595228299Z INFO[1483] ALARM: 77A17BAB, state: 0
2020-06-19T07:42:56.399597312Z INFO[1538] LOG: time=19 Jun 20 07:42 +0000, data=�77A17BAB���
2020-06-19T07:42:56.399679934Z INFO[1538] ALARM: time=19 Jun 20 07:42 +0000, mac: 77A17BAB, type: 2, battery: 100, signal: 21, state: 1, data=64000101001115
2020-06-19T07:42:56.399700377Z INFO[1538] ALARM: 77A17BAB, state: 1
2020-06-19T07:43:21.594282624Z INFO[1563] ALARM: time=19 Jun 20 07:43 +0000, mac: 77A17BAB, type: 2, battery: 0, signal: 0, state: 0, data=00010000010000010000081500
2020-06-19T07:43:21.594384840Z INFO[1563] ALARM: 77A17BAB, state: 0
2020-06-19T07:43:52.815976222Z INFO[1594] LOG: time=19 Jun 20 07:43 +0000, data=�77A17BAB��
2020-06-19T07:43:52.816561626Z INFO[1594] ALARM: time=19 Jun 20 07:43 +0000, mac: 77A17BAB, type: 2, battery: 100, signal: 21, state: 0, data=64000100001215
2020-06-19T07:43:52.816617102Z INFO[1594] ALARM: 77A17BAB, state: 0
from ha-gosenseapp.
and more debug level logs:
2020-06-19T19:24:55.501110026Z DEBU[0062] readRawHid: 62 bytes: [ 55aa53193500000172ce0a772f0ea2373741313742414202010051067155aa531d1900000172ce0a7732a2373741313742414202176400010100511706e1 ]
2020-06-19T19:24:55.501220514Z DEBU[0062] Trying to parse: 62 bytes: [ 55aa53193500000172ce0a772f0ea2373741313742414202010051067155aa531d1900000172ce0a7732a2373741313742414202176400010100511706e1 ]
2020-06-19T19:24:55.501246966Z DEBU[0062] ==> Sending ACK packet for cmd 5335
2020-06-19T19:24:55.501264432Z DEBU[0062] ====> sending: [Packet: Cmd:53ff, Payload: ACK[0035]]
2020-06-19T19:24:55.501287402Z DEBU[0062] Sending: aa555335ff0286
2020-06-19T19:24:55.501789179Z INFO[0062] LOG: time=19 Jun 20 19:24 +0000, data=�77A17BAB��Q
2020-06-19T19:24:55.501866457Z DEBU[0062] Trying to parse: 33 bytes: [ 55aa531d1900000172ce0a7732a2373741313742414202176400010100511706e1 ]
2020-06-19T19:24:55.501916999Z DEBU[0062] ==> Sending ACK packet for cmd 5319
2020-06-19T19:24:55.501956320Z DEBU[0062] ====> sending: [Packet: Cmd:53ff, Payload: ACK[0019]]
2020-06-19T19:24:55.501980927Z DEBU[0062] Sending: aa555319ff026a
2020-06-19T19:24:55.502068522Z INFO[0062] ALARM: time=19 Jun 20 19:24 +0000, mac: 77A17BAB, type: 2, battery: 100, signal: 23, state: 1, data=64000101005117
2020-06-19T19:24:55.502162753Z INFO[0062] ALARM: 77A17BAB, state: 1
2020-06-19T19:25:35.493705925Z DEBU[0102] readRawHid: 62 bytes: [ 55aa53193500000172ce0b0c1a0ea237374131374241420200005205f255aa531d1900000172ce0b0c1da237374131374241420217640001000052170662 ]
2020-06-19T19:25:35.493803285Z DEBU[0102] Trying to parse: 62 bytes: [ 55aa53193500000172ce0b0c1a0ea237374131374241420200005205f255aa531d1900000172ce0b0c1da237374131374241420217640001000052170662 ]
2020-06-19T19:25:35.493835865Z DEBU[0102] ==> Sending ACK packet for cmd 5335
2020-06-19T19:25:35.493861900Z DEBU[0102] ====> sending: [Packet: Cmd:53ff, Payload: ACK[0035]]
2020-06-19T19:25:35.493893358Z DEBU[0102] Sending: aa555335ff0286
2020-06-19T19:25:35.494030450Z INFO[0102] LOG: time=19 Jun 20 19:25 +0000, data=�77A17BAB�R
2020-06-19T19:25:35.494089647Z DEBU[0102] Trying to parse: 33 bytes: [ 55aa531d1900000172ce0b0c1da237374131374241420217640001000052170662 ]
2020-06-19T19:25:35.494108240Z DEBU[0102] ==> Sending ACK packet for cmd 5319
2020-06-19T19:25:35.494122570Z DEBU[0102] ====> sending: [Packet: Cmd:53ff, Payload: ACK[0019]]
2020-06-19T19:25:35.494387519Z DEBU[0102] Sending: aa555319ff026a
2020-06-19T19:25:35.494429314Z INFO[0102] ALARM: time=19 Jun 20 19:25 +0000, mac: 77A17BAB, type: 2, battery: 100, signal: 23, state: 0, data=64000100005217
2020-06-19T19:25:35.494628320Z INFO[0102] ALARM: 77A17BAB, state: 0
2020-06-19T19:26:55.496452935Z DEBU[0182] readRawHid: 39 bytes: [ 55aa53231900000172ce0c35f5ab373741313742414202000001000001000001000001170006a9 ]
2020-06-19T19:26:55.496550061Z DEBU[0182] Trying to parse: 39 bytes: [ 55aa53231900000172ce0c35f5ab373741313742414202000001000001000001000001170006a9 ]
2020-06-19T19:26:55.496605672Z DEBU[0182] ==> Sending ACK packet for cmd 5319
2020-06-19T19:26:55.496635430Z DEBU[0182] ====> sending: [Packet: Cmd:53ff, Payload: ACK[0019]]
2020-06-19T19:26:55.496660790Z DEBU[0182] Sending: aa555319ff026a
2020-06-19T19:26:55.496684718Z INFO[0182] ALARM: time=19 Jun 20 19:26 +0000, mac: 77A17BAB, type: 2, battery: 0, signal: 0, state: 0, data=00010000010000010000011700
2020-06-19T19:26:55.496709455Z INFO[0182] ALARM: 77A17BAB, state: 0
from ha-gosenseapp.
looks like there is a potential workaround, as stated here : kevinvincent/ha-wyzesense#114 (comment)
At the moment, a dozen of these sensors are working fine for me, but I had to handle malformed MQTT messages in my node-red flow. Not a big problem, just need to account for this nuance.
Either way, Dario, this is fantastic work you've done here!
from ha-gosenseapp.
Related Issues (10)
- You have a second SetUsername reference here when it should be SetPassword HOT 1
- Can't compile HOT 1
- Platform mqtt does not generate unique IDs
- Strange message from motion sensor HOT 7
- Stop sending notifications randomly requiring Docker Container restart HOT 5
- Sensor with no MAC HOT 3
- Change Port 8080 HOT 1
- RPI Docker may require CGO_ENABLED=0
- Set Friendly Name HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha-gosenseapp.