i’ve been looking to change the temperature of an Ikea bulb without having to have it switch on depending on what time it is.
ive been pointed to light templates however it makes no sense to me. what language is that? where can i find out more of what im doing? is there another way to do it?
or should I admit its more than i understand and just leave it as not automated?
its a bedside lamp(s) and when going to bed the lights are turned on by voice via alexa and i’d like them to be cool white to maximize illumination, during the night however i’d like the lights to turn on via a wireless dimmer switch (so that no voice commands to disturb the other person sleeping) and for the light to be a warm white as its softer and less likely to waken us.
If they’re NOT controlling the light via homeassistant, then what you have to do is set an automation that triggers when the light is switched on and then sets the brightness/temperature based on the time of day.
It’s fairly simple, but depending on various things it may be a noticeable delay between it coming on at the wrong setting and then changing to what you want it to be.
If you DO use homeassistant as the intermediary, then you set the automation that triggers from the Alexa command to turn the light on at whatever brightness/temperature you want, and then a different automation intercepts the wireless switch and turns the light on at the correct settings depending on the time of day.
Not quite so simple, but should prevent the issue of the delay.
So maybe try the first one seeing as that’s how you’re already configured, and then if it’s not working as desired you can reconfigure to do the second way.
The key isn’t temperature, it’s color_temp and it needs to be a numerical value, like this…
- id: '1542642627094'
alias: Change colour of bedside lamp at night
trigger:
- at: '21:30'
platform: time
condition: []
action:
data:
color_temp: A VALUE IN NUMBERS
brightness: 100
service: light.turn_on
entity_id: light.tradfri_bulb_e14_ws_opal_400lm
If you switch the light on to the color_temp you want from it’s native app, you can see the numerical value for it on your states page, and then use that in your automation.
i tried to copy and paste the code you have shown and may have “broken” something …
I entered numerical values where required and now recieved this error…
" Invalid config for [automation]: [data] is an invalid option for [automation]. Check: automation->action->0->data. (See /config/configuration.yaml, line 79). Please check the docs at https://home-assistant.io/components/automation/"
line 79 of my configuration.yaml is “group: !include groups.yaml” the groups.yaml is empty.
checked the log and found this if it helps.
" INFO:homeassistant.util.package:Attempting install of colorlog==3.1.4 Testing configuration at /config Failed config automation: - Invalid config for [automation]: [data] is an invalid option for [automation]. Check: automation->action->0->data. (See /config/configuration.yaml, line 79). Please check the docs at https://home-assistant.io/components/automation/"
ahh… i was in the process of comparing the indentation and spacing with a previous working automation. just in case that was the problem. thank you
so this is what I have now,
- id: '1542642627094'
alias: Change colour of bedside lamp at night
hide_entity: true
trigger:
- at: '21:30'
platform: time
condition: []
action:
data:
color_temp: 454
brightness: 5
service: light.turn_on
entity_id: light.bedside1
- id: '1542642627093'
alias: Change colour of bedside lamp at night off
hide_entity: true
trigger:
- at: '21:30:01'
platform: time
condition: []
action:
service: light.turn_off
entity_id: light.bedside1
it works, and the “flicker” of the light isn’t to annoying. however from your original suggestion there is another way. can you point me in the direction of what I need to learn to try that?
So basically you link the switch to homeassistant, you link an input_boolean in homeassistant to Alexa and you link your light to homeassistant BUT you unlink them all from each other.
Then you use automations in homeassistant to say 'if the input_boolean is switched on, turn the light on, if the switch is switched on turn the light on etc, but in the service to turn the light on you pass the parameters you want (depending on which method turned it on, what time it is) so it turns on at those parameters.
removed the tradfri skill from alexa, unpaired the dimmer switch from the bulb. i can still operate the bulb from ha but the switch does nothing…
so…
to get HA to control the bulb using the dimmer switch i tried this
- id: '1543857081820'
alias: test
trigger:
- entity_id: sensor.tradfri_wireless_dimmer
from: '1'
platform: state
to: '99'
condition: []
action:
- service: light.turn_on
entity_id: light.bedside1
but nothing happens… can anyone point me in the direction of where i am going wrong?
as you can probably guess i have no real idea of what i am doing but i’m trying… very trying (according to my wife)
EDIT:
after a bit more research and rereading the above comments, ive worked out that i am doing it all wrong… so i’m going to try and break this down further and see if I can work it out.