As a learning exercise, I have written a more featureful Home Assistant integration for the Camect Hub.
It provides fully-fledged devices and entities for the hub, its cameras, and motion detection alerts, making it much easier and quicker to setup automations for these events.
Many thanks to the Camect team for providing something I could learn from with their original Home Assistant code, and for their camect-py library.
As this is still fairly new code, I can't promise it's flawless. It's been working great for me for a few weeks, however YMMV 😊. If you run into bugs please open an issue on GitHub.
- Fully visible and configurable within Home Assistant
- Hub mode control (Normal or At Home)
- Full devices for each camera
- Motion sensors within each camera's device
- Detected object attribute within each camera
- Individual camera alert control
- Automatic addition of cameras added to the Hub
- Appropriate device statuses of cameras and switches if a camera goes offline
- Continues to receive events from Camect's event bus to utilise within Home Assistant
- Should support multiple hubs (however I've not yet been able to verify this as I only own one)
- Home Assistant 2022.9 or later
- A Camect Hub device
- Administrative access to your Hub
- Network access between Home Assistant and your Hub
If you have the original Camect integration installed, you'll need to archive or delete it from your Home Assistant custom_components
directory, remove the configuration lines from configuration.yaml
, and clean up the orphaned camera entities from Home Assistant.
Using HACS to install is the recommended method. Add the URL for this repo as a custom repository, and then install it using the Explore & Download button.
Ensure you pick the correct repo, as there's a similar one for the original Camect team's code. Look for this repo's description; "Camect Hub integration for Home Assistant / HACS".
Copy custom_components/camect
from this repo into your Home Assistant /config/custom_components
directory.
If you install it manually you might need to add one line to your configuration.yaml
before Home Assistant will detect it:
camect:
- Add a local account (not a "cloud" account like Google) to your Hub for the integration to authenticate with.
- Once the integration is installed in Home Assistant, add the integration from your Settings -> Integrations page and search for Camect.
- Fill in the username and password you setup above.
- Assuming it successfully connects after submitting the form, the integration will ask you to set the areas (rooms) for the Hub and every camera it finds.
You can listen for camect_event
to trigger automations in Home Assistant and use the different attributes in trigger.event.data
to get more information about the event. For example,
- id: 'Motion detected'
alias: Motion detected
description: 'Sends a notification when motion is detected'
trigger:
platform: event
event_type: camect_event
event_data:
type: alert
action:
service: script.notify_phone
data_template:
message: '{{ trigger.event.data.raw_data[''desc''] }}'
url: '{{ trigger.event.data.raw_data[''url''] }}'