[Custom Component] tedee Doorlock

@Konrad-Tedee: I know that the wish of a handful users Tedee won’t fulfill. But I don’t understand why we would need to build a SMTP server, if we would have the direct access to the bridge? Establish a connection to the bridge with an own generated long living secret token? No cloud services would be needed for that.

And? I’m tired of manual installation after each update.

It’s on https://test.pypi.org/project/pytedee/ now.
Once I get response that install it from there works, I will push it to real pypi.org.

BTW. I don’t need to install it every time I make an update. It stays there and only need to be installed new, if requirements of version change.
My HA lives in a venv environment. The easiest way to administrate it.

In docker you have to install it again as fresh docker container is deployed upon upgrade

Works just fine - you can move to prod:

bash-5.0# pip list | grep tedee

bash-5.0# pip install -i https://test.pypi.org/simple/ pytedee
Looking in indexes: https://test.pypi.org/simple/
Collecting pytedee
  Downloading https://test-files.pythonhosted.org/packages/34/37/d980a2852ee4633bbf87d0d94e6a157d6a83bfc6dff4fdecb9632667ced3/pytedee-0.0.2-py3-none-any.whl (6.1 kB)
Requirement already satisfied: requests in /usr/local/lib/python3.8/site-packages (from pytedee) (2.25.0)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.8/site-packages (from requests->pytedee) (2.10)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.8/site-packages (from requests->pytedee) (3.0.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/site-packages (from requests->pytedee) (1.26.2)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/site-packages (from requests->pytedee) (2020.12.5)
Installing collected packages: pytedee
Successfully installed pytedee-0.0.2

bash-5.0# pip list | grep tedee
pytedee                          0.0.2

OK. Thanks. Tomorrow I will do.

1 Like

Done.
I hope it works for you, next HA update.

1 Like

No manual install of pytedee on Home Assistant Docker upgrade anymore. Worked fine yesterday.
Next step, official integration in Home Assistant of this great working custom integration :slight_smile:

Yes, just updated and works fine.
Time for next step as @haip wrote

Sorry, but this is not in my scope. Too much for me aside my other interests and projects. I can live with custom integration.

hello @joerg65 @Konrad-Tedee
can you please help me around Tedee Lock automation and Home Assitant?
I succesfully installed joerg65 custom compnent (many thank for creating it!) and it works perfectly - I am able to lock and unlock my Tedee using HA
Now I want to create an automation between Tedee lock and my lights switch, so that each time lock is getting unlocked after sunset, lights are turned on automatically
I am facing some trouble in reading the state of the lock. Based on the discussion here ,I understand that entity attribute “numeric.state” value holds the state of the lock: ‘6’ being locked, ‘4’ - unlocking and ‘2’ unlocked

I am testing the trigger condition with my iPhone notification. I thought that a simple automation would do the trick:

- id: '1621849965512'
  alias: Notify door unlocked
  description: ''
  trigger:
  - platform: state
    entity_id: lock.tedee
    attribute: numeric_state
    to: '2'
  condition: []
  action:
  - device_id: 3b27c01172c77ff0569fd2175db199cf
    domain: mobile_app
    type: notify
    title: Tedee
    message: Door unlocked
  mode: single

however, when unlocking the lock I am not getting any notification, as if the state is not captured correctly
I really appreciate any suggestions

Thanks a lot
Michal

Hi Michal,

you could try:

trigger:
- platform: state
  entity_id: lock.tedee
  to: unlocked

The state of the lock is not tracked in realtime. Could take some seconds if you unlock your tedee lock.

@MikeAngelo: Sorry haven’t seen your post.
I tried with template platform, it’s working:

- id: '1621849965512'
  alias: Notify door unlocked
  description: ''
  trigger:
  - platform: template
    value_template: '{{ states.lock.lock_326b.attributes.numeric_state == 2}}'
  condition: []
  action:
  - data_template:
      message: "Lock is unlocked!"
    service: notify.joerg

- id: '1621849965513'
  alias: Notify door unlocked
  description: ''
  trigger:
  - platform: template
    value_template: '{{ states.lock.lock_326b.attributes.numeric_state == 6}}'
  condition: []
  action:
  - data_template:
      message: "Lock is locked!"
    service: notify.joerg

Thanks @haip and @joerg65 managed to get it working!

Hello @joerg65,
I’m very amazed of your Tedee-Integration project but have no idea how install the .PY’s on my HASSio running on a Linux VM.
Is there any other way to integrate the codes? Unfortunately, I have no Python knowledge and therefore, no idea how to come to an goal.
many thanks!

I have installed a homeassistant vm now to try it out. This is the way I installed tedee lock:
*Have access to the config folder, I used Samba Share addon.
*Make a folder custom_components/tedee_lock in config folder
*Copy the files from https://github.com/joerg65/tedee_lock into the folder.
*Minimum files are lock.py and manifest.json and an empty file __init__.py.
*Add lock to configuration file (as in first post).
*Restart homeassistant from vm console with command core restart.
*It will install the dependencies in background.

That should be all.

Thanks for your great help and advices!
The copy-job worked, but after restart, the plattform-error “lock.tedee - integration not found” remains. Of course, the User and PW is added to the configuration.yaml.
it seems, the files are not installed, but just copied.
what am I still doing wrong?

Not easy to say. Have you named __init__.py right? With two underscores before and after init?
And do you have restarted homeassistant from the command line?
When you try to restart from the ui and in configuration.yaml is added the lock, then a restart will be denied because of configuration error.

yes, the init-file is named correctly.
No, I didn’t start from command line (ha core stop, start), initially, but tested it, just now.
As a result, the HA started without errors, but still without any Tedee-integrations. After an additional restart by the UI, the error pops up again.

Could a complete missing Python integraton on that VM result to that malfunction?

Sorry, I have no idea why it is not working for you. A complete missing Python integration can’t be, because HA is made with Python. I can’t find, where the Python libraries are stored inside the vm. I am not familiar with HA as vm. Basically when a custom component is stored, the HA installs the needed library that is given in manifest.json: "requirements": ["pytedee>=0.0.1"].
I have set up a new fresh vm again and followed my given steps, and it works!
I used haos_ova-6.2.vdi and VirtualBox for it.
May you also try to setup a new vm for testing?