I really don’t think it was your code. I only used your device handler for my dining room to test and it is the only group I really want to work more elegantly. Mission accomplished by the way… The issue is happening for me with the default device handler for my other bulbs. Plus I see that you have added the proper range for the temperature values.
@AdamV - This is working great for me. I have a lot of LIFX bulbs. Setup in my dining room. Works perfect except that that dimmer slider is always 0, even after I hit refresh. I don’t mind though. I don’t do much dimming in the app.
@AdamV - It turns out I wanted the mobile UI to work for me. I spent a little time tweaking it for my needs. I fixed the dimmer issue.
tiles {
multiAttributeTile(name:“switch”, type: “lighting”, width: 6, height: 4, canChangeIcon: true){
tileAttribute (“device.switch”, key: “PRIMARY_CONTROL”) {
attributeState “on”, label:’${name}’, action:“switch.off”, icon:“http://hosted.lifx.co/smartthings/v1/196xOn.png”, backgroundColor:"#79b821", nextState:“turningOff"
attributeState “off”, label:’${name}’, action:“switch.on”, icon:“http://hosted.lifx.co/smartthings/v1/196xOff.png”, backgroundColor:”#ffffff", nextState:“turningOn"
attributeState “turningOn”, label:’${name}’, action:“switch.off”, icon:“http://hosted.lifx.co/smartthings/v1/196xOn.png”, backgroundColor:”#fffA62", nextState:“turningOff"
attributeState “turningOff”, label:’${name}’, action:“switch.on”, icon:“http://hosted.lifx.co/smartthings/v1/196xOff.png”, backgroundColor:”#fffA62", nextState:“turningOn”
}
}
valueTile("Brightness", "device.level", width: 2, height: 1) {
state "level", label: 'Brightness ${currentValue}%'
}
controlTile("levelSliderControl", "device.level", "slider", width: 4, height: 1) {
state "level", action:"switch level.setLevel"
}
standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}
valueTile("colorName", "device.colorName", height: 2, width: 4, inactiveLabel: false, decoration: "flat") {
state "colorName", label: '${currentValue}'
}
valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", height: 1, width: 2) {
state "colorTemp", label: '${currentValue}K'
}
controlTile("colorTempSliderControl", "device.colorTemperature", "slider", height: 1, width: 4, inactiveLabel: false, range:"(2700..9000)") {
state "colorTemp", action:"color temperature.setColorTemperature"
}
controlTile("rgbSelector", "device.color", "color", height: 6, width: 6, inactiveLabel: false) {
state "color", action:"setAdjustedColor"
}
/*controlTile("colorName", "device.colorName", "button", height: 2, width: 4, inactiveLabel: false, decoration: "flat") {
state "colorName", label: 'Color ${currentValue}', action: "color temperature.setColorTemperature"
}
standardTile("refresh", "device.switch", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}*/
main(["switch"])
//details(["switch", "Brightness", "levelSliderControl", "colorTemp", "colorTempSliderControl", "rgbSelector", "colorName", "refresh"])
details(["switch", "Brightness", "levelSliderControl", "colorTemp", "colorTempSliderControl", "rgbSelector"])
}
@AdamV or anyone else… I have an issue with the “SLIDER_CONTROL”, it doesn’t get a value set unless you adjust the temperature or color. Still working on it, but if anyone wants to take a look…
https://github.com/ericvitale/other/blob/master/devicetypes/lifx/lifx-group.src/lifx-group.groovy
Ok, this works. I had to remove the double from the setLevel method parameters.
For personal use, I removed the “version” from the title.
https://github.com/ericvitale/other/blob/master/devicetypes/lifx/lifx-group.src/lifx-group.groovy
Adam, thank you for this handler. I’ve always been a bit annoyed by ST’s handling of grouping lights. So far appears to be working great. One request, if it’s possible. Is there a way to have your handler or even the “Lifx Connect” poll the status of the bulbs after an interval? If I turn on or off my lights using anything but smartthings it never refreshes in ST. Really annoying, especially when using SmartTiles.
@stephack - I haven’t seen @AdamV post on this thread in a while. I created a new device handler called LIFX groups of groups. It allows you to do a single group or multiple groups. It also doesn’t require you to know the group id, just the name like “Kitchen” or “Office”. My device handler kind of does what you want when some of the lights are on/off or you use another app to turn them on or off. Right now you have to hit refresh. Working on this tonight to make it so you don’t have to. It might already do it, I just didn’t test the time for the poll refresh.
Great…thank you. I’ll check out your handler later today and look forward to any updates you can make. Hopefully it has a decent polling rate already. This is why I love the ST community.
I tested it out last night (meaning payed attention to it). It doesn’t refresh correctly. I have stated another thread asking for some help / feedback.
No help from the community thus far I guess.
Let me know if you come across anyway to get this working. If not, thanks anyway.
Well, I am actively trying to figure this problem out because I use it everyday. I’m not giving up.
Hey guys - sorry for the silence… I’ve been away.
Re: Group of groups … this looks great. I live in a flat so I guess I never thought of that! Regarding grouping of devices in general, there is an exceptional app out there called “Trend Setter” by @Kriskit which can group together and sync up all kinds of devices (not just lights), and make new group devices for them in your smartthings setup. Check it out! I’ve been using it for about 6 months with few issues
Re: refreshing - have you tried pollster?
@AdamV - I was using Trend Setter. Unfortunately I have a lot of lights and it took too long for Trend Setter to turn them on 1 by 1. For groups of group I used their API to send a list of groups and they all turn on instantly.
BTW - I’ve added a background refresh option that the user can set on the device so that if you use the LIFX app, SmartThings will eventually keep up based on how frequently you poll their servers. According to LIFX you can make 216K requests per day (60 per minute). With the settings I use I only do about 288 (every 20 minutes). Could do more I guess…
That’s very nice!
Also thanks for solving the initial level bug - I spent ages on that when i first did this and got nowhere
If you fancy taking on and iterating the main LIFX Groups code or amalgamating it all into one base please feel free to do so - and I’ll share the Github with you so you can put it all in one place.
From my perspective, I’ve got it all working as I’d like in my place (although I’d prefer to be using the local UDP protocol… but that’s not possible at present). However I can see how a lot of your iterations and improvements could make this considerably better going forward… so if you wanna take this on… it’s all yours… let me know!
Looks promising…how do I add this to my current device type.
Instructions on my ReadMe.
I already have the device handler installed and functional. I just need to know how to configure the polling schedule you described and pictured above. I even reloaded the code from:
but i still dont see the option for scheduling.
Go into the detailed view of the device on your phone. It will look like this but with a different name.
Hit the gear icon on the top right.
Scroll down to the bottom of the settings. Its a long way down.
It isn’t perfect but it works. LIFX allows 200,000+ requests per day. Setting them to 5 minutes takes only 288 requests.
I understand your instructions but when I scroll to the bottom of the settings page I have Group 10, Log Level and then the remove button. There is no schedule section as pictured. I don’t believe I am running the same updated code that you are. Please see the link I referenced in my previous post. Is this the correct code for the device handler you are currently using? If not, please post a direct link. It might also be a good idea to use version numbers and a brief description of whats changed since the last version in the comments at the top of your code. This would help us know if we are using new or outdated code.
I added version numbers and committed BUT… The version with the auto refresh capability has been in github since 07/09/2016, you can look at the history. Make sure you are updating correctly from GitHub. BTW, mind taking this conversation over to the device handler’s thread?