The MiLight iOS app has a scale from 2700K-6500K, I assume that to have some relevance
hahahahaha!! Good call. What is the range in HA then? Yeah they should match for sure.
Iāve just gone through all my automations and split out the Kelvin into a second action and removed the effect:white where appropriate. I also edited my scenes and used my Kelvin:2300 - I might change that to your suggested 2474 and see if I like it.
However, now I have done that, when I use the lightning bolt on/off it is bringing them on with the right colour temperature. I just donāt get how it sets the state when you use the lightning bolt - itās going back to the last state now which is what I would expect but it wasnāt doing that beforeā¦
When a light platform does not specify its temperature range, the HA standard range is 2000K-6500K.
I donāt quite understand your last paragraph, let me know if there is a question in there ā¦
2474 looks similar kelvin to 3100 in milight app.
When I use the lightning bolt I thought it was supposed to use the last state (colour, brightness, warmth) but it wasnāt doing that. If I use the Automation it seems different.
- action:
- data:
brightness_pct: 75
entity_id: light.lounge
service: light.turn_on
- data:
entity_id: light.lounge
kelvin: 2474
service: light.turn_on
alias: Turn Lounge Light On 1:50 before Sunset
condition: []
id: '1505977024303'
trigger:
- entity_id: light.lounge
from: 'off'
platform: state
to: 'on'
- event: sunset
offset: -01:50:00
platform: sun
So this is my automation to turn the lights on 1:50 before sunset. Works great. However,:
It comes on white, changes to blue and then goes white again. Why does it go to blue initially? I used to have effect: white in there before you said itās not needed. Itās like it has colour mode as the default state. When I last switched it off it was white.
I donāt know why that happens. It does not happen to me and I see no code that could cause it to happen.
Can you show your configuration.yaml
for limitlessled
? That should limit the amount of code I have to look at.
Could you have forgotten about a āblueā automation? (I had to ask ā¦)
I do have a blue automation but itās never automatically triggered.
# LimitlessLED
- platform: limitlessled
bridges:
- host: 10.90.11.25
version: 6
port: 5987
groups:
- number: 1
type: rgbww
name: Lounge
- number: 2
type: rgbww
name: Dining
- number: 3
type: rgbww
name: Office
- number: 4
type: rgbww
name: Spots
lights.yaml
I used to find with the slider that they would come on blue every time! It wasnāt until I removed the Kelvin setting that they would come on and stay white. I tried effect: white but something somehow was switching the light to colour mode. It also only started happening after the first time I started playing with an automation to turn them blue.
This is my current automation:
- action:
- data:
brightness_pct: 75
entity_id: light.lounge
service: light.turn_on
- data:
entity_id: light.lounge
kelvin: 2474
service: light.turn_on
alias: Turn Lounge Light On 1:50 before Sunset
condition: []
id: '1505977024303'
trigger:
- entity_id: light.lounge
from: 'off'
platform: state
to: 'on'
- event: sunset
offset: -01:50:00
platform: sun
and here is the one that I use for Blue:
- action:
- data:
brightness_pct: 30
color_name: blue
entity_id: light.lounge
service: light.turn_on
alias: Lounge Lights Movie
condition: []
id: '1508564395666'
trigger:
- entity_id: light.lounge
from: 'off'
platform: state
to: 'on'
As I said, before these latest changes I just deleted the Kelvin setting altogether. Itās just so weird and unexplainable that it goes white>blue>white when the 1:50 before sunset is triggered. Itās also weird I need to use 2 action=s to get the Kelvin setting accepted. I wonder if I still had the effect: white in the first action if it would skip blue. Itās like itās coming on in colour mode instead of white mode and I just donāt seem to be able to switch it to white. Also, I have not used the Blue automation for a few weeks.
That āblueā automation could certainly cause the behavior that you see. As a test I would start by changing it to green, just to make sure it isnāt called even if you believe it is disabled
Version 6 and rgbww is also my setup and I donāt see this issue.
Iāll give it a goā¦ but this is a bug in HA automations if thatās the caseā¦
Well, itās a bug somewhere, in HA automations, limitlessled or your config. So you have to eliminate options.
By the way, I made the Kelvin change. If you copy this file to config/custom_components/light/limitlessled.py
and restart, is kelvin: 3100
then like the MiLight app?
Wellā¦ I changed the automation to red and it came on red first. Also the on/off went through red. No reason why the on/off should do that!
Iām on Hassio so I canāt update the python file - Iāll need to wait till itās rolled out I thinkā¦
Further, if I click on the automation for movie, it says it was just triggered so itās definitely conflating the 2 separate automations with each other. So weird! I donāt see why the lightning bolt went through red as well - that does not normally go through blue.
Perhaps I should call a scene in the automation instead of setting it in the automation but Iām not sure how to do thatā¦
A scene will not help with this.
The blue (red) automation triggers when the light goes on, that will interfere with other automations ā¦ likely in unpredictable ways. Why do you think it should not trigger?
Even with Hassio, you can use a custom component like I described. It lives with the configuration and overrides the builtin platform. You should just remember to delete it when updating or it will also override the updated builtin.
Because there is no trigger - what is triggering it?
Hmm. So I have a trigger from off to on - can that be deleted so the automation is just triggered manually? Maybe that doesnāt make any sense anyway. I am using a scene anywayā¦
Oh crap! The penny is dropping!! This also explains why it does it when I turn the light on - that is triggering the automation!!
So I have a config folder - I should create a /custom_components/light/ folder under that and copy in the file?
OK Done and it works! Nice. And all my stupid misunderstanding about the automation! Scenes created and automations gone. Working perfectly now. This has been so annoying and the answer was right under my nose all the friggin time!
Thanks.
Glad we got you sorted and thanks for testing the Kelvin change
This sounds like a script more than an automation.
When I first set everything up months ago, the walkthrough I used said to create automations - but theyāre not really necessary - I can just turn on/off (lightning bolts grr) or use scenes if I want a different configuration.
In reality I almost never used the automations anyway except for a sunset one and a restart after sunset and I was tearing my hair out wondering why my lights were always going blue (and had blamed the kelvin setting) Itās a miracle I didnāt have more problems!! Now of course I donāt have to use 2 actions anymore as I can include Kelvin in the pct one. I just didnāt realise that the automation was triggering the blue colour but DUH!! the trigger was met so it triggered. Itās all making more sense to me now. I had tried to get help with this before and didnāt get any responses or help so I really appreciate your help and persistence here. I might even forgive you for the bloody lightning bolts (which I donāt see the point of still) but hey I can live with it.
Just to be clear - doing this wonāt affect my Yeelights or media players or anything else but the limitlessled? From your comment Iām not sure as I do use HA to control other things as wellā¦ Presumably this wonāt affect the settings for the lights or would it mean that the last setting would be lost and I would have to use scenesā¦ Ah I think this is what you are alluding to.
That is just a UI customization that will make all lights have the power toggle. It will not have any effect on how other things work, just how that button looks.
Edited to add: scripts are like advanced scenes. You might not need them yet but you probably will at some point.
Ok so begs the question why it changed to a lightning bolt from a toggle. I donāt see the reason or the benefit. So are you saying I lose nothing if I use that customisation?
Just one other thing, I just set the kelvin in the Mi-Light app and itās a little warmer than the 3100 in HA - itās ok - just cooler than the app. The 2474 of before is the same so itās not quite right but hey itās closer. If you want me to I can play with the number to work out what an exact match is - actually I think 2300 in HA was close to 3100 in the app (which was my first guess before you suggested 2474) so that wouldnāt be a direct conversion - but the range is different in the Mi-Light app to HA as wellā¦
I have not even looked at scripts yet - not sure what I would use those for. Iāve only recently discovered scenes