Homey Community

Signal data from sonoff sensor DW1 needed


#1

Hey all,

I’m busy with creating standalone app for the Sonoff sensor dw1 (to most probably create afterwards a merge request on the Sonoff app itself). I already decoded the signal and created the signal definition. But now I want to decode what’s inside. If it has some predefined key and then an ID. As I have only one sensor, I’m stuck. If you have have a Sonoff dw1, do you want to copy the raw data from https://developer.athom.com/tools/signals and send it to me?


#2

I have one, I think (not at home at the moment so can’t check).

From what I remember, there’s a fairly typical EV1527 chip inside that generates a code. If it is that chip, it’s a 24-bit code, a 20 bit identifier and 4 “on/off” bits. I think you can set which one of those should be set with a jumper inside the device.

I’d be happy to merge your app into the Sonoff app once you have it working. When I’m back home I’ll generate some data for you if you still need it.


#3

Thank you for the input already. I though it would be a full identifier, but the on/off bits is new. I see in the sensor the 4 on/off switches, but they are soldered (so no hard switch). Hopefully not all dw1 sensors have the same 20bit identifier. Else it will be problematic to find the correct dw1 to have each window/door send a unique identifier.


#4

I forgot, I soldered them by hand :sweat_smile:

Turns out that I already created an app for this a while ago, never finished it. All it does it detect and show the signals it receives. I just pushed it to Github in case you’re interested.

For my device, it outputs the following:

2019-01-02 11:50:12 [log] [SonoffRFSensorApp] SonoffRFSensorApp is running...
received from a device: [ 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1 ] isRepetition: false
code = 84763, id = 5297, d0 = true, d1 = false, d2 = true, d3 = true

The code (“84763”) is the full signal code, and should be unique for each device. It can subsequently be decoded into an id, and 4 “switch bits”. As you can see, the bit values correspond to the solder bridges (key1 = d0, key2 = d1, etc).

I also confirmed that the code is correct using my Sonoff RF bridge:

ele/sonoff-rf-bridge/RESULT {"RfReceived":{"Sync":12600,"Low":370,"High":1180,"Data":"014B1B","RfKey":"None"}}

(0x014B1B === 84763)