Simple automation doesnt work :(

Hi All, can anyone please tell me what im doing wrong? I built this using the Automation UI but it doesn’t work. I’ve tested all the individual bits and am puzzled as to why such a simple automation does nothing.

The logic is Simple IF nest away changes from “off” to “on” THEN turn “off” Lounge Light.

- id: '1536901814097'
  alias: Turn Off Lounge Light
  trigger:
  - entity_id: binary_sensor.kilsyth_villa_away
from: 'Off'
platform: state
to: 'On'
  condition: []
  action:
  - data:
  entity_id: switch.lounge_light
    service: switch.turn_off

Lowercase off and on.

(I’m presuming the indentation being all over the place is a paste error, but if not then that needs sorting too)

1 Like

Hmm, I’ll give that a shot - I copied the displayed formating from the UI, I’ll change to lowercase.

Yeah formating is likely broken from copying from the Configurator Web front end.

So fix it!

meh! Cant be bothered! :grinning:

Thank you kind sir, I just set to lower case and triggered the automation … and voila, it works now! :sunglasses:

Surprised anyone wants to help you with that attitude.

Anyway, are you sure your light is really switch.lounge_light? It should be usually light.lounge_light

1 Like

Overreacting a bit aren’t you. I already covered that the config was generated by the UI so indentation was highly unlikely to be the issue (and wasnt).

It’s a non-dimmable Wemo Light switch and that is what is in the config files, so that is what I used. It always worked by itself and calling the entity via json always worked too.

I just failed to realise that for the automation config I needed to stick to lowercase for the binary sensor values as the UI always capitalized the on/off.

Just as an extra point of information…

It’s not that you always have to use lower case. It’s that you always have to match the case. Most times things will be all lower case. Sometimes things will be capitalized. Just make sure the code matches the reported state.

1 Like

Howdy, you are entirely correct, I made the mistake of thinking that the case presented in the UI was the correct case to use in automatons.