Skip to content

Home Assistant custom component for Beward security Cameras and Doorbells

License

Notifications You must be signed in to change notification settings

Limych/ha-beward

Repository files navigation

Please ⭐ this repo if you find it useful

ha-beward

GitHub Release GitHub Activity License

hacs Project Maintenance Support me on Patreon

Community Forum

This implementation allows you to integrate your Beward surveillance devices to Home Assistant.

Beward Logo

There is currently support for the following device types within Home Assistant:

Currently only doorbells are supported by this integration.

I also suggest you visit the support topic on the community forum.

Installation

Install from HACS (recommended)

  1. Have HACS installed, this will allow you to easily manage and track updates.
  2. Search for "Beward".
  3. Click Install below the found integration.
  4. If you want to configure component via Home Assistant UI...
    in the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Beward".
  5. If you want to configure component via configuration.yaml...
    follow instructions below, then restart Home Assistant.

Manual installation

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called beward.
  4. Download file beward.zip from the latest release section in this repository.
  5. Extract all files from this archive you downloaded in the directory (folder) you created.
  6. Restart Home Assistant
  7. If you want to configure component via Home Assistant UI...
    in the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Beward".
  8. If you want to configure component via configuration.yaml...
    follow instructions below, then restart Home Assistant.

* * *

I put a lot of work into making this repo and component available and updated to inspire and help others! I will be glad to receive thanks from you — it will give me new strength and add enthusiasm:


Patreon
or support via Bitcoin or Etherium:
Bitcoin
16yfCfz9dZ8y8yuSwBFVfiAa3CNYdMh7Ts

Configuration

To integrate Beward device, add the following to your configuration.yaml file:

# Example configuration.yaml entry
beward:
  - host: HOST_ADDRESS_CAMERA
    username: YOUR_USERNAME
    password: YOUR_PASSWORD

Configuration variables

host:
(string) (Required)
The IP address or hostname of your Beward device. If using a hostname, make sure the DNS works as expected.

username:
(string) (Required)
The username for accessing your Beward device.

password:
(string) (Required)
The password for accessing your Beward device.

name:
(string) (Optional) (Default value: "Beward <device_id>")
This parameter allows you to override the name of your Beward device in the frontend.

port:
(integer) (Optional) (Default value: 80)
The port that the Beward device is running on.

rtsp_port:
(integer) (Optional) (Default value: Autodetect from the device)
The RTSP port that the Beward camera is running on.

stream:
(integer) (Optional) (Default value: 0)
Number of video stream from Beward device.

ffmpeg_arguments:
(string) (Optional) (Default value: "-pred 1")
Extra options to pass to ffmpeg, e.g., image quality or video filter options.

Note: To be able to playback the live stream, it is required to install the ffmpeg component. Make sure to follow the steps mentioned at FFMPEG documentation.

cameras:
(list) (Optional) (Default value: all cameras below)
Camera types to display in the frontend. The following cameras can be added:

live:
Live view camera.

last_motion:
Camera which store photo of last motion.

last_ding:
Camera which store photo of last visitor.

binary_sensors:
(list) (Optional) (Default value: None)
Conditions to display in the frontend. The following conditions can be monitored:

online:
Return on when camera is available (i.e., responding to commands), off when not.

motion:
Return on when a motion is detected, off when not.

ding:
Return on when a doorbell button is pressed, off when not.

sensors:
(list) (Optional) (Default value: None)
Conditions to display in the frontend. The following conditions can be monitored:

last_activity:
Return the timestamp from the last event captured (ding/motion/on demand) by the Beward device camera.

last_motion:
Return the timestamp from the last motion event captured by the Beward device camera.

last_ding:
Return the timestamp from the last time the Beward doorbell button was pressed.

* * *

I put a lot of work into making this repo and component available and updated to inspire and help others! I will be glad to receive thanks from you — it will give me new strength and add enthusiasm:


Patreon
or support via Bitcoin or Etherium:
Bitcoin
16yfCfz9dZ8y8yuSwBFVfiAa3CNYdMh7Ts

Advanced Configuration

You can also use this more advanced configuration example:

# Example configuration.yaml entry
beward:
  - host: HOST_ADDRESS_CAMERA_1
    username: YOUR_USERNAME
    password: YOUR_PASSWORD
    binary_sensors:
      - motion
      - online
    sensors:
      - last_ding

  # Add second camera
  - host: HOST_ADDRESS_CAMERA_2
    username: YOUR_USERNAME
    password: YOUR_PASSWORD
    name: "Back door"
    rtsp_port: 1554
    camera:
      - last_motion

Usage tips

Send history image via Telegram

You can use photos of the last motion and the last ding outside this integration. For example, send it via Telegram.

History images are stored in /config/.storage/beward/. For example, for a camera named "Front door" there will be files front_door_last_motion.jpg and front_door_last_ding.jpg.

Automation example (see the Telegram documentation for more details how to send images):

# Example configuration.yaml entry
homeassistant:
  whitelist_external_dirs:
    - /config/.storage/beward  # Required for Home Assistant version 0.48+

automation:
  - alias: "Front door Ding"
    trigger:
      platform: state
      entity_id: binary_sensor.front_door_ding
      to: 'on'
    action:
      - service: notify.NOTIFIER_NAME
        data:
          message: "The doorbell is ringing!"
          data:
            photo:
              file: /config/.storage/beward/front_door_last_ding.jpg
              caption: "The doorbell is ringing!"

Track updates

You can automatically track new versions of this component and update it by HACS.

Troubleshooting

To enable debug logs use this configuration:

# Example configuration.yaml entry
logger:
  default: info
  logs:
    custom_components.beward: debug

... then restart HA.

Contributions are welcome!

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

We have set up a separate document containing our contribution guidelines.

Thank you for being involved! 😍

Authors & contributors

The original setup of this component is by Andrey "Limych" Khrolenok.

For a full list of all authors and contributors, check the contributor's page.

This Home Assistant custom component was created and is updated using the HA-Blueprint template. You can use this template to maintain your own Home Assistant custom components.

License

MIT License

Copyright (c) 2019-2022 Andrey "Limych" Khrolenok

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.