Emulating a Short-Cycle Timer

Home Assistant automation projects, questions, etc. go here.
Gumbo
LED-Curious
LED-Curious
Reactions:
Posts: 10
Joined: Fri Jul 17, 2020 12:15 am

That was it! I made the change in the automation file to direct toward the switch I'm using and it's working!

Took two clones, a peach ghost and a chocolate 7 pot, from my outdoor garden and got it set up and running. Also had some japanese mustard greens seeds laying around and started those. The seeds have already cracked and should have some sprouts soon.

I noticed that my clones were wilting at 5 sec on, 20 mins off. I cranked it up to 15on/5 off and they rebounded. So cool to be able to control this via the app on the fly. Looking forward to getting some more sensors and figuring out more automation! I'm currently hand measuring my reservoir every day.
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

Nice!

Of course, an update just came through for Home Assistant today where they overhauled scripts and automations that would have made this WAY easier to do than how I did it.
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
Gromyjoe
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 48
Joined: Fri Jul 03, 2020 2:28 pm

I'm not having any luck creating this automation. it only runs once, Im able to change the on and off time and the switch toggles but i have to turn off and back on the cycle pump switch.
Gromyjoe
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 48
Joined: Fri Jul 03, 2020 2:28 pm

as far as i can tell its exactly the same as your code, but it only cycles once.

automations.yaml

Code: Select all

- id: '1595019292093'
  alias: Cycle Pump GO
  description: ''
  trigger:
  - entity_id: input_boolean.cycle_pump
    platform: state
    to: 'on'
  condition: []
  action:
  - data: {}
    entity_id: script.1595017680358
    service: script.turn_on
- id: '1595019345732'
  alias: Cycle Pump STOP
  description: ''
  trigger:
  - entity_id: input_boolean.cycle_pump
    platform: state
    to: 'off'
  condition: []
  action:
  - data: {}
    entity_id: switch.water_pump #PASTE IN THE ENTITY ID OF YOUR SWITCH HERE
    service: switch.turn_off
  - data: {}
    entity_id: script.1595017680358
    service: script.turn_off
  - data: {}
    entity_id: script.1595017404845
    service: script.turn_off
scripts.yaml

Code: Select all

'1595017404845':
  alias: Cycle Pump On and Off
  sequence:
  - data: {}
    entity_id: switch.water_pump #PASTE IN THE ENTITY ID OF YOUR SWITCH HERE
    service: switch.turn_on
  - delay:
      seconds: "{{ states('input_number.pump_on_time') | int }}"  #change the "seconds" at the beginning of this line to minutes or hours or whatever unit  you want your on time input to be... this one matters!
  - data: {}
    entity_id: switch.water_pump #PASTE IN THE ENTITY ID OF YOUR SWITCH HERE
    service: switch.turn_off
  - delay:
      seconds: "{{ states('input_number.pump_off_time') | int }}" #change the "seconds" at the beginning of this line if you want your off time input to be in minutes, hours, or whatever
  - data: {}
    service: script.1595017680358
'1595017680358':
  alias: Call Pump Script
  sequence:
  - wait_template: "{{ is_state('script.1595017404845', 'off') }}" #The wait ensures the other script is ready to be called
  - data: {}
    entity_id: script.1595017404845
    service: script.turn_on
Gromyjoe
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 48
Joined: Fri Jul 03, 2020 2:28 pm

I finally figured it out!
heres the change that worked for me.

Code: Select all

'1595017404845':
  alias: Cycle Pump On and Off
  sequence:
  - data: {}
    entity_id: switch.water_pump #PASTE IN THE ENTITY ID OF YOUR SWITCH HERE
    service: switch.turn_on
  - delay:
      seconds: "{{ states('input_number.pump_on_time') | int }}"
  - data: {}
    entity_id: switch.water_pump #PASTE IN THE ENTITY ID OF YOUR SWITCH HERE
    service: switch.turn_off
  - delay:
      seconds: "{{ states('input_number.pump_off_time') | int }}" #change the "seconds" at the beginning of this line if you want your off time input to be in minutes, hours, or whatever
  - data: {}
    entity_id: script.1595017680358
    service: script.turn_on
'1595017680358':
  alias: Call Pump Script
  sequence:
  - wait_template: "{{ is_state('script.1595017404845', 'off') }}" #The wait ensures the other script is ready to be called
  - data: {}
    entity_id: script.1595017404845
    service: script.turn_on
I changed the service to"script.turn_on" and added entity_id "script.159501730845"
Im assuming the reason it didnt work before is because it was only calling the service and not telling the script to turn on.
warmachine
LED-Curious
LED-Curious
Reactions:
Posts: 18
Joined: Wed Sep 02, 2020 3:48 am

I just started with nodeRed so, there is probably a better way to do it but, here is the repeat cycle timers I have setup on a smart strip. One runs on a schedule to only run when the lights are on. The other two run continuously.
Attachments
noderedRepeattimer.jpg
Gromyjoe
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 48
Joined: Fri Jul 03, 2020 2:28 pm

I should really give nodered a solid effort someday, I just couldnt find a good tutorial on it espesially since most Home assistant setups are for home automation and online services and not so much greenhouse type setups.
I have all my pumps and fans working on timers, now i just need to figure out how to disable the circulating fan timer and keep the fan on while the lights are on.. Maybe the interlocking feature in esphome? Soooooo much information to learn and try to remember lol
warmachine
LED-Curious
LED-Curious
Reactions:
Posts: 18
Joined: Wed Sep 02, 2020 3:48 am

Gromyjoe wrote:
Sat Oct 03, 2020 2:09 pm
now i just need to figure out how to disable the circulating fan timer and keep the fan on while the lights are on
The first node in the string is actual an input Boolean in home asssistant for automation not the switch itself. This allows me to disable the automation while still being able to use the switch itself. You can have the input boolean switch off on a timer and another switch the fan on until the input boolean for the automation comes back on.
Post Reply