Custom component for HNAP devices (motion sensors, sirens, etc)

Hi everyone, I want to show my first serious integration: hnap-device.

This is a Work in Progress integration to Home Assistant supporting HNAP devices. It communicates locally with the devices, i.e. no cloud needed, but only supports polling (it can’t configure anything on devices).

Theorically all HNAP devices are supported, however only a few are really tested:

  • D-Link Motion Sensor (DCH-S150)
  • D-Link Siren Device (DCH-S220)

Currently motion sensors and sirens are the only platforms implemented but support for cameras or water detectors are really easy to implement.

This integration uses modern features from HomeAssistant like UI config.

It can be tested as custom_component or using HACS

Feedback is welcome, thanks!

3 Likes

Any ideas how to get it work? After the setup up under settings there is the message: “no devices or entities”.
pls help!

thx in advance

You need to add manually from the integrations page with the button “Add integration” and fill required data.

I did, but then there is an error with: “no devices or entities”. If i enter invalid credentials or an invalid host, there is another error, so it seems to work a bit.

edit: here is the log:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant.config_entries
Source: custom_components/hnap_device/init.py:62
Integration: HNAP device (documentation, issues)
First occurred: 09:09:39 (3 occurrences)
Last logged: 18:21:20

Error setting up entry DCH-S220 for hnap_device
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 390, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/hnap_device/init.py”, line 62, in async_setup_entry
hass.config_entries.async_setup_platforms(entry, entry.data[CONF_PLATFORMS])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘ConfigEntries’ object has no attribute ‘async_setup_platforms’

Thanks for the logs @trustno1foxm

I just published a new release, it should fix the problem.

Thank you so much! I just installed the new version and it works! :partying_face:
It’s so nice because I can use the device even longer!

Thank you!

so long

1 Like