Giter VIP home page Giter VIP logo

pyduofern's Introduction

pyduofern

https://travis-ci.org/gluap/pyduofern.svg?branch=master https://coveralls.io/repos/github/gluap/pyduofern/badge.svg?branch=master

Disclaimer: this library is not endorsed by the company Rademacher, the manufacturer of home automation products under the label duofern. The name pyduofern was chosen to indicate the function of the library: communicating with duofern devices via python.

These are my efforts in porting the FHEM Duofern USB-Stick based module to Homeassistant. As of now the port is rather ugly, but it is usable enough to control my Duofern blinds. I did not port the Weather-Station related features of the original module -- Mainly because I do not own the corresponding hardware and have no means to test if it works. I only tested it with the model RolloTron Standard DuoFern 14233011 Funk-Gurtwickler Aufputz.

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.

This requires the Duofern USB Stick Art.-Nr.: 70000093 by Rademacher.

I do not provide any guarantees for the usability of this software. Use at your own risk.

License:

python interface for dufoern usb stick
Copyright (C) 2017 Paul Görgen
Rough python python translation of the FHEM duofern modules by telekatz
           (also licensed under GPLv2)
This re-write does not literally contain contain any verbatim lines
of the original code (given it was translated to another language)
apart from some comments to facilitate translation of the not-yet
translated parts of the original software. Modification dates are
documented as submits to the git repository of this code, currently
maintained at `https://github.com/gluap/pyduofern.git <https://github.com/gluap/pyduofern.git>`_

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA

Getting Started

Install via:

pip3 install pyduofern

or if you want the development version from github:

pip3 install git+https://github.com/gluap/pyduofern.git@dev

udev configuration

to make your usb stick easy to identify deploy an udev rules file in /etc/udev/rules.d/98-duofern.rules or the equivalent of your distribution. The following worked for my stick:

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="duofernstick"

Or, if you use several USB-Serial adapters with vendor 0403 and product 6001 find out the serial number of your stick (assuming it is currently registered as /dev/ttyUSB0`):

user@host:~ > udevadm info -a -n /dev/ttyUSB0 | grep '{serial}' | head -n1
ATTRS{serial}=="WR04ZFP4"

As you can se for me the serial is WR04ZFP4. Use the following udev line (use the serial you found above):

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="WR04ZFP4", SYMLINK+="duofernstick"

Once the rule is deployed your stick should show up as /dev/duofernstick as soon as you plug it in. This helps avoid confusion if you use other usb-serial devices. Also be warned: The line also makes the stick accessible to non-root users. But likely on your system you will be the only user anyhow.

Getting Started

To start using your stick you can use the duofern_cli.py script which should have been installed together with the pyduofern module. Begin by choosing a 4 hex-digit system code. If you have already used the roller shutters with FHEM use the last 4 digits of your FHEM code to preserve pairings. Ideally write it down, if you forget it, you will likely have to chose a new system code and reset your devices in order to be able to pair them again. It is also a security feature which is why no default is provided.

Decide for a system configuration file. By default it will reside as a hidden config file in your home directory in ~/.duofern.json. Pass the config file to duofern_cli.py via the command line option --configfile. The default has the advantage that you do not always have to pass the config file when using the script. Initialize the config file with your system code with the following command:

duofern_cli.py --code <your chosen 4 digit hex code here>
# or if you prefer your own configfile location
doufern_cli.py --code <your chosen 4 digit hex code here> --configfile <your config file path>

Now RTFM of the shutter to find out how to start pairing. Set the maximum and minimum positions according to the manual. If you want to experiment with the shutter first, chose the two positions very near each other. The motors shut down after a certain maximum runtime and you could exceed that while experimenting if you move the shutters up and down several times unless the min and max positions are close to each other.

Start out by pairing your first rollershutter:

duofern_cli.py --pair --pairtime 60

now initiate pairing via the buttons on your shutter. Once a shutter is paired it should show up in your config file and you can name it. Say the blind that popped up has the ID 408ea2, run the following to give it the name kitchen:

duofern_cli.py --set_name 408ea2 kitchen
# you can now try to also have it move up or down:
duofern_cli.py --up kitchen
# or try to set the position of a blind (0=down, 100=up)
duofern_cli.py --position 42 kitchen

Hopefully you now have working command line interface that knows how to move up or down your shutters. But the python interface can do more, (which I was so far too lazy to expose via the command line):

Indexing paired blinds

If you have the system code of your system but lost the list of configured blinds you can use the CLI to refresh the config file with all paired blinds.:

# assuming you lost the config file
duofern_cli.py --code <your code> --refresh --refreshtime 60

will start up the stick and listen for connecting blinds for 60 seconds. It will store all the blinds that were found in the default config file.a

Usage with Homeassistant

There is a custom component for homeassistant that can be easily deployed via hacs at https://github.com/gluap/pyduofern-hacs

Usage from python

from pyduofern.duofern_stick import DuofernStickThreaded
import time
stick = DuofernStickThreaded(device="/dev/duofernstick") # by default looks for /dev/duofernstick
stick._initialize() # do some initialization sequence with the stick
stick.start() # start the stick in a thread so it keeps communicating with your blinds
time.sleep(10) # let it settle to be able to talk to your blinds.
# your code here
# this uses internal variables of the duofern parser module and likely I will wrap it in
# the future.

print(stick.duofern_parser.modules['by_code']['1ff1d3']['position'])

command("1ff1d3", "up") # open the blind with code 1ff1d3

stick.command("1ff1d3", "down") # down the blind with code 1ff1d3

stick.command("1ff1d3", "stop") # stop the blind with code 1ff1d3

stick.command("1ff1d3", "position", 30) # set position of the blind with code 1ff1d3 to 30%

Look for an indication of possible commands in pyduofern/definitions.py I just translated them into python and did not explore what might be possible. It looks like a lot of functionality requires a weather station, but you can just as easily automate the stuff using your home automation and having it send the up and down commands instead of buying a weather station.

Changelog

0.36

  • add periodic requests for status updates.

0.36

  • add rudimentary tracking of successfully sent messages and resending of unacknowledged ones.

0.35.1

  • fix issue with crashes when "sets" was not defined because a bogous device type was present in duofern config.

0.35.0

  • limit message sending frequency.

0.34.3

  • Fix issue with asynchronous code in synchronous part of the code that was breaking homeassistant.

0.34.2

0.34.1

  • functionally equivalent to 0.34.0, removed shebangs where not required, moved unit tests outside of packaging

0.34.0

  • merge callback state updates for covers introduced by @DomiStyle in #21 to master

0.33.0

  • add smokedetector introduced by @DomiStyle in #20 to master

0.32.0

  • fix case to try and fix #18 for sensorMsg

0.30.0

  • breaking change: instead of creating multiple devices for single physical devices with multiple actor channels which was rather buggy add a channel parameter to the respective functions inpyduofern.duofern.Duofern() which allows to handle channels in a consistent manner. See discussion in #9 . For each device available channels are listed in in Duofern().modules['by_code'][code]['channels']. The default channel available for all devices is None, otherwise an int is expected.

0.25.2

  • try to fix #2

0.25.1

  • changed custom component to fix bug in switch implementation accidentally introduced recently.

0.25

  • restarted from 0.23 to get somewhat working auto detection

0.24

  • somewhat broken changes for auto detection

0.23.5

  • python 3.7 support should enable current hassio version

0.23.3

  • added --position to CLI

0.23.2

  • renamed README.rst and moved version number from setup.py to __init__.py

0.23.1

  • fixed references to repository url
  • upped version for pypi release

0.23

  • added recordings and increased coverage of unit tests (no result-based tests yet though -- just checking if every replay runs until the end without hanging)

0.22

  • Added recording of actions for replay in integration tests
  • Improved unit tests
  • Enable travis
  • Enable coveralls

0.21.1

  • fixed bug where device IDs containing cc would be be messed up when inserting channel number.

pyduofern's People

Contributors

creavalix avatar domistyle avatar fabaff avatar gluap avatar koalo avatar rakaandro avatar realbuxtehuder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyduofern's Issues

Error when sending command in Home Assistant 0.90.2

Hi,

I managed to get the new version running but when I send a command, this error shows up

2019-04-08 06:52:35 INFO (Thread-3) [/srv/homeassistant/lib/python3.6/site-packages/pyduofern/duofern_stick.py] sending 0D01070100000000000000000000006f301140106e00 from write queue, 0 msgs left in queue
2019-04-08 06:52:35 ERROR (Thread-3) [/srv/homeassistant/lib/python3.6/site-packages/pyduofern/duofern_stick.py] 'id'
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/pyduofern/duofern_stick.py", line 577, in run
    self.process_message(in_data)
  File "/srv/homeassistant/lib/python3.6/site-packages/pyduofern/duofern_stick.py", line 227, in process_message
    self.duofern_parser.parse(message)
  File "/srv/homeassistant/lib/python3.6/site-packages/pyduofern/duofern.py", line 521, in parse
    chan = msg[sensorMsg['id']['chan'] * 2 + 2:sensorMsg['id']['chan'] * 2 + 4]
KeyError: 'id'

Config

duofern:
  serial_port: /dev/cuaU2
  code: !secret duofern_code

Any clue? :D

RolloTube

Hi, I just came across your pyduofern. I own an old homepilot 1 and I would like to get rid of it and use it's DuoFern stick standalone. I have paired 13 Rollotube RTFM 10/16 Z Funk motors. All of them had a label with a 6-digit code for pairing and I also know the device codes that I use together with my homepilot's http-api. As I am afraid of a hardware breakdown I am looking for a solution to only use the duofern stick. I once saw the perl code from fhem but I don't use fhem (only openhab) and also I am not at all familiar with perl. I can read and write c, c++ and python.
Is it possible to use your python module on a raspberry pi or similar and communicate with the stick attached to the pi? I guess it would not be necessary to pair the motors again. Am I right? What functions do I have to use in order to send commands to my motors?
Best regards
Frank

Source tarball incomplete

The latest available source tarball from PyPI doesn't contain all files needed to run the tests.

]$ ls -lisa pyduofern-0.34.0/pyduofern/tests/
total 20
5661034 4 drwxr-xr-x. 5 x21 x21 4096 Sep  3 08:47 .
5661033 4 drwxr-xr-x. 3 x21 x21 4096 Sep  3 08:47 ..
5661035 4 drwxr-xr-x. 2 x21 x21 4096 Sep  3 08:47 files
5661036 4 drwxr-xr-x. 2 x21 x21 4096 Sep  3 08:47 recording
5661037 4 drwxr-xr-x. 2 x21 x21 4096 Sep  3 08:47 replaydata

duofern not working with Home assistant 0.89

Hi, I just updated to HA 0.89 and the duofern custom component stopped working.
I already tried to update to the latest version (commit 29a0505) but it fails to initialize.

Error log:

Error while setting up platform duofern
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/duofern/cover.py", line 20, in setup_platform
    stick = hass.data[DOMAIN]['stick']
KeyError: 'duofern'

my configuration.yaml:

cover:
  - platform: duofern
    serial_port: /dev/ttyUSB1
    config_file: duofern.json
    code: !secret duofern_code

Smoke detector not recognized

I got one of the Duofern smoke detectors (ER10018992 and 32001664) for testing and it doesn't seem to be recognized. The IDs are correctly defined in the definitions.py from what I can see.

Smoke detector: https://github.com/gluap/pyduofern/blob/master/pyduofern/definitions.py#L55

Start smoke: https://github.com/gluap/pyduofern/blob/master/pyduofern/definitions.py#L76
End smoke: https://github.com/gluap/pyduofern/blob/master/pyduofern/definitions.py#L77

Pairing:

homeassistant_1  | 2020-08-20 11:53:24 WARNING (SyncWorker_37) [custom_components.duofern] start pairing
homeassistant_1  | 2020-08-20 11:53:24 INFO (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py] sending 04000000000000000000000000000000000000000000 from write queue, 0 msgs left in queue
homeassistant_1  | 2020-08-20 11:53:32 INFO (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py] got pairing reply
homeassistant_1  | 2020-08-20 11:53:32 INFO (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern.py] detected unknown device, ID=ab49b6
homeassistant_1  | 2020-08-20 11:53:32 INFO (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern.py] DUOFERN device paired, ID ab49b6
homeassistant_1  | 2020-08-20 11:53:32 INFO (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py] paired new device 40535c
homeassistant_1  | 2020-08-20 11:53:32 INFO (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py] paired new device 40bb37
homeassistant_1  | 2020-08-20 11:53:32 INFO (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py] paired new device ab49b6
homeassistant_1  | 2020-08-20 11:53:54 INFO (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py] sending 05000000000000000000000000000000000000000000 from write queue, 1 msgs left in queue
homeassistant_1  | 2020-08-20 11:53:54 INFO (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py] sending 05000000000000000000000000000000000000000000 from write queue, 0 msgs left in queue

Test alarm:

homeassistant_1  | 2020-08-20 12:11:38 WARNING (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern.py] unknown message 0fff071e0100010000000000100002ab49b66f8d1c00
homeassistant_1  | 2020-08-20 12:11:38 ERROR (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py] '071e'
homeassistant_1  | Traceback (most recent call last):
homeassistant_1  |   File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py", line 595, in run
homeassistant_1  |     self.process_message(in_data)
homeassistant_1  |   File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py", line 227, in process_message
homeassistant_1  |     self.duofern_parser.parse(message)
homeassistant_1  |   File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern.py", line 562, in parse
homeassistant_1  |     chan = msg[sensorMsg[id]['chan'] * 2 + 2:sensorMsg[id]['chan'] * 2 + 4]
homeassistant_1  | KeyError: '071e'
homeassistant_1  | 2020-08-20 12:12:24 WARNING (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern.py] unknown message 0fff071f0100010000000000100002ab49b66f8d1c00
homeassistant_1  | 2020-08-20 12:12:24 ERROR (Thread-4) [/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py] '071f'
homeassistant_1  | Traceback (most recent call last):
homeassistant_1  |   File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py", line 595, in run
homeassistant_1  |     self.process_message(in_data)
homeassistant_1  |   File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py", line 227, in process_message
homeassistant_1  |     self.duofern_parser.parse(message)
homeassistant_1  |   File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern.py", line 562, in parse
homeassistant_1  |     chan = msg[sensorMsg[id]['chan'] * 2 + 2:sensorMsg[id]['chan'] * 2 + 4]
homeassistant_1  | KeyError: '071f'

Might just be looking for lowercase 071e and 071f but they are uppercase in definitions.py.

add a step in the documentation for non programmers like me

Hi
Thank you for you great work.
I followed your readme file for the installation with Hassio and had an issue where the duofern was not initialized properly. After looking around in the code I found that in the init python file two lines were mentioning /dev/serial/by-id/usb-Rademacher_DuoFern_USB-Stick_WR04ZFP4-if00-port0
but in the gui in the hardware tab mine said /dev/serial/by-id/usb-Rademacher_DuoFern_USB-Stick_WR029BQK-if00-port0.

I replaced these two mentions with the one I got and it's working like a charm.

Maybe add this step in your documentation so that other n00bs like me don't search what they did wrong for hours.

Keep up the good work and thanks again

[Question]: No stop command for the CLI?

Hi,
Python is completely new for me and I just managed to pair my five roller shutter motors and I am able to open and close them. Amazing work, thank you so far!

But I didn't find an option in the duofern_cli.py script to STOP a moving motor.
The example for home assistant implies that it's possible that it should possible.
Is there something I overlooked or is it not possible via the CLI?

Thank you!

Rademacher changed pairing codes from 6 digits to 10 digts

I have bought a RolloTube I-line Duofern Medium roller shutter. Unfortuantely Rademacher has changes the pairing code from 6 digits to 10 digits.
Pairing isnot possible and I got errors:

Output:
entering pairing mode
2021-07-04 18:23:45,858: sending 04000000000000000000000000000000000000000000 from write queue, 0 msgs left in queue
2021-07-04 18:23:46,386: got pairing reply
2021-07-04 18:23:46,386: detected unknown device, ID=XXXXXX
2021-07-04 18:23:46,388: DUOFERN device paired, ID XXXXXX
2021-07-04 18:23:46,393: paired new device XXXXXX
2021-07-04 18:23:48,178: Unknown msg: 0fff0606000112400301000000000XXXXXXYYYYYY
2021-07-04 18:23:53,249: DUOFERN unknown msg: YYYYYYce3005a1a1100000000000XXXXXXXffffff01
2021-07-04 18:24:45,621: sending 05000000000000000000000000000000000000000000 from write queue, 1 msgs left in queue
2021-07-04 18:24:45,640: sending 05000000000000000000000000000000000000000000 from write queue, 0 msgs left in queue

Question - no issue

Hi, first thank you for your efforts! Currently I havent bought products from rademacher, but I want to.
I just want to be sure that I have understood the project correctly before buying something that expensive.

When I am going to buy rolltron products (for example the rademacher rolltron 1200), then I will only need the duofern usb stick plugged into my raspberry pi running Homeassistant OS and with this custom integration it should work?
I just want to be sure, that Homeassistant OS will work fine and that I dont need another bridge from rademacher.

Are the „ DuoFern Heizkörperstellantrieb 2 “ also supported?

Thank you in advance for answering the questions :)

default could be more broad

found a new device ID for another USB Stick.

/dev/serial/by-id/usb-Rademacher_DuoFern_USB-Stick_WR04ZFNM-if00-port0

trying to get 6way wallswitch type 'ad' to work

I have started some work to get this running in my branch of your project
https://github.com/bugfinder/pyduofern

apparently all ids some in as lowercase on my system, maybe the items you tested were
all numerical up to now.

with my changes and a little debug code I can get the ID of the pushed button, but now
I do not have enough knowledge of home-assistant (or actually of python in general ...)
to get this working as a usable sensor in HA.

what I get with debugging is:
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster msg: 0f01071a0000010300000000040002ad23116faffe00
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster code: ad2311
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster chan: 03
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster id: 071a
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster chans: ['03']
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster msg: 0f01071a0000010400000000040002ad23116faffe00
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster code: ad2311
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster chan: 04
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster id: 071a
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster chans: ['04']
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster msg: 0f01071a0000010500000000040002ad23116faffe00
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster code: ad2311
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster chan: 05
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster id: 071a
[/usr/lib/python3.6/site-packages/pyduofern/duofern.py] DUOFERN taster chans: ['05']

so I do get the action "071a" -> "pressed" as "id" and the button number
between "01" and "06" as "chan".

how to continue from there ?

Rademacher USB stick timeout when activating pairing mode (green LED is constantly blinking)

Hello,

thanks for all your great efforts for bringing great functionality to the world!

Done so far:

Followed your manual to for udev using the serial.
Reinserted the stick: alias works

Issue:

Initializing the stick with "duofern_cli.py --code <your chosen 4 digit hex code here>" shows "Permission denied for TtyS0".
Can be fixed with chmod a+rw.
-> then works. However I don't get why this is necessary (and it's also not pointed out in your manual).
When starting pairing mode with "duofern_cli.py --pair --pairtime 60" then following exception is thrown:
entering pairing mode
Traceback (most recent call last):
File "/home//.local/bin/duofern_cli.py", line 301, in
stick._initialize()
File "/home//.local/lib/python3.7/site-packages/pyduofern/duofern_stick.py", line 550, in _initialize
raise DuofernTimeoutException("Initialization failed ")
pyduofern.exceptions.DuofernTimeoutException: Initialization failed

Please note that the stick is constantly blinking the green LED. When insterted for few seconds the red & green LEDs are constantly on, then only the green LED is blinking and the red one is off.

THANK YOU SO MUCH FOR YOUR SUPPORT!!!

ModuleNotFoundError

I don't know what happened, but when I try to to start the script, I get the following error:

Traceback (most recent call last):
  File "/home/openhabian/.local/bin/duofern_cli.py", line 26, in <module>
    from pyduofern.duofern_stick import DuofernStickThreaded
ModuleNotFoundError: No module named 'pyduofern'

I'm an absolute noob in python, but when I try to install the package it looks fine:

openhabian@openHABianPi:/ $ pip3 install pyduofern
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pyduofern in /home/openhabian/.local/lib/python3.7/site-packages (0.34.1)
Requirement already satisfied: pyserial-asyncio in /home/openhabian/.local/lib/python3.7/site-packages (from pyduofern) (0.5)
Requirement already satisfied: pyserial in /home/openhabian/.local/lib/python3.7/site-packages (from pyduofern) (3.5)
openhabian@openHABianPi:/ $

Where's my mistake/problem? Thanks!

Cover position undefined in Home Assistant after upgrade from 0.30 to 0.34.1

Hello gluap,

I use the custom component for Home Assistant since quite some time and it was rock solid until the switching to 0.34.1.
I did not change anything than replacing the duofern folder in custom_components.

Home Assistant throws this warning at me, but I have no clue how to fix it.

Logger: /usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py
Source: /usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py:597
First occurred: 9:48:55 PM (1 occurrences)
Last logged: 9:48:55 PM

update_callback() missing 3 required positional arguments: 'id', 'key', and 'value'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py", line 595, in run
    self.process_message(in_data)
  File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern_stick.py", line 227, in process_message
    self.duofern_parser.parse(message)
  File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern.py", line 203, in parse
    self.update_state(code, "version", ver, "0", channel=channel)
  File "/usr/local/lib/python3.8/site-packages/pyduofern/duofern.py", line 128, in update_state
    self.changes_callback()
TypeError: update_callback() missing 3 required positional arguments: 'id', 'key', and 'value'

Hope you'll find some time to look into that, I'll revert to 0.30 for now.

Thank you in advance!

Home Assistant Component: Logger Warning

There is a new logger warning with 0.109:

2020-04-30 11:58:57 WARNING (MainThread) [homeassistant.helpers.translation] duofern: the '.translations' directory has been moved, the new name is 'translations', starting with Home Assistant 0.111 your translations will no longer load if you do not move/rename this

Solution:
rename
pyduofern/examples/homeassistant/custom_components/duofern/.translations/
to
pyduofern/examples/homeassistant/custom_components/duofern/translations/

Adding "Duofern Umweltsensor 9475" und "Duofern Connect Aktor 9477"

Hi,

is there a possibility to add the Duofern Umweltsensor 9475 and the Duofern Connect Aktor 9477 to your plugin. Would be great to make automations directly in Hass/HA with the weather informations. Would be great to, I can close my Markise if it starts raining or its to much windy.

In the duofern.json I can see that the Umweltsensor and the Connect aktor are connected yet. Maybe there are only the configuration lost and it is easily for you!?

TypeError: object.__init__() takes no parameters

Hi,

first of all, thanks for this great implementation!
I got everything working on the command line, and I am now trying to get access directly from python working.

Executing your example

from pyduofern.duofern_stick import DuofernStick
import time
stick = DuofernStick(device="/dev/duofernstick") # by default looks for /dev/duofernstick
stick_initialize() # do some initialization sequence with the stick
stick.start() # start the stick in a thread so it keeps communicating with your blinds
time.sleep(10) # let it settle to be able to talk to your blinds.
# your code here
# this uses internal variables of the duofern parser module and likely I will wrap it in
# the future.

print(stick.duofern_parser.modules['by_code']['1ff1d3']['position'])

.. throws error:

Traceback (most recent call last):
  File "rollo_test.py", line 4, in <module>
    stick = DuofernStick(device="/dev/duofernstick") # by default looks for /dev/duofernstick
  File "/usr/local/lib/python3.5/dist-packages/pyduofern/duofern_stick.py", line 85, in __init__
    super().__init__(*args, **kwargs)
TypeError: object.__init__() takes no parameters

/dev/duofernstick is available on my system.

Removing the "device="/dev/duofernstick" part from stick object creation code, leaving "stick = DuofernStick()", throws error:

Traceback (most recent call last):
  File "rollo_test.py", line 5, in <module>
    stick = DuofernStick() # by default looks for /dev/duofernstick
  File "/usr/local/lib/python3.5/dist-packages/pyduofern/duofern_stick.py", line 92, in __init__
    duofern_parser = Duofern(send_hook=self.add_serial_and_send, changes_callback=changes_callback)
AttributeError: 'DuofernStick' object has no attribute 'add_serial_and_send'

Any idea what I am doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.