#simple automation that wont work

37 messages · Page 1 of 1 (latest)

empty crown
#

im trying to create a simple automation that will trigger a fan when the humidity of an entity is over 69% and it just will not trigger here is the below yaml

alias: Turn red eye Fan On When Humidity is 70% or Above
description: Turns on the fan when humidity reaches 70% or higher
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.red_eye_probe_red_eye_humidity
    above: 69.1
conditions: []
actions:
  - target:
      entity_id: switch.red_eye_fans_red_eye_fan_switch
    action: switch.turn_on
    data: {}
mode: single
prime templeBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

crystal citrus
#

After you've formatted it:

  1. The sensor has to start at 69.1 or below and then go above that for the automation to trigger
  2. What does the trace show?
  3. Have you tested the automation?
prime templeBOT
#

To test an automation there's three stages you can follow. Testing the action, the condition and action, and the whole automation:

  1. Use Configuration -> Automations to find the automation and then select Run in the three dots menu. If this fails your problem is in the action: section, and details should be found in your log file
  2. Use Developer tools -> Services and call automation.trigger on the automation with skip_condition: false. If the first passes but this fails then the problem is in your condition: block
  3. Use Developer tools -> States to find the trigger entity, click the name, then change the state (at the top) to something that'll trigger the automation before pushing Set State. If this fails then the problem is with your trigger: section, or the automation is turned off (you can check that in Automations, automations that are turned off will show Disabled)

You can also see this section in the docs about testing and automation traces.

empty crown
#

current state

crystal citrus
#

The sensor has to start at 69.1 or below and then go above that for the automation to trigger

#

What value does that sensor have?

#

Hint: ||it's already above 69.1||

empty crown
#

ok so how would i make it trigger if its state is already above that?

crystal citrus
#

Wait for it to drop below?

#

Also add a startup trigger and a numeric state condition?

#
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.red_eye_probe_red_eye_humidity
    above: 69.1
  - platform: homeassistant
    event: start
conditions:
  - condition: numeric_state
    entity_id:
      - sensor.red_eye_probe_red_eye_humidity
    above: 69.1
bold lance
#

you can also use the developer tools: state editor to change the state manuall

#

so set it to 50 then back to 69.1+ or just wait for it to update after changing it down to 50

empty crown
crystal citrus
#

What does the trace show?

empty crown
crystal citrus
#

What does the history of that entity look like?

#

Click the A/B box

empty crown
crystal citrus
#

Ok, so you changed the automation

#

Please share it

#

It's harder to help you if you change things and don't share

empty crown
#

did i ooops how do i show the changes?

crystal citrus
#

You post the code here - as you already did before

empty crown
#

the code i posted at the start of this is the most recent code thats why im confused

crystal citrus
#

that trace isn't for that automation

#

that trace is for a state trigger, and has a numeric_state condition

empty crown
#

thats because that automation hasnt triggered i changed the code to the above this morning and it hasnt triggered so there will be no new trace hence the reason i am here

crystal citrus
#

What does the history of that entity look like?

#

If it stayed above 69.1 since you changed it then clearly it won't have triggered

#

It'd also have helped if:

  1. you'd told us sooner that you'd changed it
  2. you shared traces from the current automation, or told us you didn't have any - rather than us wasting time on that
empty crown
#

sorry but im new to all this, i still dont fully understand how all this works if im wasting your time just leave it

crystal citrus
#

What does the history of that entity look like?