Hey guys I am trying to write a simple pool automation timer to turn my pump on at a certain time at night and run for 8 hours no matter what i try it just will not trigger the pump please help.
but I see in error log my world clock is not correct.
Invalid config for [automation]: platform worldclock.time_brisbane does not exist for automation for dictionary value @ data[‘trigger’][0][‘platform’]. Got None
and
2017-09-12 16:37:24 ERROR (MainThread) [homeassistant.loader] Unable to find component automation.sensor.time_brisbane
Ive had to use world clock because using the ( time ) version gives me incorrect time for my region and had to use this config below for my time sensor.
platform: worldclock
name: Time Brisbane
time_zone: Australia/Brisbane
its entitie id shows as
sensor.time.brisbane
but i did try it as the platform and no triggering
I am currently using these light automation and they work perfectly
- alias: Turn on Theater Room Light when there is movement
trigger:
platform: state
entity_id: binary_sensor.theater_pir
to: 'on'
action:
service: homeassistant.turn_on
entity_id: light.theater_room_light
- alias: Turn off kitchen light 10 minutes after last movement
trigger:
platform: state
entity_id: binary_sensor.theater_pir
to: 'off'
for:
minutes: 10
action:
service: homeassistant.turn_off
entity_id: light.theater_room_light
by memory the time platform uses a different time to my time zone way off my system time by like half a day this is why im using world clock as to get correct time so as to use for my automation you would think this would be a easy fix lol. has been driving me up the wall for days ill just use sun as trigger until we can find a solution for world clock / time.
thanks for all your help too much appreciated.
You are saying that a time trigger doesn’t work for you and it appears to be shifted by half a day. Queensland is 10 hours ahead of UTC - is that maybe the time difference you see? Have you explicitly set your timezone in the configuration? If not, I believe UTC is the default timezone.
Once you have your time zone fixed and local time showing up correctly, try a simple time-triggered automation just to make sure it is working as expected. Then change to turning switches on/off and adding a delay.
M8 your a champion lol i must have missed setting this up in main configuration.yaml
omg spent ages working out how to get the correct time I feel so dumb thank you.
now i just tried this code below and pump has turned on correctly via automation.
we will see if it turns off in 8 hours when i wake up. ill post my results. thank you so much.
alias: ‘Pool Pump Schedule’
trigger:
platform: time
at: ‘20:13:00’
action:
You may want to split it into two automations, one to turn on and one to turn off. That way if HA gets rebooted during the 8 hours it will still turn off the pump.
Good idea have change my code allot ill share below seems nicer for me to have more control via interface and also split the on n off into there own automatons my best pump automatons and sliders bellow.
Thank you! i used you´r example. works great! ony issue i have is that HA keep forgetting what i change the sliders to, very annoying. have you solved this?
Hi there ,
Sorry for the delay in response I have my hands full with three younge children at the mo and don’t get much time to work on my HA . I hadn’t noticed the time resetting until you posted I did a restart of Home Assistant and yes mine also resets but I have modified the slider config as to run at the reset time seems to be working fine. But It would be good to keep it set at a predefined value I would also like to add the ability to lock the slider so you can’t accidentally change the time setting when scrolling through the HA main page. When I get time I’ll try come up with something to solve this hopeful someone out there can suggest some ideas
Similar to @MyCool’s approach, I have also automated my pool pump, and just finished writing up a first overview of how I have done that: Smarter Swimming Pool 1: Pool Pump
Thanks for the link to your code @exxamalte ! Ive tried to use it for my setup , but keep getting errors and not sure where to start troubleshooting. I dont have a WEMO but rather a SONOFF which I assume would change a bit of the code. Could you assist by sharing your .yaml files for this pool automation ?
The following components and platforms could not be set up:
input-select
input-number
input-boolean
Please check your config
@Pro2col: All the configuration snippets are in that blog post, including all those controls as well as the automation, monitoring and reporting. Just go through from top to bottom and you will find everything you need.
Replacing the switch could be as simple as replacing the entity id, i.e. replace all occurrences of switch.wemo_insight_pool and you should be good to go. In the custom component I am not making many assumption about the switch; it only needs to support turn_on and turn_off services, and states on and off.
I went through your blog, but im not sure which file to add the code ? I use split configurations
The only file I was sure of was the [config_dir]/custom_components/pool_pump_service.py
Should I add everything to the configuration.yaml and test like this before splitting them ?
Some of the errors I receive, even after it passes the yaml check
SyntaxError: invalid syntax
Failed config
input_boolean:
input_boolean: [source /config/includes/input_boolean.yaml:4]
swimming_season: [source /config/includes/input_boolean.yaml:5]
icon: mdi:swim
name: Swimming Season
General Errors:
- Setup failed for input_boolean: Invalid config.
- Setup failed for input_select: Invalid config.
- Setup failed for input_number: Invalid config.
input_select:
input_select: [source /config/includes/input_select.yaml:4]
pool_pump: [source /config/includes/input_select.yaml:5]
icon: mdi:engine
initial: Auto
name: Pool Pump mode
options: [source /config/includes/input_select.yaml:9]
- Auto
- On
- Off
input_number:
input_number: [source /config/includes/sliders/sliders_pool_pump.yaml:4]
run_pool_pump_hours_off_season: [source /config/includes/sliders/sliders_pool_pump.yaml:5]
max: 6
min: 1
mode: slider
name: Run Pool Pump in Off Season
step: 1
run_pool_pump_hours_swimming_season: [source /config/includes/sliders/sliders_pool_pump.yaml:11]
max: 8
min: 1
mode: slider
name: Run Pool Pump in Swimming Season
step: 1
Successful config (partial)
input_boolean:
input_select:
input_number:
It could be as simple as removing the first line of each config snippet. The error message sounds as if you for example define having all input_booleans in a separate file, but then have an input_boolean statement in that file again. Instead you would only need the definition in that file:
swimming_season:
name: Swimming Season
icon: mdi:swim
However, what I can highly recommend are packages. This way, you can keep any pool related controls and automations in one file.