Hardware Dimmer

So I’m not too keen on whipping out my mobile phone, finding an app and adjusting the brightness. Seems clunky to me. I’ll miss the buttons in the dark and its frankly not easy. I am just as likely to dial 999 or switch my bed into vertical mode as turn the lights on!
I’d like to a have a hardware knowb that I twizzle it probably plugs into the mains and is permanently linked to the bulbs.

Like a two way switch I want to be able to have several knobs control one bulb or one knob control several bulbs or several knobs control different aspects of a bulb or group of bulbs.

Here are some typical use cases - At the moment using conventional triacs - both me and my wife have dimmable bedside lights. But then she goes to sleep and I want to dim or turn off her light as well as control my own. Or we both have knobs. Furthermore the knobs could be programmed to traverse any colour line on the 3d colour-brightness chart either an open or closed (perhaps circiular) path.

But there is a problem. For two dimmers to control the brightness of 1 lamp (or more) its necessary to be able to send incremental commands. Not “set the brightness to 62%” but “set the brightness up 1% on what it was before”. This way, if two streames of data come in perhaps changing different aspects of the light characteristics then it all just works. +1% now then -2% then a bit later +4% it all just works.

This is not difficult to do but the current protocol does not support it so far as I can see,

A simple change, perhaps using one bit of the reserved byte in these commands.

Please could we have this?

A hardware dimmer for lifx bulbs would be a neat piece of kit and is not hard or expensive to make. Shaft encoder perhaps with switch, wifi enabled embedded processor with wifi, small power supply, Hold the switch down for say 30 seconds and after that it permanently links with all bulbs that are turned on in the next minute, its very simple. It could have a major effect on LiFx bulb sales or be a brilliant product in its own right, and might seriously increase the value of the market!

But you need to have the incremental brightness control (and other characteristics really) or it wont work. No, you cannot read the bulbs current state and then adjust it: two knobs doing that at the same time would get the wrong result!

I am very sad this was not thought of before. Or maybe it was and the documentation is not telling? Or maybe my brief reading of thr protocol docs missied something.

?

3 Likes

I have some information coming soon for a method for sending incremental changes to particular light values. You’ll have to be patient though because my workload is fairly high right now.

Hi Daniel,

Thank you. I would be very interested to see this.

regards,

Mark

Hello Mark,

What you are describing is close to the original idea I had behind lightsd: a small background service to control LIFX bulbs.

As you’ve realized, certain things are hard to do with the current protocol, moreover those interactions tend to have real time requirements. It’s when I realized those short-comings that I started working on lightsd.

lightsd comes with its own protocol and kinda offer the same level of functionality as the LIFX HTTP API but on your local network. While lightsd requires an operating system to run it has been designed with embedded devices in mind and will run on anything that can boot a stripped down version of Linux (for example). I have been using lightsd successfully on consumer routers and I’m sure it can run on less powerful machines.

Let me know if you have any question! lightsd’s documentation covers requirements, installation and usage:

http://lightsd.readthedocs.org/en/latest/

I can’t wait to be working on some hardware too!

Best

1 Like

Hi Lopter,

Yes it looks interesting and sure if my dimmers talked to the lightsd daemon, and that was the only thing that talked to the lights, then that would work, if the daemon was able to accept incremental instructions, which from the protocol you have published, it cannot, although I am sure it would be easy to make it do so if the code is open source.

But the downside is that the code then takes 2 hops to get to the bulbs instead of 1 and further latency is exactly what you dont want. Also why cant the bulbs do this?

It sounds like a great project but I am hoping that LiFx can do this the right way. It is afterall very much in their interest to do so, people would kit out their whole houses if this was fixed! (Well some people would!)

Regards,

Mark

lightsd totally can totally be used to send incremental commands: getting the state of the bulbs from lightsd is a very cheap operation and the state of the bulb is guaranteed to be as close as possible to their actual state (lightsd can sample the bulbs more than one time per second). One of the examples shipped with lightsd shows an incremental operation:

The bulbs are completely stateless that’s why they can’t do it. Moreover, you always have 2 hops since the traffic as to go through the access point anyway. Then, if lightsd is running on your access point directly or on a device wired to that access point then going through it adds very negligible latency.


All of that said, I see what you mean and commands that takes relative values could be implemented both in the LAN API and in lightsd.

I don’t know if I’ll implement that in lightsd since you can easily emulate it. One thing I want to do at some point with lightsd is being able to subscribe to updates which will further reduce the latency cost of that emulation (at the benefit of being able to do other things like display the actual status of the bulbs pretty accurately).

Best

I know this doesn’t address your desire for a hardware brightness adjuster like a knob, BUT… I was able to use my phone volume buttons to turn the lights on and off which is much easier than unlocking your phone, launching the app etc. etc.

You would need a jailbroken iPhone with ‘Activator’ and ‘Activate Command’ installed. Then you would link the event of holding down the ‘volume up’ or ‘volume down’ button to a curl or bash script that runs the power on or off command. It’s a bit of a hack but gets the job done in no time.

As for controlling it in a knob-like fashion, I toyed with this in my free iOS app ‘LIFX Ambience’ by using the built-in gyroscope such that you could flip the phone over to the left to turn it off or to the right to turn it all the way on. It’s still experimental and I would very much appreciate any feedback or suggestions for improvement on this. You can check it out here:
http://lifx.technicallycorrectman.com/

It currently won’t respond to the gyroscope when the phone is locked or in the background. That is something I am thinking about ways to get around.

I think the OP’s point was that it’s not atomic. Personally, it doesn’t seem that important to get a mathematically correct answer if two people are adjusting the brightness simultaneously. But I understand the sentiment, given how much time at my day job I used to spend tracking down errors caused by non-thread-safe code.

Ummm… the bulbs are inherently stateful, and they are actually in the best position to be able to do atomic updates to their own state.

Edit: Now that I think about it, I can see why incremental updates in the bulb wouldn’t work so well, since the protocol is unreliable. Although you can ask for an acknowledgement, if the acknowledgement doesn’t arrive, you don’t know if the request was lost, or only the acknowledgement was lost. This is similar to the problem I mentioned previously. Or to put it more succinctly, incremental updates are non-idempotent.

I really wish LIFX bulbs provided a secondary protocol that allowed building really low-powered switches that doesn’t rely on WIFI - you need mains powered for that. I agree using your phone for turning bulbs on really aren’t feasible for full usage.

This is what the Philips Hue bulbs got right - I absolutely love my battery-less Hue Tap buttons, but do like that the LIFX bulbs are bridge-less and much brighter. We use our Philips bulbs where we actually have day to day usage - the lifx bulbs are mostly on ordinary switches and from time to time we’ll adjust them for special occasions (like red on Halloween etc).

I’ve been tinkering with the idea of making a ZigBee-switch-to-LIFX bridge to solve some of this. It’ll keep the bulbs bridge-less but add bridge-powered switches for LIFX.

2 Likes

You guys may want to look into these switches/buttons. They require no power. You would need a bridge between the switch and the bulb though.

https://www.enocean.com/en/enocean_modules_902mhz/wireless-switch-esrp-edrp-oem/

Or if your willing to spend more $$ you can use Crestron like I am.

i’d like to know how you got that to work, and what functionality you could get from it. feel free to email me: me at davecotter dot com

How do you have the Creston dimmer connected to your Lifx bulbs?

I am really surprised that a year has gone past and there is practically speaking no change. I am aware of the Pop home switch, but its really not the thing I think most users want.

Here is what I have in mind:
Its essentially like an LiFx bulb, has the same WiFi and Communications infrastructure. You can discover it in the app too, and when you do the app allows you to place it in a group. The group contains at minimum 1 bulb and 1 dimmer but may also contain several bulbs and several dimmers. If we wanted to get fancy we could allocate weather it was colour, brightness, or both at once we wanted to change. This information is sent to each dimmer on exit from that part of the app.

The device itself has a shaft encoder, (that can turn infinately in either direction) and possibly a button. So you push the knob to toggle a switch and otherwise can turn completely fully in one direction. If you want to get fancy, it could have a break so that the knob becomes harder to turn in 1 direction when the bulb is on max or min - thats a nice to have touch feedback but not essential.

When you turn the knob clockwise the device fetches state of each bulb and then increments and sends by the amount turned. counterclockwise decrements. The state is only interrogated after a pause. Each lamp in the group has its own brightness sent to it. Its not likely to work right if two dimmers change the brightness at the same time but we can live with that. But unless you are playing a modern version of that game where you stand at the bottom of the stairs and your child stands at the top and you both try to convince the other that the 2-way switch is broken by switching it exactly when they do… but then that would be that would be too much fun!

Now the reason it would be so much better if LiFx did this than me, is because for this to “feel good” latency should be at a minimum and using the existing LiFx radio structure would likely be faster. The reason we cannot handle two people using 2 dimmers at once is because we cannot send atomic incremental commands, only absolute values and also its UDP so a few commands may get lost. But it would still be really good.

I want to kit out my house with LiFx bulbs but I dont want my guests children and everyone else having to download an app. I also dont want them messing with lights in my room when they are in another room. The normal thing is you change the brightness and/or colour of the lights in the room you are in.

So the toggle/switch on the knob? Well, that just uses software to switch the lamp on and off. I’d like this in 2 versions - battery and mains wire in replacement, but the battery version is probably not possible. The wire in replacement should fit in the space of a normal switch and if we have to provide live and neutral so be it. (Some switches do not have the neutral in them, just the interrupted live, as we intend to put the switch in always on mode, we will need the neutral. )

Now lets consider safety. What if you need to change the bulb socket? Switch of the electricity at the board = you should do that anyway. Change the bulb. Well that doesn’t happen often and so we can say that you should also switch of the electricity at the board in that case too. Or live dangerously & change the bulb live. I am not going to sayy that tho. Lastly, what do you do if your router fails, this could leave you with no lights! Two possiblities. Either you turn the electrity off at the board and on again, the lamp will come on with at least 25% brightness, you cannot turn it off but maybe thats not a big issue until your router is fixed. Or we make the knob toggle button work as an actual light switch (configurable depending on how you connect) then you are covered against router failure completely.

So LiFx, pretty please, would you make this? You will wipe the floor with your bulbs (well even more!!) and people will kit out their whole house with bulbs not just 4 or 5 as at present so this is massive for LiFx.

You still won’t do it? It would be pretty hard (But not impossible) to do this with non-LiFx kit. And you dont get the full integration you would have otherwise. I’m a software Engineer. Perls my thing but I can do most languages. So send me a development kit and sign me up, and I’ll develop it!

The world needs this. I need this gadget. I need a job(!). LiFx needs this. And so, particularly do LiFx shareholders!

An IoT twistable knob would likely have a range of applications past simply LIFX. Maybe a development firm like www.flic.io would be partial to the suggestion.

Just found this: http://www.nobcontrol.com/

(Flic) It wont really work because flic’s are battery operated, and its hard to have something wi-fi thats battery operated, (Flics do bluetooth for that reason.) On the otherhand using the existing LiFx wifi would work really well, link in with the lifx app, and allow you to replace your wall switch which has mains power, or plug in a knob to a mains power socket.

(nobcontrol.com) Interesting project. But I dont feel it would help here, as it would be hard to incorporate the LiFx protocol without introducing an additional device and extra lag. :frowning:

(deleted as posted twice in error.)

to fix your issue with flic is wall mounted phone/ tablet i have a wall mounted tablet in a central location in the house