Digoo Door Sensor + Sonoff RF Bridge Tasmota + Amazon Echo Dot

Hello,
I have worked recently on the integration Digoo Door 433MHz wireless sensor with Sonoff RF Bridge flashed with Tasmota and for notifications coming from Amazon Echo Dot - Alexa.

Use case: Monitor unclosed door (fridge) and get notified by Alexa about it.

I created video tutorial that’s cover this idea:


What we need:
  • 433MHz wireless Door/Window sensor
  • Sonoff RF Bridge flashed by Tasmota
  • MQTT broker
  • Amazon Echo dot registred with Amazon account

First part is about getting working sensor with Sonoff RF Bridge. You have to create MQTT things. I put also debug things for Sonoff RF Bridge. Our Thing is called door1

.things

mqtt:broker:localbroker [ host="10.0.1.10", secure=false, clientID="OpenHABv2" ] {
 
	Thing mqtt:topic:sonoffbridge  {
	Channels:
        Type string : reachable     "Reachable"            [ stateTopic="tele/sonoff-bridge/LWT" ]
        Type string : receiveddata  "Received Data"        [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.Data"]
        Type string : receivedsync  "Received Sync"        [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.Sync"]
        Type string : receivedlow   "Received Low"         [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.Low"]
        Type string : receivedhigh  "Received High"        [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.High"]
        Type string : receivedrfkey "Received RfKey"       [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.RfKey"]
        Type number : rssi          "WiFi Signal Strength" [ stateTopic="tele/sonoff-bridge/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
        Type contact : door1         "Door 1"               [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.Data" ,allowedStates="082439,082433", off="082439", on="082433"]
        }
}

.items

Contact GF_Sonoff_RF_Door_1         "Door 1:"                             (GF_Sonoff_RF) { channel="mqtt:topic:sonoffbridge:door1" }

And group of RF settings to check status and visualize parameters.
.sitemaps

Group item=GF_Sonoff_RF {
             Text item=GF_Sonoff_RF_Reachable label="Status [%s]"
             Text item=GF_Sonoff_RF_Received_Data label="Data [%s]"
             Text item=GF_Sonoff_RF_Received_Sync label="Sync [%s]"
             Text item=GF_Sonoff_RF_Received_Low label="Low [%s]"
             Text item=GF_Sonoff_RF_Received_High label="High [%s]"
             Text item=GF_Sonoff_RF_Received_RfKey label="RfKey [%s]"
             Text item=GF_Sonoff_RF_RSSI label="WiFi Signal Strength [%d %%]"
             Text item=GF_Sonoff_RF_Door_1 label="Door [%s]"
         }

If everything matches to your tasmota configuration you should be able to see changing status from OPEN to CLOSED when move sensor.

Alexa support

Install binding, you may add amazonechocontrol binding to the addons.cfg file or install via PaperUI

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

and create amazoncontrolecho.things file:

Bridge amazonechocontrol:account:account1 "Amazon Account" @ "Accounts" 
 {
     Thing echo                 echo1          "Alexa" @ "Living Room" [serialNumber="SERIAL_NUMBER"]
 }

Serial number you will take by going to https://your-openhab:8080/amazonechocontrol/ URL
After login to amazon account you will get list of serial numbers:


then use it in .things config.
rest of the files:
.items

Group Alexa_Living_Room 
String Echo_Living_Room_TTS                    "Text to Speech"                        (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:textToSpeech"}
Dimmer Echo_Living_Room_TTS_Volume             "Text to Speech Volume"                 (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:textToSpeechVolume"}

and finally .rules where we wait 15s and check again for current state. If still OPEN then Alexa remind.

var Timer stopAlarmTimer = null
 rule "Warn if the door opens"
 when
     Item  GF_Sonoff_RF_Door_1 changed to OPEN
 then
  if (stopAlarmTimer === null)
     {
         stopAlarmTimer = createTimer(now.plusSeconds(15)) |             stopAlarmTimer.cancel()             stopAlarmTimer = null      if ( GF_Sonoff_RF_Door_1.state == OPEN ) {         Echo_Living_Room_TTS.sendCommand('Your fridge is still open')      }            
     }
 else { 
  return;
  }

For detailed tutorial please check my website or/and video above. I hope you find it useful.

1 Like