Hello new to automations never made one before. I just integrated wled and tried to setup an automation inside the HA configuration are im only able to get my wled to turn on after below sun but I would like to set an effect as well any help would be awesome.
Hi,
look at the wled integration page. There is a lot of information, what data could be used.
Below is a short codesnipped. It is for a wled preset, but effect is nearly the same. Just use the right service.
- service: wled.preset
entity_id: light.ambilight_tv
data:
preset: 1
Would something like this work?
- id: '1608552738889'
alias: turn xmas lights on
description: ''
trigger:
- platform: sun
event: sunset
condition: []
action:
- domain: light
entity_id: light.carport
device_id: removed
type: turn_on
brightness_pct: 100
data:
effect: Merry Christmas
Donât know where you get that â- domain:â from. Never seen that before in HomeAssistant (what doesnât mean, that it doesnât exist! Iâm also a beginner).
Just checked again the integration page of WLED. It seems like the service âwled.effectâ is only for the effect and for nothing else. No brightness, nothing. You need two service calls. 1st to turn the light on and set the brightness, 2nd to set the effect.
Just created a testfile for your scenario and it works.
action:
- service: light.turn_on
entity_id: light.carport
data:
brightness_pct: 100
- service: wled.effect
entity_id: light.carport
data:
effect: Merry Christmas
This is what i got using your example but still wont load in HA.
I grabbed the condition right from HA website.
from this bottom example https://www.home-assistant.io/cookbook/automation_for_rainy_days/
i only deleted the offset.
automation_xmas:
- alias: Christmas
trigger:
- platform: sun
event: sunset
condition:
condition: state
entity_id: sun.sun
after: sunset
action:
- service: light.turn_on
entity_id: light.carport
- service: wled.effect
entity_id: light.carport
data:
effect: Merry Christmas
Remove automation_xmas:
because thatâs not a valid domain.
If you are creating the automation within the automations.yaml
file, you shouldnât be adding any domain name to it (it is implicitly understood to be automation:
).
Still saying invalid config.
- alias: Christmas
trigger:
- platform: sun
event: sunset
condition:
condition: state
entity_id: sun.sun
after: sunset
action:
- service: light.turn_on
entity_id: light.carport
- service: wled.effect
entity_id: light.carport
data:
effect: Merry Christmas
The State Conditionâs indentation looks off. What are you using to compose this automation?
Also, if you run Check Configuration, it reports much more detail than just âinvalid configâ. It would be helpful to share that.
log file I started out trying to use the UI Automation creator but couldnt not get it then start over and grabbing snippets from various automations i could find on the net my googlefoo is off lately
2020-12-22 15:54:39 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [after] is an invalid option for [automation]. Check: automation->condition->0->after. (See /config/configuration.yaml, line 9).
You have created a State Condition but borrowed an option from the Sunrise/Sunset Condition. Thereâs no after
in a State Condition.
What you want is this:
condition:
condition: sun
after: sunset
i just figured it out one Tab too many i fixed the indentation and is now working thank You guys for helping me figure this out.
changed condition to this and working.
condition:
condition: state
entity_id: sun.sun
state: below_horizon
There you go! Itâs State Condition or Sunrise/Sunset Condition but not an amalgamation of the two.