Digoo Door Sensor + Sonoff RF Bridge + Amazon Echo Dot

I have received finally DIGOO door sensor which is capable of sending separate 433MHz codes for closing and opening state. I tried to get some use-case for it. I will use it to monitor fridge door in case if somebody does not close them enough. In this tutorial I use also previous setup of Sonoff RF Bridge. This time we will received codes and using MQTT control OpenHAB items. If door will be open longer than 2 minutes then Alexa remind me about it.

Digoo Door Window Sensor

Digoo Window Sensor is very small. Dimensions as on the picture below. It is funny part because on the website they put pictures as this sensor looks like at least 20 cm high :). In real is very tiny and looks elegant.

It is powered up button battery CR2032, which according to website shoud stand for 2 years. There is also led indicator chaning status. It sends separate codes for Open and Close state. A little bit specification below

BrandDIGOO
Type 433MHz Door Window Alarm Sensor
Voltage 3V Button Battery (Included in package) CR2032
Under Voltage Monitoring7.5 V+/-0.5V
Static Current <=10uA
Triggering Distance >20mm
Emission Current <=15mA
Emission Distance>=120 m (Open area)
Emission Frequency433MHz
Working Temperature-10℃ ~50 ℃

I have also to other similar sensors but it looks like they send only one code once sensor is OPEN. They are cheaper but not every use case will be covered. Anyhow please find they pictures to avoid/order them:

Bakeey Door Sensor
Noname sensor

Receiving codes

At this stage I assume that you have OpenHAB instance and also Sonoff RF Bridge 433MHz flashed with Tasmota. If not, please follow my previous posts. Let’s try to capture codes. In console window for Sonoff we should see codes similar to these ones, whenever you move sensors close together and far away:

The same should be visible in your MQTT broker. It is important as we will use it further in OpenHAB instance. Steps how to configure and part of configuration that will be used you find in this post. You may notice “Data” field. They are differ each other and this is what we use in our configuration. First define new thing called door1 in .things file. They are also debug things for observing what code Sonoff RF Bridge received last time.

.things

I have defined contact type of thing, then which states are allowed in case we have more sensors and also which code means open/close (on/off) state. In this approach you do not need to use rules to recognize it. MQTT + OpenHAB contact item logic does it for you.

.items

.sitemaps

Once you receive signals from sensor parameters should change and status as well CLOSE or OPEN (last line):

Good now time to force you door to speak.

Amazon Echo Dot + Alexa voice

I do not have any Alarm Siren yet. Maybe I will add this one working also over 433 Mhz. For now I wondered how I can use my Amazon Echo Dot and Alexa voice to remind me about issue.

There is nice OpenHAB binding available, which utilizes all Alexa features. For more information go to documentation. For simplicity for you I just use text to speech functionality.

Installing amazonechocontrol binding

First you add binding to you conf/services.cfg file, or by using PaperUI. I’m old school and everything want to keep in files. Edit:

Give it few seconds to be installed. In meantime create amazonechocontrol.things file with the content:

amazoncontrol.things

For now Serial number is whatever. We get it in next steps.

Login to amazon devices over OpenHAB

You have to put to your browser url http://address-to-your-oh:8080/amazonechocontrol/

You should get website with link and asked for providing Amazon credentials.

after login you will get list of registered devices. Seek for Echo Dot. You should see also Serial number that you copy and paste to your configuration.

After updating configuration refresh website and under Thing column you should see Alexa in Online state as below:

Well done! Now OpenHAB last configuration part.

amazonechocontrol.items

Basically for my usage just Echo_Living_Room_TTS item is the most relevant. For other interesting examples please check binding documentation.

amazonechocontrol.rules

This is almost done. Please create amazonechocontrol.rules file in rules conf/rules folder. I put two rules. First is just for testing purposed. Immediatly after opening sensor Alexa should speak.

This one is the final one. We trigger timer for 15s after opening. After that time if sensor is still in OPEN state Alexa will remind. Otherwise nothing happened.

You may also like...

4 Responses

  1. Suggsy Blackburn says:

    Hi is this using mqtt 2.5 if so what bindinds should I have

    • gg says:

      These are my bindings from addons.cfg file:

      #A comma-separated st of bindings to install (e.g. "binding = sonos,knx,zwave")
      binding = http1,ntp,samsungtv,network,mqtt,exec,openweathermap,weather1,amazonechocontrol

      mqtt it’s in version 2.x
      mqtt1 would be in version 1.x and config files would be also different.

  2. François says:

    Hi
    Thanks for your complet tutorial. Nice work !
    One question.
    I want to assign the Thing “Door1″ in your exemple to the location”Cellar” for exemple.
    (Exemple for another Thing in MQTT :
    Thing mqtt:topic:Door1 “My Door in basement” @ “Cellar”
    …)
    Norm is :
    Thing :: “Label” @ “Location” [ ]

    Means in this case it’s always linked to SonoffRF Bridge location:
    If your Sonoff Bridge is in Floor1 all components are in Floor1 :o( because they depends from the bridge…
    Thing mqtt:topic:sonoffbridge “Bridge” @ “Floor1” {

    How can we manage the location where we want please ?
    (I don’t want to look for Bridge RF to see if my door is opened or closed in a location (like Cellar, Garage…)
    Thanks for your help

Leave a Reply

Your email address will not be published. Required fields are marked *