Template/helper? in ONE switch for water pump with 4 switch positions

Hi,

I have a water pump which has 4 positions:
0 = off
1 = slow flow
2 = moderate flow
3 = fast flow
Each number is a recognized as a different switch in HA. I would like to create a 2 helpers (“Flow in the morning” and “flow in the afternoon”) which would allow me to feed my automations (time to flow in the morning and time to flow in the afternoon).

I am completely stuck. As I read around, I guess I must first create a switch template (to combine the three ON state switches) and then use that in the helpers stated above?

Can someone point me in the right direction (or to the right template)? My coding experience is very limited.

tx,

Theo

Hey there, I might have misunderstood parts of your text.

Currently you have four individual switches in Home Assistant, meaning there are four independent entities? That seems strange. Could you send a screenshot?

Next, could you please explain your goal again? To me it sounds like you want to build automations to control your water pump. That makes sense but why do you need helpers for that?

Hi,

the pump is controlled by an ESP32 and when discovered by HA it labels it switches. In reality they are push buttons (and so yes different entities).

the reason for the helper: The pump always runs a couple of hours in AM and PM (with automations working fine) ; but when the weather is good (lots of sun => lots of electricity); I would like to change the flows through my helper dashboard on my smartphone. I already manage the flow times through my helper dashboard to change flow in the winter and summer.

if i understand you right, one ways is to create dropdown helper (go to the ui and create it)… have that have 4 states. off, slow, medium, fast. or 0,1,2,3… whatever you’d like.

create an automation that triggers on the “on” state of each of your 4 tasmota switches. and it sets the dropdown to the appropriate state.

also create an automation that triggers on the state change of the drop down, and have it turn on the appriorate tasmota switch (when one turns on, do you need to manually turn the other 3 off? or does it automatically do that?)

now you’ve got 1 switch that controls the water valve. you can adjust that as you please.


a more nerdly way that i probably do it is to create a number helper… ranging from 0-3… and map the number ranges to the flow states. that way i can let increase or decrease the water flow via math…

hopefully i understand your question right. correct me if i’ve misunderstood.

if this is roughly what you want and you need help with actual coding, holler, i’m happy to help…

hmmm that seems very logic, I hadn’t come up with that. I think you put me on the right track…
I’ll test it out and get back to you…

thanks for the help sofar everybody!

I would go the input select route as well. The number helper is nerdy but not very practical in the long run.

for @Theo23 just in case… dropdown helper in the ui creates an input_select entity. so @ThomDietrich upvoting the dropdown and smackdowning my number approach :stuck_out_tongue:

but come’on… think of the possibilities! you could create a value for the sunshine, the temperature, the amount of rain, and the create a formula that calculates a high precision (albeit low accuracy) recommended value between 0-3. you would be the envy of all ha nerds globally. you could share it on the “share your projects!” and win all sorts of awards, kudos, and precious hearts to get “regular” status. your life could be forever changed…

1 Like

Almost there but net yet :confused:

  1. Created a helper “pump flow” which has 4 options

    • Off (not needed because my time automation flow directly “calls the toggle off switch” in the AM and PM)
    • slow flow
    • moderate flow
    • fast flow
  2. Add the helper to my helper dashboard:
    first stupid question: how do I do this? . I added an entity card, but It just lists the options in a row (I don’t get a dropdown). used a simple entity card. I found one example online who talked about a “mushroom select card”, is there no simpler way?

image

  1. Created four automations, slow flow example:
    Trigger: when slow on “pump flow” changes => is this correct? shouldn’t it be (when “pump flow” equals slow)?
    Then do: turn on tasmota pump 1

  2. Add the flow automations to my time automations: still to do, the first three steps don’t work yet :confused:

ps: to answer an above Q: the pump just jumps from one position to the other when manually hitting a button (so no need for a “disable other positions automation” when jumping to one position).

My apologies for the very noobish questions

not sure I understand… can u post your code and point out what you want it to do that it’s not? can add comments or psudocode in where you want it to do something it’s not…

I’m on mobile right now. can see about the UI when I get to a laptop

for your question #2 about the about the dashboard. are you looking for this:

image

if so, this is how i did it:

type: entities
entities:
  - input_select.test_dropdown

but i’m questioning whether i understand your questoin right becuse you said you already tried the entity card.

if that’s not right, can you post an image of what you mean?

Hello,

first mystery solved:

type: entity
entity: input_select.pump_stand

I do not understand why I got the above image (in my post) in the first place, after a reboot the dashboard is as your image shows (in your post, with drop down)…

moving to issue #3

Hello,

SOLVED! I included the flow helpers as a condition in my time automations.

The reason I was stuck is that I tried to add(create) the flow helpers as a device or entity in ONE time automation. Because you guys put me on the right track, I stumbled upon the conditions for automations. Using those and creating two additional automations solved it.

So now I have EIGHT automations, FOUR in the morning (and another four in the afternoon, where flow and time differ according to helpers).

on AM XXXX start helper time

  • Automation 1: on time XXXX, and on condition helper flow =“slow”, start 1
  • Automation 2: on time XXXX, and on condition helper flow = “moderate”, start 2
  • Automation 3: on time XXXX, and on condition helper flow = “fast”, start 3
  • Automation 4: on time YYYY, start 0 (stop pump)

same reasoning with other helpers for PM (because the helper flow drop down can only be in ONE state, only ONE of the three first automations will activate the pump) .

Thanks for help all, and specifically armedad!

grtz,

Theo

1 Like