Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message classes and event types for remaining components #5

Open
bggardner opened this issue Jan 22, 2017 · 15 comments
Open

Add message classes and event types for remaining components #5

bggardner opened this issue Jan 22, 2017 · 15 comments

Comments

@bggardner
Copy link
Owner

bggardner commented Jan 22, 2017

I don't have these, so I was unable to create the appropriate message classes:

  • CO Detector
  • Freeze Sensor
  • Water Sensor

If you have them, please post the raw output below, along with what caused the event.

@alandtse
Copy link
Contributor

Great work on this library. I have a Panic Button, Glassbreak Sensor, and Smoke Detector so will see if I can get the data. I haven't dug too far into the code yet, but is there some generic debug code that will output the raw message and hopefully perform a partial decode of expected structure (e.g., Vendor Code, PLC, etc.) assuming the message is complete?

@bggardner
Copy link
Owner Author

Thanks! The RFUtils.recv() function prints the raw message on lines 101 and 120. If you can post those results and the events they correspond to (like pressing the panic button, the smoke detector detecting smoke, etc.), then I can update the code. I appreciate your assistance.

@alandtse
Copy link
Contributor

alandtse commented Apr 19, 2017

Glass break sensor (detecting loud noise):

Message received: 00110011101000001000100010001100100011001001110000110010001011000110001010000000111000101111
Decoded: CC5011131393C443641074F
Swapped: CC05113131394C34460147
Payload Length Code: 0x11 (2 bytes)
Serial Number: 119L4
Checksum: 0x47

Glass break sensor (heartbeat):

Message received: 00110011101000001000100010001100100011001001110000110010001011000110111000000000011011101111
Decoded: CC5011131393C443670067F
Swapped: CC05113131394C34760076
Payload Length Code: 0x11 (2 bytes)
Serial Number: 119L4
Checksum: 0x76

Edit: Added Glass break heartbeat.

@bggardner
Copy link
Owner Author

Sorry for the delay, I was on vacation. I added the Glassbreak sensor without testing in b8ef080, so please test and let me know. Thanks.

@alandtse
Copy link
Contributor

The added glass break works.
Glass break sensor (glassbreak):

Message received: 00110011101000001000100010001100100011001001110001110010100000100110000110000000111000011111
Decoded: CC5011131393E414681078F
Swapped: CC05113131394E41860187
Payload Length Code: 0x11 (2 bytes)
Serial Number: 119NA
Checksum: 0x87
Origin Type: GLASSBREAK_SENSOR
Event Type: GLASSBREAK
Sequence: 0x8

Here's a few more events/sensors:
Glass break (test mode):

Message received: 00110011101000001000100010001100100011001001110001110010100000100110101011000000100110101111
Decoded: CC5011131393E414653095F
Swapped: CC05113131394E41560359
Traceback (most recent call last):
  File "./test.py", line 12, in <module>
    msg = RFUtils.recv(RX_433MHZ_GPIO) # Returns when a valid message is received and parsed
  File "/home/pi/simplisafe-rf/RFUtils.py", line 122, in recv
    return SimpliSafe.Message.factory(swapped)
  File "/home/pi/simplisafe-rf/SimpliSafe.py", line 139, in factory
    msg = c.factory(msg)
  File "/home/pi/simplisafe-rf/SimpliSafe.py", line 156, in factory
    return c.factory(msg)
  File "/home/pi/simplisafe-rf/SimpliSafe.py", line 1748, in factory
    raise NotImplementedError("Unimplemented SensorMessage, Event: 0x{:02X}".format(event_type))
NotImplementedError: Unimplemented SensorMessage, Event: 0x03

Panic Button (Pressed):

Message received: 00110011101000001000100010001100110011001010101000101010011011001100011010000000001001101111
Decoded: CC50111333554563361046F
Swapped: CC05113133555436630164
Payload Length Code: 0x11 (2 bytes)
Serial Number: 13UT6
Checksum: 0x64

@bggardner
Copy link
Owner Author

Added support for the Panic Button in f4bcaf7 (again without testing). Please test, and please post any other undecoded messages. I appreciate your support.

@alandtse
Copy link
Contributor

Both glassbreak heartbeat and panic button work.

Message received: 00110011101000001000100010001100100011001001110001110010100000100110011100000000011001111111
Decoded: CC5011131393E4146E006EF
Swapped: CC05113131394E41E600E6
Payload Length Code: 0x11 (2 bytes)
Serial Number: 119NA
Checksum: 0xE6
Origin Type: GLASSBREAK_SENSOR
Event Type: HEARTBEAT
Sequence: 0xE

Message received: 00110011101000001000100010001100110011001010101000101010011011001100010110000000001001011111
Decoded: CC501113335545633A104AF
Swapped: CC05113133555436A301A4
Payload Length Code: 0x11 (2 bytes)
Serial Number: 13UT6
Checksum: 0xA4
Origin Type: PANIC_BUTTON
Event Type: BUTTON_PRESS
Sequence: 0xA

However, I think you may have an indentation error with your code. I'll submit a pull request.

Traceback (most recent call last):
  File "test.py", line 2, in <module>
    import RFUtils
  File "/home/pi/simplisafe-rf/RFUtils.py", line 2, in <module>
    import SimpliSafe
  File "/home/pi/simplisafe-rf/SimpliSafe.py", line 1786
    origin_type = Message.OriginType.PANIC_BUTTON

@alandtse
Copy link
Contributor

alandtse commented Apr 30, 2017

Smoke detector (activate / 2 separate tests)

Message received: 00110011101000001000100010001100110011001100001010100010000111000001101111000000110110111111
Decoded: CC501113333454838D30BDF
Swapped: CC05113133434538D803DB
Payload Length Code: 0x11 (2 bytes)
Serial Number: 13CE8
Checksum: 0xDB
Message received: 00110011101000001000100010001100110011001100001010100010000111000001100011000000110110001111
Decoded: CC501113333454838130B1F
Swapped: CC0511313343453818031B
Payload Length Code: 0x11 (2 bytes)
Serial Number: 13CE8
Checksum: 0x1B

Smoke detector (heartbeat)

Message received: 00110011101000001000100010001100110011001100001010100010000111000001011100000000000101111111
Decoded: CC501113333454838E008EF
Swapped: CC05113133434538E800E8
Payload Length Code: 0x11 (2 bytes)
Serial Number: 13CE8
Checksum: 0xE8

@bggardner
Copy link
Owner Author

bggardner commented Apr 30, 2017

Awesome. Smoke detector added in 75f2c28. Please test. Also, what RF hardware are you using? I'd like to populate this wiki page. Thanks again.

@alandtse
Copy link
Contributor

Looks like a bug in the implementation:

Decoded: CC501113333454838930B9F
Swapped: CC0511313343453898039B
Traceback (most recent call last):
  File "test.py", line 12, in <module>
    msg = RFUtils.recv(RX_433MHZ_GPIO) # Returns when a valid message is received and parsed
  File "/home/pi/simplisafe-rf/RFUtils.py", line 121, in recv
    return SimpliSafe.Message.factory(swapped)
  File "/home/pi/simplisafe-rf/SimpliSafe.py", line 141, in factory
    msg = c.factory(msg)
  File "/home/pi/simplisafe-rf/SimpliSafe.py", line 158, in factory
    return c.factory(msg)
  File "/home/pi/simplisafe-rf/SimpliSafe.py", line 1747, in factory
    return c.factory(msg)
  File "/home/pi/simplisafe-rf/SimpliSafe.py", line 1882, in factory
    return cls(msg.sn, msg.sequence, event_type)
  File "/home/pi/simplisafe-rf/SimpliSafe.py", line 1875, in __init__
    super()._init_(sn, self.origin_type, sequence, event_type)
AttributeError: 'super' object has no attribute '_init_'

I'll update the Wiki. Tried basically all the cheap RF receivers on Amazon. Was hoping to find something that could sniff all the Simplisafe sensors in the house but the 2-3 foot maximum on these receivers is a problem. I'm thinking about trying to relocate the Pi next to the base station and perhaps triggering some status update (haven't dug to deep to see what options are there and waiting for some 315mhz HW). Have you found anything that works for sniffing the status of all sensors?

I was thinking about looking at transceivers but there's a lot less info on people using them to sniff Simplisafe RF.

@bggardner
Copy link
Owner Author

Sorry, had a typo. Try b3edcbb. I've only tried the SMAKN pairs on the wiki, with only a few inches of reception. I'm tempted to just tap into the base station receiver signals, but haven't been gutsy enough to crack it open.

@alandtse
Copy link
Contributor

alandtse commented May 1, 2017

Smoke detector looks good now:

Decoded: CC501113333454838030B0F
Swapped: CC0511313343453808030B
Payload Length Code: 0x11 (2 bytes)
Serial Number: 13CE8
Checksum: 0x0B
Origin Type: SMOKE_DETECTOR
Event Type: SMOKE
Sequence: 0x0

Decoded: CC50111333345483810081F
Swapped: CC05113133434538180018
Payload Length Code: 0x11 (2 bytes)
Serial Number: 13CE8
Checksum: 0x18
Origin Type: SMOKE_DETECTOR
Event Type: HEARTBEAT
Sequence: 0x1

@alandtse
Copy link
Contributor

alandtse commented Aug 2, 2017

I just realized I don't know how to update the wiki. However, I did find a better receiver. It's a RXB6 Superheterodyne Receiver. Using just 3.3V my RPi can now sniff all the sensors in my house. Before, using the cheaper xy-mk-5v which is all over Amazon, I could only receive info from a component while within a foot or so.

I just realized that almost all the receivers on Amazon are just rebrands of some base models, so you have to make sure you're using actual different models. This site and this thread helped provide some good comparisons.

@bggardner
Copy link
Owner Author

Great, thanks. I'll give that a try. You should be able to edit the wiki page here. I've never tried to edit someone else's wiki, so we'll see how it goes.

@alandtse
Copy link
Contributor

alandtse commented Aug 4, 2017

It's saying I don't have permission to edit that page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants