@patrickhilker I tried in the beginning with a second lock that was provided from tedee and it worked. Now if you like to refactor a lot, you could take the ownership of the custom component. From my side, I have created this, because there was no other option. But Python is not the programming language I love, so I decided for my own to leave this custom component as it is and do only the necessary to keep it working with latest HA.
@joerg65 Right now the component also features everything I need. Found it pretty interesting working with a custom component - never did python before. I think there are some minor things to do now, but nothing important. Just wanted to make it as simple as possible to integrate the tedee.
How do you imagine “taking ownership” of the custom component? Transferring the repo? Would be open to this.
@Konrad-Tedee Regarding multiple locks: This seems to work fine. Going to commit my changes soon.
Patrick, it was only a suggestion. If you like to do more development at this component and it becomes better and better, but the code isn’t looking anymore like my code, I don’t feel that is mine anymore. In this situation, without to be angry, I can make a notice on my github and a link to your github that you will maintain it further on. That I meant with “take ownerchip”. But as I said, only a suggestion.
A background to me: I have some other interests and projects and work and family. Therefor I wouldn’t make more development for this component, but maintain it for the next years.
Hi Patrick,
I have JUST installed two Tedee locks, so I can help you test. Going to install the custom component first of course. Running HA in docker, so need to figure that out first…
I also know some Python, so will do my best to help wherever I can.
Edit: Oh saw you are integrating with HACS. So that should work for me
Edit 2: Ok, it’s working with two locks! Just need to tweak some settings as I’ll need two seperate buttons for my front door. One to just unlock it and one to unlock+open.
Hey @joerg65, I followed your suggestion and published my repo in the hacs default repo today. I am happy to use your work as a solid base to contribute something back to the community.
@Whuzz I assume it would be a good idea to use an input button
to trigger the appropriate automation to get the result you need.
Yup, that worked.
So far all goind smooth. Both locks fully operable. Thanks @patrickhilker and @joerg65 for all the effort!
In configuration, you can add, for example:
input_button:
open_door:
name: Open Door
icon: mdi:lock-open
close_door:
name: Close Door
icon: mdi:lock
Or you add them by /config/helpers
.
Then in automation, for example:
- id: '20220227000001'
trigger:
- platform: state
entity_id: input_button.open_door
action:
- data:
entity_id: lock.lock_326b
service: lock.unlock #or lock.open
- id: '20220227000002'
trigger:
- platform: state
entity_id: input_button.close_door
action:
- data:
entity_id: lock.lock_326b
service: lock.lock
BTW, Input Button was introduced in 2022.2.
Great. I installed it in my test installation. It works.
Hello and thank you for the work accomplished. I installed your personalized component and the lock works perfectly. But when I look at the logs I have errors, do you know where the problem comes from?
excuse me for my English.
Voici mes logs:> Cette erreur provient d’une intégration personnalisée
'Cette erreur provient d’une intégration personnalisée
Logger: homeassistant.helpers.entity
Source: custom_components/tedee/lock.py:87
Integration: tedee (documentation, issues)
First occurred: 2 mars 2022, 18:36:38 (104 occurrences)
Last logged: 07:40:35Update for lock.porte_d_entree fails
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 449, in _make_request
six.raise_from(e, None)
File “”, line 3, in raise_from
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 444, in _make_request
httplib_response = conn.getresponse()
File “/usr/local/lib/python3.9/http/client.py”, line 1371, in getresponse
response.begin()
File “/usr/local/lib/python3.9/http/client.py”, line 319, in begin
version, status, reason = self._read_status()
File “/usr/local/lib/python3.9/http/client.py”, line 280, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), “iso-8859-1”)
File “/usr/local/lib/python3.9/socket.py”, line 704, in readinto
return self._sock.recv_into(b)
File “/usr/local/lib/python3.9/ssl.py”, line 1241, in recv_into
return self.read(nbytes, buffer)
File “/usr/local/lib/python3.9/ssl.py”, line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed outDuring handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/requests/adapters.py”, line 440, in send
resp = conn.urlopen(
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 785, in urlopen
retries = retries.increment(
File “/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py”, line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File “/usr/local/lib/python3.9/site-packages/urllib3/packages/six.py”, line 770, in reraise
raise value
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 703, in urlopen
httplib_response = self._make_request(
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 451, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File “/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 340, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘api.tedee.com’, port=443): Read timed out. (read timeout=10)During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 521, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 733, in async_device_update
await task
File “/usr/local/lib/python3.9/concurrent/futures/thread.py”, line 52, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/tedee/lock.py”, line 87, in update
self._available = self._client.update(self._lock_id)
File “/usr/local/lib/python3.9/site-packages/pytedee/TedeeClient.py”, line 182, in update
return self.get_battery(id)
File “/usr/local/lib/python3.9/site-packages/pytedee/TedeeClient.py”, line 135, in get_battery
r = requests.get(api_url_battery.replace(LOCK_ID, str(id)), headers=self._api_header,
File “/usr/local/lib/python3.9/site-packages/requests/api.py”, line 75, in get
return request(‘get’, url, params=params, **kwargs)
File “/usr/local/lib/python3.9/site-packages/requests/api.py”, line 61, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.9/site-packages/requests/sessions.py”, line 529, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.9/site-packages/requests/sessions.py”, line 645, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.9/site-packages/requests/adapters.py”, line 532, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host=‘api.tedee.com’, port=443): Read timed out. (read timeout=10)’
Hi @patrickhilker, unfortunatly your integration isn’t shown in my list of available integrations even after several reboots of HA after installing from HACS. Any ideas what could be the issue. I’ve been using @joerg65 custom component before, but have been commentig out this section in the xonfiguration.yaml (and rebooted) before installing yours from HACS.
Hey @macraspberrypi, this happens if the compontent cannot reach the tedee servers. This should not be problem, as long as the component can reach the server when starting up. The component needs some error handling which would cover this. It’s on the roadmap.
Hey @Martl, to be honest I am not sure, what happens if you still have the integration of Joerg still in your file system. Would you mind removing the files? Are there any errors in your home assistant log that contain words like “lock” or “tedee”?
Hi @patrickhilker, that (removing @joerg65 files from the file system) actually made the difference. Now the integration is showing up and works as expected. So you might add a note to the instruction for other users of @joerg65 custom component. Thx for the support
I don’t use configuration. Just added an input-button to lovelace.
Is it possible to not pull the latch on lock.unlock command? We want to automatically lock the door in the evening and unlock it in the morning (without pull spring). The API has an URI parameter „mode=3“ for it.
Unlock mode 4 is for unlocking with pull spring or only pull spring in unlocked state. This could be used for lock.open command.
Seems that you are correct - the upstream lib uses mode 2 in both (unlock and open) cases. I am going to fix this, but it could take a few days.
Never noticed this as I don’t use the pull spring.
Thanks! There is nothing worse than lying in bed and hearing the door open in the morning.