DeCONZ Hue Dimmer Switch app with smooth dimming functionality

I read upon on HACS and it seems not so difficult, I’ll try to release something this week.

1 Like

Sorry for my late reply, was a bit busy with other smart home problems :upside_down_face:
I made a PR to get the app added to HACS, in the meantime you can add it as a custom repository with this address: https://github.com/Burningstone91/Hue_Dimmer_Deconz

2 Likes

No worries, I am extremely busy myself so I didn’t have much time to check out all new components and plugins anyways. I will test this as soon as I have the opportunity, though with the work on my current project I think this will be in the next year XD. Thanks, I have already shared your project with my slack group so maybe they’ll test it before I do. But I will let you know ofc.

1 Like

PR has been merged, in a few hours the repo should be visible in the default store.

Burningstone many thanks for this! I will try it on this weekend. :+1:

Yes, please :slight_smile: Would be happy to receive some feedback.

Hey! This looks really clean. Sadly, I don’t use Deconz, so I can’t really test it.

I love how you’re starting a long transition to do the dimming and then stopping the transition when the button is released. That’s very smart and MUCH better than other implementations I’ve seen where a button press sends a small increment every second or so. Your method should look nice and smooth while the usual method appears jumpy at best.

The code is clean and easy to read.

I think other Zigbee implementations (ZHA, Zigbee2MQTT) might support similar functionality, so this could be adapted to work with those integrations as well.

The only change I would consider is your first line of initialize.

set_namespace(‘hass’) likely works for you because you have appdaemon.yaml configured that way. But for most people (including me), it will not. And you don’t offer any way to configure this.

Most people, use the “default” namespace for HASS, because that’s what the docs offer as example configuration code.

I would do this instead to provide the ultimate in flexibility:

self.namespace = self.args.get('hass_namespace', 'default')
self.set_namespace(self.namespace)

Then, anyone using a “non-standard” namespace for HASS (or multiple HASS plugins) can add (in your case):

hass_namespace: hass

to their YAML and still be able to use your app.

Thanks a lot for your feedback! Highly appreciated.

It’s amazing that DeCONZ provides this functionality, as far as I know the others don’t provide this kind of functionality (yet), but I would be happy to change my app and add the functionality for ZigBee2MQTT and ZHA as well.

I removed the set_namespace for now, as I assume most people testing the app will be using a standard setup, more so now that I released it in HACS. Probably going to add your suggestion later.

I don’t know about ZHA. I use it for testing, but don’t have any bulbs attached at the moment that would support this kind of operation.

With Zigbee2MQTT it is supported, it’s just more complicated.

First, only SOME bulbs support transitions. This may be true for Deconz as well, I’m not sure. With a supported bulb in Zigbee2MQTT, to start the transition, you’d send this:

self.call_service('light/turn_on',
entity_id='light.front_table',
brightness=255,
transition=50)

That’s easy. It’s the stopping that’s harder. This should work, though I’ve only tested it manually:

current_brightness = self.get_state('light/turn_on', attribute='brightness')

self.call_service('light/turn_on',
entity_id='light.front_table',
brightness=current_brightness)

Essentially, the way to stop the transition from continuing is to set an explicit brightness level. By using get_state (since zigbee2mqtt reports state as the brightness changes) we can get the current brightness level of the light and use that to stop the transition.

Though I’d never considered it before now as I don’t have any functionality like this in my house, I think this is a useful feature to be supported natively. When I get some time, I may issue a PR for zigbee2mqtt to allow a “stop transition” without having to get the current state.

1 Like

Will this work with an ikea tradfri wireless dimmer (new style) and a conbee 2 stick with deconz? If so it’s exactly what I’m looking for…

I can add other remote controls, but you need to provide me the button codes and the corresponding button press. Like:
1002: long press left
1003: long press left release
etc.

And I need some time to code it and you need to be my tester as I dom’t own any of these remotes.

thank you, I’ll get you the codes shortly and as for the time, you have all the time you want… you are doing this out of the kindness of your heart and I greatly appretiate that so will never chase you ;-)… being a tester… gladly, if you are going to the time and effort to make this work, testing and feeding back is the least I could do for you :slight_smile:

in advance, Thank you

Hi, my apologies for the delay. the code are as follows

Short press on - 1002
long press on - 1001
long press on release - 1003

short press off - 2002
long press off - 2001
long press off release - 2003

in this switch there are only two buttons “on” & “off” and wile playing around to find all the codes these are all i could generate.

hope this helps and thank you for your time and help.

Robin

That’s perfect. Shouldn’t be a problem to integrate this. I’m going to provide you with something to test very soon

1 Like

I have something ready for you to test :slightly_smiling_face: Did you manage to install AppDaemon yet?

1 Like

Thank you :grinning: what’s the easiest way for you to send it over?

I managed to get it installed but when I try to open the web UI I get connection refused, haven’t found the cause yet but I’ve been out all day today and still out now,so will try again tomorrow night.

I’ll send you a PM with the code and some instructions tomorrow.

Looks a lot like ControllerX. Bring full functionality to light and media player controllers

Maybe it could be a joined effort :slight_smile:

@Burningstone thanks for sharing your solution and also thanks to @KennethLavrsen for his solution.

I was looking for the dimming functionality that works with holding a button for a while now. I ended up making my own appDaemon script. I have not yet tried your solution. I will let you know when I do.

1 Like

Hi @hfm, you could check this out. It supports deCONZ as well for the Hue Dimmer Switch and it supports dimming and color changing.