Totally lost.. please help

ok,

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?

thank you

First question - why do you want to change the temperature of a bulb that isn’t switched on?

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.

Is the wireless dimmer controlling the light via homeassistant?

Is the Alexa integration via homeassistant?

In short no and no… I didn’t know I could run them via home assistant… I’m happy to change that if…

  1. I know how…
  2. it makes things easier…

OK -

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.

1 Like

Thank you,

I’ll try and work out how to do those… Will let you know how I get on with it.

Thanks again

1 Like

ok been trying to really simplify this to see if I can get the basics to work (as i understand it).

here is what I have:-

- id: '1542642627094'
  alias: Change colour of bedside lamp at night
  trigger:
  - at: '21:30'
platform: time
  condition: []
  action:
data:
  temperature: warm
  brightness: 100
service: light.turn_on   
entity_id: light.tradfri_bulb_e14_ws_opal_400lm

but nothing happens… if I remove the line “temperature: warm” then the light turns on but the temperature does not change (obviously).

have i miss understood?

my thought was, do this then do another to turn the light off 1 second later.

my appologies if I am being a pain, i have no real coding skills and very limited understanding of the workings here, though I hope to learn.

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.

It’s not being a pain, it’s all a learning curve :slight_smile:

1 Like

thank you for your patience and help.

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/"

I’ve edited my last post to correct the indentation (I think)

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?

thank you again for all your help and time.

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.

1 Like

thank you, think this will be a small project and a learning curve.
I’ll do some research on it and see if I can work it out .

once again thank you for your help. time and patience

1 Like

been trying my hand at this…

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.