-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for deconz #10
Comments
Yes, that is right. At this stage, there is support only for zigbee2mqtt. I do not possess a conbee device to integrate this with deConz. The integration should be easy since we would be listening to events instead of sensors. If anyone has deConz running and some knowledge to develop it, I can merge the changes. I leave the issue open with a feature request label. |
I got a conbee device and some knowledge on Python. I can see a very different event management and also the event naming is different. Listening on |
@mario-tux And do the devices always emit the same event with the same numerical type ids? I will code the base code to support deconz and I will keep you in contact to try it out. Which devices that I support do you have? Could you tell me the mapping with the event and the type of action? |
Hi @mario-tux, I started implementing the deconz support and I gave support to the Hue dimmer switch since it is the only one I could find on the Internet the mapping for the event types. Since I do not have deConz running, I fired the events through HA. If you have the Hue Dimmer switch, you can try it out from the master branch and let me know about it. Otherwise, you will need to tell me the device you have and the event number for each action. |
Hi @xaviml : sorry for the late reply but I was busy at work.
This an example of the data on a
The numeric codes from the
|
Hi @mario-tux, I just pushed the code with the mapping you gave me. Here you have three example configuration for your 2 devices: yourApp:
module: z2m_ikea_controller
class: E1810Controller
event_id: <the controller event id>
light: <light entity> yourApp:
module: z2m_ikea_controller
class: E1744LightController
event_id: <the controller event id>
light: <light entity> yourApp:
module: z2m_ikea_controller
class: E1744MediaPlayerController
event_id: <the controller event id>
media_player: <media_player entity> Let me know with the update :) Thank you! |
I was able to make it start and I'm trying to use The log could help to understand what is going on:
|
In don't know if it matters but I switched to AppDaemon 4. |
It looks that the sequences length is not related to the actual volume level: it looks fixed (11 commands). In other words, if I make three spinning-left gestures, I can see three separate sequences of n.11 volume_down commands. Each sequence is followed by the, in late, recognition of the stop event. See below the log. It looks a bug in app.
|
Hi @mario-tux, Thanks for the feedback. The way the app is developed it requires different threads acting to the same instance. In AD 4.0 they added a new feature called 'app pinning' that allows threads to assign apps, so only 1 thread per app. This option comes by default in AD, since it is the recommended way. The problem is that when I developed the app, I developed it for AD 3.x, so I wanted to make sure it worked for that version. Now that AD 3.0 addon is deprecated, I will have to migrate the code so it works with the default config of AD 4.0. In the meantime, you have 2 options:
load_distribution: load
pin_apps: false so your config should look like something like this: ---
secrets: /config/secrets.yaml
appdaemon:
latitude: !secret home_latitude
longitude: !secret home_longitude
elevation: !secret home_elevation
time_zone: !secret home_timezone
load_distribution: load
pin_apps: false
plugins:
HASS:
type: hass
ha_url: <HA URL>
token: <TOKEN>
http:
url: http://127.0.0.1:5050
admin:
api:
hadashboard: the I hope this solves your issue in the meantime that I make the app work much efficient on AD 4.0. Also, let me know about the integration with the 5 button ikea controller when you have a chance to do so. Thank you! |
Hi @xaviml .
As bad news, this didn't change so much. Here the log:
The first attempts were using single-rapid spin gesture: the behavior looks unchanged. In the following attempts (between 19:33:19 and 19:33:46) I used two rapid spin gestures: the app reaction is even stranger. |
Just for checking, but did you restart the appdaemon server/addon after the changes? @mario-tux |
Yes, I did. It looks I can send one/two volume_down/up making two rapid spin gestures. A single isolated gesture trigger the 11-command sequence. |
Hi @mario-tux Sorry for the problems you are having. I just migrated all the code with the support of async programming, this means that works with the recommended configuration for appdaemon. You can try to remove the two lines of code I mentioned and restart the addon/server. I have tried the app with the E1744 for a light and for a media_player (google home speaker) with zigbee2mqtt. They both worked now as they did before with AD 3.x. I changed the default delay to 1s for the E1744 media player controller. Let me know if you have any problems with it. Thank you for your help! |
@xaviml, thank you for your effort. I'll carry on some testing this night/tomorrow. |
Thanks @mario-tux, Dresden Elektronik, the company behind deConz, messaged me this morning telling me that they will support me with a free ConBee II, so once I have it I will be able to do the testing as well. |
Oh, great! They are recognizing your efforts. |
Hi @xaviml. At this point I think it is worthy to wait the arrival of your conbee II usb key to get a direct feedback on the app behavior. In any case I'm available to test further changes. A log with the new changes:
|
Good to know that it works better now. The way is done, the volume will be go down or up as long as stop is not triggered, if the stop is not triggered, then the loop will be called 10 times tops (to avoid infinite loop). So I think what is happening is expected, although is not desired. When you have time, let me know about the E1810 (5 buttons) controller. Just to know that the mapping is correct and the device works. With this, I will close this issue. Thank you for your contribution @mario-tux |
Yes, that was my understanding on the way the volume-up or down was managed, but the main question is why the app is missing the stop event: a problem of the app or a bug of deconz? |
@mario-tux If you rotate (left or right) for 2 seconds and stop, does the stop event get fired? Or this happens only when you move left and right quickly? |
I did some tests:
At the end also a strange volume_up/volume_down mixed action happened... :-)
|
@mario-tux This is valuable, thanks! I see that when rotated left or right for 1 or 2 seconds, the behaviour is the expected one, I see that the stop event is fired. I will check on the quick movements again with the zigbee2mqtt to see if that happens and how it can be fixed. |
Today I did some testing with my E1810 5 buttons control jointly with a color bulb (TRADFRI bulb E27 WS opal 1000lm). The center (toggle), up/down (click and holding) work well. I have a problem with left/right buttons to change color temperature but I guess it is related to a bug of deconz with the Ikea color bulbs. See dresden-elektronik/deconz-rest-plugin#1861: in many occasions HA doesn't report neither
|
Hi @mario-tux, As the error suggest, the light bulb does not support either xy_color or color_temp. So if you go to HA and click to the light, can you change the color temperature from there? I see that according to the Ikea catalog it does no support color temperature, since it does not say anything about it, just brightness. So, I think is not a deConz issue, it's a hardware issue. Thank you anyway for letting me know. With this, I will close the issue, we can open another if needed. I will check upon the symfonisk controller once I have the ConBee II as well. |
Yes, I can change the color from the web interface of HA and Deconz so it supports it.
I did a quick and weird copy&paste of the model from the Deconz web interface so maybe it was the wrong one. Anyway it is a known bug of Deconz (see reference above) and unrelated with your software.
Ok, great. Another question: sorry to dirty this thread but I don't know where ask (mail, another report/question?). |
Right now, this is not supported, all devices and their actions are defined on the python code with internal functions. However, it wouldn't be a bad idea to create a CustomController type to map actions and services together. I don't exactly know what you are looking for, but I just merged a PR (#11) from @EPMatt that allows the E1810 to work as a Media player controller. |
Do you mean that, in order to personalize the actions, one should change the python code or the app parameters? The second would be cool.
Just to let you understand what I would do: I got an audio home theater connected with a raspberry pi (kodi) and with a chromecast audio. Depending on the service I want to use (audio or TV) I need to change the volume of the HT (I'm using an ESP8266 to send IR signal to the old HT). Having the possibility to map the single volume_up/down to some custom HA services would allow more freedom. Probably I could approach the same problem creating a third media_player template that merge the undergoing devices/media_players. Just an idea. |
The purpose of this app since the beginning is to provide the logic you lose on the devices when getting rid off the official hubs. Zigbee2mqtt + Home Assistant is great, it allows to integrate the devices, but it does not add the logic of the controller over the lights for example. So right now, we can easily integrate new devices through python. However, as I said, I think is a good idea to allow the users to map actions with home assistant services. I will create a new task for that, thank you for the suggestion @mario-tux |
I'm not sure but, looking at the code, this app doesn't seem to support events coming from deconz: am I right?
If it is not supported, this could be considered a feature request.
Thanks.
The text was updated successfully, but these errors were encountered: