Relay Automation not triggering at 8am , but works fine once manually started

I have several automations for a grow room. If any one has suggestions for a thorough tutorial for non-programers please send a link. I have been using trial and error in the user interface. This one is for CO2 enrichment. I have a zigbee sensor and a zigbee relay that controls a solenoid valve
It does not start to work at 8AM unless it start it manually. Once it is manually activated it works the rest of the day just fine.

I want to trigger the relay when the CO2 sensor reads less than 925ppm
On the Condition that the Time is after 8AM and before7:45PM

I have a separate automation that de-activates the CO2 at 975ppm any time day or night.

id: '1659540607748'
alias: CO2 950 ppm Controller Activator
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.co2_temp_humidity_alab_co2
    attribute: co2
    above: 0
    below: 924.9
condition:
  - condition: time
    before: '19:45:00'
    after: '08:00:00'
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
action:
  - type: turn_on
    device_id: bfe64e0199bbb2cf6d5d792a73d573e9
    entity_id: switch.co2_relay_0x00124b00226c90e7
    domain: switch
mode: single

The automation is written so that it triggers when the sensor goes between that range during that time window.

If it is already in that range at the start of the window, it won’t trigger.

You need to add another trigger, and condition, to handle what you want:

trigger:
  - platform: numeric_state
    entity_id: sensor.co2_temp_humidity_alab_co2
    attribute: co2
    above: 0
    below: 924.9
  - platform: time
    at: '08:00:01'
condition:
  - condition: numeric_state
    entity_id: sensor.co2_temp_humidity_alab_co2
    attribute: co2
    above: 0
    below: 924.9
  - condition: time
    before: '19:45:00'
    after: '08:00:00'

Thank you for the advice. I have implemented it , I will confirm tomorrow that it is working properly.

The automation is working great now.
I should have asked for help a month ago. I have been tinkering with it for way to long with no success, when all I needed was a real Tinkerer!
Thank you.

1 Like