What is the error message?
I think it will probably have to do with “mapping values” or something.
Try moving the “data:” section to the left aligned with the “entity_id:”
What is the error message?
I think it will probably have to do with “mapping values” or something.
Try moving the “data:” section to the left aligned with the “entity_id:”
Did that.
I don’t seem to be getting the error message now, but I’m not getting the lamp on.
To simplify my testing, I took it back to just the following:
automation:
- alias: 'Someone At The Front Door'
trigger:
platform: template
value_template: '{{states.switch.front_door_15.attributes.device_tripped}}'
# The Condition Syntax from https://www.home-assistant.io/docs/scripts/conditions/
condition:
condition: time
# At least one of the following is required.
after: '08:00:00'
before: '20:00:00'
# Text to Speech
action:
- service: tts.google_say
entity_id: media_player.whole_house_doorbell
data:
message: 'Motion Detected At The Front Door'
# Bedroom Light On - Red at Full Brightness
- service: light.turn_on
entity_id: light.yeelight_bedside_7811dc9201bd
data:
brightness: 100%
rgb_color: [255, 0, 0]
If I run the trigger via the card on the front end, I get the message playing on all my GHM’s but the lamp doesn’t come on.
If I make the following change (simply hash out the data, brightness and rgb_colour lines), then I get the message AND the light comes on (at the colour and brightness it was last on) :
# Bedroom Light On - Red at Full Brightness
- service: light.turn_on
entity_id: light.yeelight_bedside_7811dc9201bd
# data:
# brightness: 100%
# rgb_color: [255, 0, 0]
So in summary, having the 3 lines (data, brightness and rgb_colour) stops the lamp from coming on (no error messages though), hashing them out makes the lamp work again.
I tried just having the data and brightness one “active” but the lamp didn’t work.
One other thing I just thought of. Since I have one automation with one alias but it has 2 triggers (night time alarm and daytime alarm), which one would be tested when I use the front end trigger button ?
Edit: For some reason, I only got errors when I un-hashed the 2nd trigger (the nighttime one) with the errors saying there were duplicate actions, triggers etc. So I gave each a unique alias.
Thanks
Max
I had missed that you didn’t have the two actions split by an alias:.
You figured out that you can’t do that tho.
As far as the light brightness & color goes I don’t have a color changing bulb but I have a goControl bulb that is dimmable and the action I use is:
action:
service: homeassistant.turn_on
entity_id:
- light.zw_light_2_level
data:
brightness: 32
Where 0 is off and 255 is 100% bright.
I don’t know exactly what the format you need for your bulb is, tho.
When I removed the hash from the data line and brightness line and put just a number for the brightness, it (the number) was in red. When I make it a %, it is in black font.
Does that mean that it’s indicating when it’s poor/incorrect syntax when red and ok when black?
no.
If you are using a code editor (like notepad++ or something similar) it just indicates that it’s a number. It really doesn’t “know” if the syntax is correct or not because it probably doesn’t “know” all coding languages.