H801 controlling water and air pump automation

you can try setting it to colors and see if the channel operations are correct.

I can set the color from the rgb wheel that works fine. At the moment the automation just turns the device on and off and sets all colour channels as 255 then 0.

You can set the color from services tab to get the correct ratio.

This automation works fine and ESPHOME has not presented the problems I had with Tasmota.
I still have 2 other channels to use if required for another pump etc. The PWM does work to an extent with throttling the pumps as well which I will have a play about with. I just need to test it does actually reduce the power drain.

alias: water air pump uses color
description: water air pump
trigger:

  • platform: time_pattern
    minutes: /30
    condition:
  • condition: sun
    before: sunset
    after: sunrise
    action:
  • service: light.turn_on
    target:
    entity_id: light.h801_light_2
    data:
    brightness_pct: 100
    rgb_color:
    - 255
    - 255
    - 0
  • delay:
    hours: 0
    minutes: 1
    seconds: 0
    milliseconds: 0
  • service: light.turn_on
    target:
    entity_id:
    - light.h801_light_2
    data:
    rgb_color:
    - 0
    - 255
    - 0
  • delay:
    hours: 0
    minutes: 1
    seconds: 0
    milliseconds: 0
  • service: light.turn_off
    target:
    entity_id: light.h801_light_2
    data:
    rgb_color:
    - 0
    - 0
    - 0
    mode: single

Actually you don’t need thia automation in HA, instead you can program it in the esphome itself like this.

sun:
  latitude: 48.8584°
  longitude: 2.2945°
time:
  - platform: sntp
    on_time:               
      - seconds: 0
        minutes: /30
        then:
            - if:
                condition:
                   - sun.is_above_horizon:
                then:
                  - light.turn_on:
                      id: light_1
                      brightness: 100%
                      red: 100%
                      green: 100%
                      blue: 0% 
                  - delay: 60s
                  - light.turn_on:
                      id: light_1
                      brightness: 100%
                      red: 0%
                      green: 100%
                      blue: 0% 
                  - delay: 60s
                  - light.turn_off:
                      id: light_1

If you want you can try this just as an option. The advantage is that this makes the system more or less independent even if the HA system id offline. But the disadvantage is that if you want to change the parameters of this automation, you would need to edit this code and re-upload the firmware

I have tried this but when I am editing the code it shows an error regarding the id. I obviously changed it from light_1 to h801 also tried h801_light H801_light. none of those worked. so if in ESPHOME this is called : -
light:

  • platform: rgbw
    name: “h801_light”
    red: pwm_r
    green: pwm_g
    blue: pwm_b
    white: pwm_w

In HA entities is shows as image

so what should it id be in that bit of script

You havent specified the id to this. It should look like this.

platform: rgbw
name: “h801_light”
id: light_1
red: pwm_r
green: pwm_g
blue: pwm_b
white: pwm_w

Just done that and it compiles and uploaded fine, I have toggled the HA automation off so I can see how it goes and decide which works best for me.
Appreciate the help with this, I’m in the process of setting up another hydroponics system in my garden using solar to power everything and will use the H801’s for that as well so this will be very useful for that setup as well might incorporate a sensor using the spare gpio pins on the H801 for a bit more automation.

1 Like