I have a household water-pump which supplies tank-water to the house when there is water in the tank. It is a bit too noisy to run at night - makes a thump when it starts then makes a pumping noise.
I have a ‘TRADFRI control outlet’ which is integrated as an MQTT device. I have this controlling the power to the pump. It is called ‘Water Pump Power Control’. It is working fine.
I have made a Schedule Helper which is ‘on’ when I want the pump to be enabled. It is called ‘Water Pump Schedule’. It runs - but controls nothing.
I want to create the simplest Automation which turns the control socket ‘on’ when the schedule is on, and off when the schedule is off.
I can’t find any simple examples of how to build this automation, and very little using Schedule Helpers.
Can this be created in simple for using the Automation GUI?
Thanks - I am hoping the answer will help others too…
Take your time. I’ve got the controls switch hooked to a ‘RODRET wireless dimmer/power switch’ and my dashboard. I’m just CRAVING AUTOMATION!
alias: Water Pump Sheduled on
description: From Schedule Helper power on the pump
trigger:
- platform: state
entity_id:
- schedule.water_pump_schedule
attribute: next_event
from: "off"
to: "on"
condition: []
action:
- type: turn_on
device_id: 62e6f397f853a9446e26302acc68184c
entity_id: 03dbe02f160a89b2a4e81303e1185f4a
domain: switch
mode: single
You might get a problem if you use switch instead of on/off because let’s say you turn it off or on using the switch it will change stats and the next time it turns on it will actually turn off
This information might be wrong I’m not very good using yaml code
Ok Thanks - I need to understand domains then. Still looking for how to connect a Schedule Helper to a Control Socket. Ica see your solution without a Schedule Helper is simpler and more direct - probably the right way.
I’ll see what happens. Maybe I’ll make up another control socket and a lamp for testing…
I was able to put this together in the UI using Add Building Block to add the Choose cases.
This does not require any template code.
alias: HRV schedule
description: Turn on the HRV at night and off during the day based upon a Schedule helper
trigger:
- platform: state
entity_id:
- schedule.schedule_hrv
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: schedule.schedule_hrv
state: "on"
sequence:
- type: turn_on
device_id: a32da1afc2a088e334109ca55eac9ac4
entity_id: e3db2d12f85527c59b466cc51fbe20cd
domain: switch
- conditions:
- condition: state
entity_id: schedule.schedule_hrv
state: "off"
sequence:
- type: turn_off
device_id: a32da1afc2a088e334109ca55eac9ac4
entity_id: e3db2d12f85527c59b466cc51fbe20cd
domain: switch
mode: single