Closed schneekluth closed 3 years ago
Thanks for pointing out this issue. I can easily include this in the code. Will try to come up with a new version in the next few days. Will come back to you once I got a working product.
Maybe I am in the wrong side. Have you used the light group Integration (https://www.home-assistant.io/integrations/light.group/)? I have my lights grouped in groups.yaml. But If you include the service homeassistant.turn_off your appdaemon App would be far more flexible.
No you are correct, I just forgot about groups because I don't use any groups in home assistant.
I also suggest that you make your light groups in phoscon and not in home assistant, because if you create a group in phoscon and turn it off, only one request will be sent to the ConBee stick, whereas if you create the group in home assistant and turn it off, it will send one request per light in the group, which can cause issues/delays in larger setups.
I didn't know that. Thanks for this advice.
BTW: How would you bind multiple lights in your app to a hue dimmer? In your example there is only a single light in your entity config.
I am having a similar problem. I cannot call a service with the same error message as above:
Config:
dimmer_test:
module: hue_dimmer_switch_deconz
class: HueDimmerSwitch
entities:
switch: switch_hallway
light: light.treppe
advanced:
short_press_on_release:
action_type: service_call
entity: light.treppe
service: light.toggle
Error:
2020-01-20 16:35:52.757081 WARNING AppDaemon: Unknown service (default/light/service_call) in call_service from dimmer_test
@chbndrhnns Change service from "light.toggle" to "toggle", the domain for the service is not needed as this is extracted from the entity_id afterwards in the app.
I think it might other users if you either added this to the log messages if you find a valid domain or if you accept a domain as part of the service.
I tried your suggestion and now my config looks like that:
dimmer_test:
module: hue_dimmer_switch_deconz
class: HueDimmerSwitch
entities:
switch: switch_41
light: light.Treppe
advanced:
short_press_on_release:
action_type: service_call
entity: light.Treppe
service: toggle
The error message stays the same:
2020-01-20 20:20:29.859779 WARNING AppDaemon: Unknown service (default/light/service_call) in call_service from dimmer_test
It works, though, when I put turn_off
or turn_on
as action_type
.
@chbndrhnns I will investigate this. I'll try to release a new version this weekend, which will also include some additional remotes like the Tradfri Dimmer and Remote, ability to control multiple lights and hopefully multi button presses. I will also add some logging for easier debugging.
Could you also add support for the Xiaomi Aqara Button? It supports up one to four clicks which are recognized as one event. See further: https://www.triumvirat.org/2019/10/04/homeassistant-aqara-button/
Yes I can add it. Are you sure that you are using the exact same model as in the link you posted? Because there are multiple Xiaomi switches, which support different button presses.
It's quite funny because I've written this blog post. I can confirm that this solution works and that the deconz events are correct. My latest post is about the IKEA blinds: https://www.triumvirat.org/2019/12/28/ikea-smart-blinds-conbee-homeassistant/ Maybe you can include the remote aswell. Currently I only have support for open and close and no way to stop them at the current position.
Yes I can add it. Are you sure that you are using the exact same model as in the link you posted? Because there are multiple Xiaomi switches, which support different button presses.
Yes, I validated that the event ids are the same for my button.
It's quite funny because I've written this blog post.
Haha what a coincidence. I will take a look at your blog later, first I want to fix the bugs.
@Burningstone91 do you still plan on fixing this issue as per https://github.com/Burningstone91/Hue_Dimmer_Deconz/issues/3#issuecomment-576545922?
Currently working on it. Will provide you a test version soon, which also includes the ikea remote.
dimmer_test: module: hue_dimmer_switch_deconz class: HueDimmerSwitch entities: switch: switch_41 light: light.Treppe advanced: short_press_on_release: action_type: service_call entity: light.Treppe service: toggle
This config is incorrect, entity_ids are always lowercase, so it should be light.treppe not light.Treppe.
@schneekluth @chbndrhnns Please try out the app in the dev branch here: dev version
Below is an example configuration:
dimmer_test:
module: hue_dimmer_switch_deconz
class: HueDimmerSwitch
entities:
lights:
- light.decke_2_buero
- light.decke_1_buero
remote_event_id: dimmschalter_buero
button_config:
short_press_on_release:
action_type: light.turn_on
entity:
- light.decke_1_buero
- light.decke_2_buero
parameters:
brightness: 150
short_press_up_release:
action_type: light.turn_on
entity: light.buero
parameters:
brightness: 255
I added support for the Ikea Tradfri Dimmer, Ikea Tradfri Remote and the Xiaomi button 2016 version. You need to specify the class in order to choose the remote type:
class: XiaomiWXKG11LM2016 -> Xiaomi button 2016 version class: TradfriE1743 -> Tradfri Dimmer class: TradfriE1810 -> Tradfri Remote class: HueDimmerSwitch -> Hue Dimmer Switch
You can now control multiple lights like this:
entities:
lights:
- light.1
- light.2
Service calls need the full service name now, e.g. light.turn_off, homeassistant.turn_on like this:
short_press_up_release:
action_type: homeassistant.turn_on
entity: light.buero
parameters:
brightness: 255
This solves the issue of turn on/off groups.
Please let me know if you encounter any issues, I've added a bit of logging as well. Would be nice if you can test the Aqara button, the configurable buttons are "short_press_on", "double_press_on", "triple_press_on" and "quadruple_press_on".
If I get positive feedback from you and after updating the docs, I'll merge this into the master branch.
Hey @Burningstone91, great Job! First of all the good news: The hue dimmer switch now works perfectly. Turning off groups is working fine.
I've also tested the Aqara button with the following config:
button_kueche_test:
module: hue_dimmer_switch_deconz
class: XiaomiWXKG11LM2016
entities:
lights:
- light.kuche_kuhlschrank
remote_event_id: button_kuche
button_config:
short_press_on:
action_type: scene.turn_on
entity: scene.kuche_hell
double_press_on:
action_type: scene.turn_on
entity: scene.kuche_gedimmt
triple_press_on:
action_type: scene.turn_on
entity: scene.kuche_muckelig
quadruple_press_on:
action_type: scene.turn_on
entity: scene.kuche_aufstehen
This config does not seem to work. Appdaemon logs show that the button config is successfully triggered but nothing happens:
2020-01-26 21:35:49.853617 INFO button_kueche_test: Button 'short_press' not configured. No action.
2020-01-26 21:35:51.601289 INFO button_kueche_test: Button 'double_press' not configured. No action.
2020-01-26 21:35:54.261078 INFO button_kueche_test: Button 'triple_press' not configured. No action.
Any idea?
One suggestion from my perspective. Whereas it's absolutely necessary to assign a light under the entity section for the hue dimmer switch it might be a confusing idea to do the same with the Aqara button. See my posted config above. I have to assign the light light.kuche_kuhlschrank
else the appdaemon app won't load but after that the light is never used because all I do is triggering scenes. To be more clear maybe a config like this would be the solution. Moving the remote_event_id one level up so that the entities section is not required when you use the aqara button class:
button_kueche_test:
module: hue_dimmer_switch_deconz
class: XiaomiWXKG11LM2016
remote_event_id: button_kuche
button_config:
short_press_on:
action_type: scene.turn_on
entity: scene.kuche_hell
double_press_on:
action_type: scene.turn_on
entity: scene.kuche_gedimmt
triple_press_on:
action_type: scene.turn_on
entity: scene.kuche_muckelig
quadruple_press_on:
action_type: scene.turn_on
entity: scene.kuche_aufstehen
Maybe you should also rename your app because at this state it can be used for a lot more hardware than the hue dimmer switches or maybe turning all the controllable hardware into their own apps (would be the lesser preferred solution for me). Your app is on a good way to become the swiss army knife of zigbee input devices. Also I'd like to thank you for your fast response. Now that the hue dimmer switches work perfectly I can move on to migrate them and get rid of my hue hub.
Great that the Hue Dimmer works fine now. About the Xiaomi, the button names should be "short_press", "double_press" etc. without _on at the end, I wrote it wrong in my post. Thanks for the pointer about the light not being required, thought about this, then forgot it again while coding :( will change the config a bit before the release. And I wanted to change the name of the app anyway due to the reason you stated.
I'm also brainstorming on how I could implement your feature request https://github.com/Burningstone91/Hue_Dimmer_Deconz/issues/2
I have changed the names and now the button works perfectly too! Great Job.
I can also confirm the Xiaomi button works fine. Looks great and extendable. With regards to the config, I think that the naming could be a bit more consistent: entity vs entities vs light.
I have followed the advanced instructions and encountered an error when turning off a group.
My apps.yaml:
When I use
short_press_off_release
AppDaemon throws an error:2020-01-19 22:15:13.757195 WARNING AppDaemon: Unknown service (default/group/turn_off) in call_service from hue_dimmer_room2
I think the service to
turn_off
groups is now calledhomeassistant.turn_off
. How can I turn off groups?