Doorbell, MQTT and open hab

Hello,

I have setup a doorbell using MQTT. I now want to get the openhab to alert me when someone presses a doorbell. Whats the best way of achieving this?

I’ve used a ESP8266 mini d1 and that sends a signal to MQTT when the doorbell is pressed. I can listen to the topic I’ve setup (“Home/Hallway/sensor/Door/Bell”) using MQTTFX. I’ve struggled to find something that will help me setup the open hab side of notifying me.

For the MQTT part:

http://docs.openhab.org/addons/bindings/mqtt1/readme.html

For the notification:

http://docs.openhab.org/addons/actions.html

  • NotifyMyAndroid, Prowl, Pushover, et.
  • look at Audio Actions for audible alerts
  • look at openHAB Cloud Connector to get alerts from your phone app directly

Thanks so much for replying :slight_smile: I already edited the services/mqtt.cfg file with details of MQTT server. The MQTT message that is sent from ESP 8266 is “Home/Door/sensor/Door/Bell” and the entry is “Someone has pressed the bell”.

From the document you sent, the link below looks like I should add, what should I change this to for the MQTT message I’m sending?

Switch doorbell “bell [%s]” {mqtt=“<[mybroker:myHome/doorbell:command:ON]”}

Put your topic in instead of the example’s topic.

You probably want to use a MAP transform to convert the message being sent to ON.

OK brill, ive changed the source message to match the destination format "Home/1stFloor/Hallway/FrontDoor/Bell/ " “ON” and added the line below to services/mqtt.cfg

Switch doorbell “bell [%s]” {mqtt=“Switch doorbell “bell [%s]” {mqtt=”<[openhabbroker:Home/1stFloor/Hallway/FrontDoor/Bell:command:ON]"}

Where do I enter the actions openHAB Cloud Connector so i can get alerts to it when the doorbell is pressed? I have previously setup the cloud configuration and I get notifications if say the internet goes down and it looses the connection to openhab.

Create a rule and call the actions in the rule.

http://docs.openhab.org/tutorials/beginner/index.html

Thanks, I’ve been following through the instructions buts its showing the router as offline in basic map ive created even though it shows as online in paper UI → control menu:

Here’s what ive setup

Default.Items:

Switch Router_Active “Router” { channel=“network:device:192_168_1_1:online” }

Default.sitemap

sitemap default label="My first sitemap"
{
    Switch item=Router_Active label="Router"
}

Basic site map

paper ui → control

maybe this will help setting up the mqtt part in openhab

I’ve been trying to figure out why router is showing offline. The only thing I’ve noticed is that the symbol I have on the basic ui is a power symbol (even though I’ve set it to network) and the picture on tutorial is a network symbol. Any ideas why im not getting the network symbol?

You have a Switch and you did not specify the icon. By default all Switches use the power symbol as its icon.

http://docs.openhab.org/configuration/items.html