Hypfer / pyduofern-hacs

Repository managing hacs-integration for pyduofern

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyduofern-hacs

This repository contains hacs integration for pyduofern.

As reported in #31 10-Digit codes recently announced by Rademacher are not supported as of now as the handshake/ protocol for these devices was not reverse engineered by anyone as far as I know.

You can use this repo with hacs

Setting up pyduofern in hacs

  1. In HACS->Integrations on the top right click on and select custom repositories.

  2. Add a repo with URL https://github.com/gluap/pyduofern-hacs and type integration

  3. Back in HACS->Integrations search for duofern

  4. In Homeassistant go to Configuration -> Integrations, click the + sign to add an integration and search for dufoern

  5. Complete the setup dialog

Setup with homeassistant core (no Homeassistant OS)

To use pyduofern within Homeassistant, add the custom_components from https://github.com/gluap/pyduofern-hacs to ~/.homeassistant/ directory and enable it by adding the following to your configuration.yaml::

duofern:
   # (4 hex digits as code required, last 4 digits if migrating from FHEM, 10 digit devices are not supported as of now)
   code: deda
   # Optional options, comment in if required:
   # serial_port: /dev/ttyUSB0
   #   # serial_port defaults to
   #   # /dev/serial/by-id/usb-Rademacher_DuoFern_USB-Stick_WR04ZFP4-if00-port0
   #   # which should work on most linuxes
   # config_file: ~/duofern.json
   #   # config_file defaults to duofern.json in homeassistant folder (assuming custom_component is used)

Usage

There are some services you can call via the service interface. A few of these to get you started:

duofern.start_pairing starts the pairing mode for a given number of seconds.

Pairing

duofern.sync_devices will force-sync any newly discovered devices.

sync

Please use the renaming feature in the homeassistant GUI to arrive at human readable names for your deices.

duofern.ask_for_update

Ask duofern devices to re-send their state in case. Can be used in setups where RF is finnicky.

duofern.dump_device_state Dump the current last received state for all duofern modules as a warning level message to the log. This reflects the current state of all RF messages received from devices - What's not here wasn't received by the stick or came in garbled.

duofern.clean_config

Warning You should absolutely NOT use it if you have been running duofern for a long time and your covers have "human" names in the .duofern.json file. That option hasn't been used for a long time though - it is still from the time when homeassistant had no UI way of renaming entities/devices.

Use when:

  • you have "ghost" devices that do not correspond to a physical device

Use like this:

  • If you want to be sure you can go back: backup duofern.json.
  • Call duofern.clean_config.
  • Restart homeassistant.
  • Observe that all your duofern devices are now disabled/unavailable.
  • Toggle/move all your duofern devices at the device to make sure that they send messages for homeassistant to pick up.
  • You can diagnose what devices were picked up again using duofern.dump_device_state.
  • Once all devices are there: call duofern.sync_devices.
  • Restart homeassistant for good measure.
  • Observe that the devices are now back.
  • If some are still missing: toggle them at the device and diagnose using dump_device_state until they are found again.
  • Once they are: duofern.sync_devices, final restart.
  • Everything works.
  • If not: maybe you want to return to your backed-up duofern.json.

The duofern python module keeps a list of devices that are paired. clean_config throws that list away.

In normal operation, the list should rebuild itself - whenever a message is received from a device that was previously paired it should appear in the list. It's not very well tested because it's not a common situation. I ran it, restarted homeassistant, and my devices became available again after a few seconds.

About

Repository managing hacs-integration for pyduofern

License:MIT License


Languages

Language:Python 100.0%