How to integrate the XTU J5 Video Doorbell into HomeAssistant

How to fully integrate the XTU J5 Video Doorbell into HomeAssistant

The XTU J5 video doorbell is an excellent choice at the price point (£60 delivered (UK)). WiFi connection, 12v Wired power supply and a USB powered wireless chime.

I purchased this particular model as it was stated on another forum that the unit supports ONVIF and RTSP, with the intention of being able to integrate into my HomeAssistant setup.

This is where I encountered a problem with the XTU J5, while the device supports ONVIF, which allows the camera stream to be viewed in HA. The device (as far as I’m aware) has no method of triggering events within HA.

Below is a guide on how to hack the XTU J5 USB powered wireless chime, it will require additional hardware and some soldering.

Parts Required:

  • Wemos D1 Mini
  • 30awg wire

Software Required:

Tools Required:

  • Soldering Iron
  • Multimeter
  • Mini Phillips screwdriver
  • Mini Flathead screwdriver

HomeAssistant Integrations Required:

  • ONVIF
  • ESPHome
  • MQTT Broker

HomeAssistant Addons Required:
SambaShare (for easy access to .yaml files)
Mosquitto MQTT broker

  1. Download CloudEdge app from Google Play or Apple App Store.

  2. Follow the instructions contained within the QuickStart guide that came with the device. (This will get the doorbell and USB powered chime up and running and connected to your local WiFi) your device should now be fully functional through the app.

  3. Allow ONVIF (It isn’t automatically enabled so need to be turned on in the CloudEdge app settings. This can be found by selecting your device in the app (doorbell) you should then see a preview of your Camera with LIVE/HISTORY/CLOUD. In the top right hand corner you should see a hexagon shape settings button (Settings > Advanced Features > ONVIF Settings > Turn on)

  4. Edit configuration.yaml - (Having installed and started SambaShare you will be able to view HA configuration files within Windows File Explorer.

  • open File Explorer

  • In the address bar at the top type \192.168.X.XXX (HA IP address)

  • Config > Configuration.yaml (open with notepad++) at the bottom of the Configuration.yaml file add the following lines of code.

  • Replace username and password with those set up for the Doorbell, The IP address is that of the doorbell too. Then save and close file.

camera:
- platform: generic
name: Doorbell
still_image_url: rtsp://USERNAME:[email protected]:8554/streaming/channels/102
streamsource: rtsp://USERNAME:[email protected]:8554/streaming/channels/102

Its worth noting here that the still_image_url & streamsource also transmit on channels 101, which didnt work correctly for me.

  1. Add a Picture Entity card in HA dashboard, select camera.doorbell entity (you should now be able to see the Doorbell Camera feed in the HA dashboard.

  2. Configure MQTT broker integration

  • note down the Username & Password you will need it later on, in this example it will be: mqtt / mqtt
  1. Now it’s to prepare the hardware, we will use a Wemos D1 Mini to measure for any voltage change when the button on the doorbell is pressed. The fact that the XTU J5 uses a USB powered wireless chime makes this much easier.
  • use a mini flathead screwdriver to gently prise apart the casing for the chime.
  • Remove the 2 Mini Phillips screws to remove the circuit board.
    At this point I spent a significant amount of time with a multimeter working out which pins normally LOW are HIGH when the doorbell is pressed. Knowing this we can send high low votlage signals to D1 mini. The pins on the chips on this devices are quite small which is why i opted to use the USB power and Speaker cables. They have connectors on the board which makes life a lot easier. Measuring the voltage through the speaker connector I was able to establish when the doorbell is pressed 3.45v passed to the speaker.

we can now prepare and program the D1 Mini. You will need to solder 3 wires to the D1.

  • 5v
  • Ground
  • Pin D0 (D Zero)
  1. Compile Wemos D1 Mini firmware
  • Open ESPHome in HomeAssistant
  • Click the + in the bottom right of your screen
  • Enter a name for your device. In this case I used ‘doorbell’
  • Fill in your wifi credentials
  • Click Next to see you newly created device in ESPHome
  • Click Edit (to configure doorbellmcu.yaml)
  • Type the following code.
esphome:
  name: doorbell
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: 'XXXX'
  password: 'XXXX'
  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Doorbell Fallback Hotspot"
    password: "XXXX"
captive_portal:


mqtt:
  broker: '192.168.0.XXX'
  username: 'mqtt'
  password: 'mqtt'
logger:

ota:
  password: 'XXXX'

binary_sensor:
  - platform: gpio
    name: "Doorbell"
    pin:
      number: D0
      inverted: False
      mode: INPUT_PULLDOWN_16
    filters:
        - delayed_off: 5s

This code will need adapting to your network settings, provide your Network SSID & Password and IP address of HomeAssistant.

  • If the Wemos D1 cannot connect to the WiFi network it will broadcast its own so that you can connect for admin purposes. In this example the SSID is “Doorbell fallback hotspot” this SSID and PASSWORD can be set to what ever you wish.
  • We will set up an MQTT broker to send the triggers to HA as you can see in this example the username and password have been set to mqtt
  • Once amended, Hit “SAVE” and “CLOSE”
  • In ESPHome within the doorbell tile, click the 3 dots in the top right, select “COMPILE”

If you have no syntax errors and it compiles without issue there will be a option in the bottom right hand corner to “DOWNLOAD BINARY”

  • Download the binary file (we will use this file to flash the firmware to the D1 Mini)
  1. Flash Wemos D1 Mini with custom firmware just created.
  • Open EspHomeFlasher
  • Select D1 Mini from drop down menu.
  • Select COM port which the device is attached to (you may need to install drivers if the device does not show up under the drop down menu).
  • Upload Binary file just created
  • WRITE to device
  • In the compiler window you should see that once the write is complete, the device if it is functioning correctly that its connected to the Wifi network and the Mqtt is running.
  1. Connect Wemos D1 Mini to USB chime.
  • Splice and solder 5v power from Wemos to 5v USB power on chime
  • Splice and solder Ground wires from Wemos to USB Ground on chime.
  • Splice and solder D0 pin wire on Wemos to speaker positive wire on chime.
  1. Put it back together! You should now use the binary sensor entity to trigger commands based on a button press of the doorbell.
3 Likes

Hi Dan
I’ve just come across this as I searched for video doorbells. It looks very interesting.

How did you get on with this?

Gareth

Hi Gareth. no issues so far, does everything I need it to.

@jeffman2
Hi Dan,

Does the bell enclosure has enough space to accommodate D1 or did you have to make a case for the D1?

Just curious what the final contraption looks like physically at the door - my wife would not let me do anything till I show her the final product!!

Thanks,

Just did this to mine with great consistent results. Was previously using last notification that proved very unreliable.

Thanks for the write up.

The D1 goes inside the chime.