lightEffect Atribute triggering Warnings for Size

@gopher.ny and @bobbyD

I update my driver recently to properly populate the lightEffects attributes based on the list of scenes that come with the devices my integration supports. It appears that there is a known limitation of 1024 charecters for Attributes. Specifically related to dashboards This has now caused a couple of users to bring this up with me when they check there logs.

The simple truth of the matter is 1024 is not a large limit when you have devices with over 130 scenes/light effects. This is a standard attribute on a stanard capability though for light effects, and I feel like i am using it as intended.

Hubitat folks, is this a expected issue. If so what impacts/consequences are created by lightEffects being larger then 1024 charecters. I would ask if this could be excluded from this warning in some fashion if it is non impactful.

Could you store the data in one of the other options on a device other than an attribute? As I understand it these are meant for values that are used in defined / event-based values for use in automations or things like dashboard display. Other data could be stored in state variables and state data (I could have the terms wrong there). Could you not use these.

I feel like @bertabcd1234 or @thebearmay or someone with similar authority can guide you on this with more confidence than I can... At least from within the Community.... And obviously Victor.... :slight_smile:

I hear you, and for the longest time I didn't use the LightEffects Attribute. On my devices drivers, the Scenes/LightEffects have always been stored in State values for this purpose. Recently I was asked to look into the LightEffects Attribute since it is part of the defined standard. The below image is from the Hubitat Documentation and show how the capability is defined.

My concern is maybe this capability needs to be re-evaluated with this issue. I can imagine as light effects continue to get more poular this limit may get hit more and more. It also isn't wihout some precedent for Attributes to be used to store values in JSON format as it is also seen with devices with Fan functionality.

I really hope this standardized way of scene management is fallowed so that we can create apps to better utilize these functions. I have one that i am working on now that is working great with my Govee Devices using the Attribute, but the only other devices i have with the LightEffects capability do not populate the attribute. Maybe the real question is what is the purpose or expected use of that attribute

2 Likes

Fair enough, if the standard (in HE) does not suit the reality of devices that might use the capability, then that makes sense to raise with the higher-powers.

1 Like

It would be interesting to know how or if the lightEffect Attribute is used by other devices/drivers/systems that can use it. The built in Wiz bulbs driver doesn't populate it, The community driver did though. I found that out in my app testing. I wonder if any other devices that support Light Effects has the value populated. Part of my hope is to allow the app i am creating to work with more then just one brand of device. That won't be possible without a standard way to manage this stuff. The Light Effects capability seems like the best bet if everything fallows it.

Feels like something to "not support" as a starting point in your app, then add if you need to...easy for me to say...

It really isn't a matter of me supporting the other devices, as it is are they following the capability standards that are documented. Right now my device selection is based on the Device Capability in the SmartApp UI. This is typical for smartapp UI's in that we use selections based on Device capability with the expecation that indicates what the device supports and what commands i you have.

For instance with the Wiz bulb I will end up reaching to @gopher.ny to please include the attribute to fully support the Capability.

So if i released the app today, It wouldn't be that i don't support xyz devices, but It is i support all devices that fully support the LightEffects Capabilty, and if your devices does not populate the lightEffect attribute when try to use it, please contact the device driver developer to popuate that value.

Ofcourse that assumes I have the right expecation of the intent of the attribute and how that attribute should be used.

1 Like

Can you point me to a driver's source and the circumstances that you're running into the limit under? I'd like to see how it is implemented, but basically yeah, the lightEffects attribute can be an exception.

I'll check the Wiz light driver, too.

2 Likes

In the case that was brought to me it is one of my drivers for Govee Light Devices. It was brought to me by a user, and it looks to be a issue related to the Legacy Dashboards. I have tested the EZ Dashboards and they don't seem to care about it. When I tested it with one a test legacy dashboard I was able to reproduce it.

The length of the field will vary from device to device and depending on if the user is using LAN API vs Cloud API. The largest list i know of right now is around 141 scenes and when i check the full length of that attribute as it was written it was 2671 characters. That is just the lengh of it and i don't even have any of the DIY effects included.

You can view the code for how it is created by reviewing my library code file Govee_Lan_API . The method in question is between lines 322 and 372, with the code actually creating the json and then posting of the event on line 370 and 371.

The output that is created is like this below

{"1":"Ocean/Deep Sea","2":"Romantic","3":"Sunset","4":"Rainbow","5":"Fire","7":"Forest","8":"Flower Field-B","9":"Sunrise","10":"Sunset","20":"Spring","21":"Summer-A","101":"Sunrise","102":"Sunset","103":"Forest","104":"Rustling leaves","105":"Universe-A","106":"Universe-B","107":"Meteor","108":"Meteor shower","109":"Aurora-A","110":"Aurora-B","111":"Lightning-A","112":"Lightning-B","113":"Lightning-C","114":"Starry Sky","115":"Snow flake-A","116":"Snow flake-B","117":"Spring","118":"Summer-A","119":"Summer-B","120":"Fall","121":"Winter","122":"Rainbow","123":"Fire-A","124":"Fire-B","125":"Fire-C","126":"Ripple","127":"Wave-A","128":"Wave-B","129":"Deep sea","130":"Desert","131":"Karst Cave-A","132":"Karst Cave-B","133":"Karst Cave-C","134":"Glacier","135":"Gobi Desert","136":"Moonlight-A","137":"Moonlight-B","138":"Cornfield","139":"Flower Field-A","140":"Flower Field-B","141":"Volcano-A","142":"Volcano-B","143":"Downpour","144":"Sunny-A","145":"Sunny-B","146":"New Years","147":"Christmas-A","148":"Christmas-B","149":"Halloween-A","150":"Halloween-B","151":"Valentine's Day","152":"Candlelight","153":"Birthday","154":"Fireworks-A","155":"Fireworks-B","156":"Ghost-A","157":"Ghost-B","158":"Party-A","159":"Party-C","160":"Dance Party-A","161":"Dance Party-B","162":"Disco-A","163":"Disco-B","164":"Carnival","165":"Mother's Day","166":"Father's Day","167":"Christmas Tree","168":"Sled","169":"Christmas Gift","170":"Sweet","171":"Dating","172":"Movie","173":"Sports","174":"Siren-A","175":"Siren-B","176":"Game-A","177":"Game-B","178":"Game-C","179":"Game-D","180":"Crossing","181":"Night-A","182":"Night-B","183":"Sleep-A","184":"Sleep-B","185":"Sleep-C","186":"Morning","187":"Afternoon","188":"Study","189":"Business","190":"Reading","191":"Work","192":"Leisure-A","193":"Leisure-B","194":"Meditation-A","195":"Meditation-B","196":"Meditation-C","197":"Care-A","198":"Care-B","199":"Fight","200":"Dreamland-A","201":"Twinkle","202":"Dreamland-B","203":"Dreamland-C","204":"Dreamland-D","205":"Dreamland-E","206":"Dreamland-F","207":"Dreamland-G","208":"Breathe","209":"Energetic-A","210":"Energetic-B","211":"Energetic-C","212":"Energetic-D","213":"Excited-A","214":"Excited-B","215":"Excited-C","216":"Happy-A","217":"Happy-B","218":"Enthusiastic","219":"Profound","220":"Mysterious-A","221":"Mysterious-B","222":"Quiet-A","223":"Quiet-B","224":"Longing","225":"Warm-A","226":"Warm-B","227":"Stacking","228":"Release-A","229":"Release-B","230":"Flow-A","231":"Flow-B","232":"Flash","233":"Swing","234":"Tension-A","235":"Tension-B","236":"Cheerful","237":"Rush","238":"Heartbeat-A","239":"Heartbeat-B","240":"Crazy","241":"Fascination","999":null}

Thanks, It would be awesome if we can get more devices to have a valid json for the lightEffect attribute. This could mean my new app could interact with all of those devices to automate light effects across multiple brands of devices. Right now that can be kind of tedious

1 Like