Hi Guys…
I am new here and I am trying to setup an Automation in HA.
When I open the Front Door (Wyze Door Sensor) the idea is to get the Hue Light Bulb to turn.
I have a Nortek dual USB connected to a RaspBerry Pi 4 and everything looks good and I can see all my devices and entities.
I have tried multiple ways but no luck
Because the example you posted has lost all its formatting (and gained a lot of extraneous asterisks) it’s nearly impossible for anyone to check it for proper indentation (which is essential for YAML). Nevertheless I do see something that is incorrect and that is the state of the binary_sensor. Your example uses uppercase 'ON' but it should be lowercase 'on' because a binary_sensor’s state is either on or off.
Beyond that, I suggest you try to copy-paste the automation’s code again and this time try to preserve its original formatting. After pasting the code into the forum’s message, put three consecutive back-quotes ``` on a separate line before the code and three more on a separate line after the code. The forum’s editor understands that anything between the two sets of back-quotes is to be formatted as code.
Just for further clarification, the three back quotes are not single quotes. It’s the backward quote that’s usually above the TAB and under the ESC way over on the left of the keyboard. The back quotes look like this ` where the single quote looks like this '. If you put three back quotes above and below your code, it looks like this when you’re reading it:
alias: Porch Lights ON
description: (Front Door Sensor)
trigger:
platform: state
entity_id: binary_sensor.wyzesense_77a90a7a
to: ‘on’
condition:
condition: sun
before: sunrise
after: sunset
action:
service: light.turn_on
entity_id: light.philips_lte001_1c91d308_level_light_color_on_off
data: {}
mode: single
If I wanted to add a timer to turn OFF after 10 mins; would it be a different AUTOMATION?
I use this to turn on my hallway lights when the motion sensor is in the on state. When the motion sensor is in the Off state for 30sec, the lights turn off.
I have modified it to your condition. Further adjustment maybe needed for the 00:10:00
I can explain that part but, as you can see, I have deleted the example I had posted because I assumed it was a motion sensor but it’s actually a contact sensor (making the example non-applicable).
The automation had two triggers. One was a Template Trigger and the other a State Trigger. Depending on which one triggered, the action would be different. To know which one triggered, you can use trigger.platform.
In this particular example, if the Template Trigger had triggered then the action would be to turn on the light. Otherwise, it was the State Trigger that triggered and the action would be to turn off the light.