I’ve replaced the original chipset of my VSON WP8621_V12 Fish Feeder.
It’s a work in progress so bear with me and I hope some of you can help me out.
This is the top view of the device:
I have to do some measurements on GPIO15, the open/close detection. The switch itself is a normally closed one (when the button isn’t pressed, there is a circuit made) connected to ground and this is causing an issue. GPIO15 is being used by the ESP during boot and with the open/close detection being active (button pressed because the feeding bay is retracted) the ESP12E will not boot. Is there any way to bypass this? The switch can act as a counter and it will also allow to stop the motor when the bay is finished with it’s routine.
Also there is food indicator that gave a warning when it was running out of food. This should be connected to GPIO14 and it looks like the same principle as a IR proximity sensor; an IR emmitor and an IR reciever (LED formfactor). I haven’t yet got that running.
This was an interesting project. I’ve made some adjustments:
The switch wired near J2 and connected to GPIO15 gives an issue with the ESP12E. The feeding bay in it’s closed state won’t allow the ESP to boot. When removed the same issue arises. I’ve resolved this issue replacing the switch with a 4,7Ohm resistor.
The desoldered switch has been connected to GPIO3 (RX) and ground with a pull-up (4,7Ohm resistor connected to VCC and GPIO3).
This is (probably) the final configuration of the (modified) WB8621 FishFeeder:
substitutions:
name: "wp8621_fishfeeder"
friendly_name: "WP8621_FishFeeder"
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
on_boot:
priority: -10
then:
- delay: 2s
- if:
condition:
binary_sensor.is_on: open_close_sensor
then:
- switch.turn_on: motor_switch
esp8266:
board: esp12e
restore_from_flash: true
preferences:
flash_write_interval: 0s
logger:
api:
encryption:
key: "{{API key}}" # Replace with the actual API encryption key.
ota:
- platform: esphome
password: "{{password}}" # Replace with the OTA update password.
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "WB8621 Fallback Hotspot"
password: "{{password}}" # Replace with a password for the fallback AP.
captive_portal:
time:
- platform: homeassistant
id: homeassistant_time # Sync time with Home Assistant's time service.
- platform: sntp
id: sntp_time # SNTP is a simpler form of NTP for syncing time with NTP servers.
timezone: "{{timezone}}" # Replace with your time zone (e.g., 'Europe/Amsterdam').
servers: # NTP servers for time synchronization.
- "{{NTP server #1}}" # Replace with actual NTP server.
- "{{NTP server #2}}"
- "{{NTP server #3}}"
sensor:
- platform: wifi_signal
name: "WiFi - Signal"
update_interval: 60s
entity_category: "diagnostic"
- platform: uptime
name: "System - Uptime"
output:
- platform: gpio
id: led_red_led
pin:
number: GPIO5
light:
- platform: binary
name: "Red Light"
output: led_red
id: red_led
globals:
- id: open_close_counter
type: int
restore_value: yes
initial_value: '0'
sensor:
- platform: template
name: "Open/Close counter"
id: open_close_counter_sensor
unit_of_measurement: "times"
accuracy_decimals: 0
lambda: |-
return id(open_close_counter);
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: true
name: "Button"
filters:
- delayed_on: 15ms # Debounce the button to avoid false triggers.
on_press:
- switch.turn_on:
id: motor
- platform: gpio
pin:
number: GPIO3
inverted: true
name: "Open/Close sensor"
id: open_close_sensor
on_state:
- if:
condition:
binary_sensor.is_on: open_close_sensor
then:
- switch.turn_on: motor
- lambda: |-
id(open_close_counter) += 1;
id(open_close_counter_sensor).publish_state(id(open_close_counter));
else:
- delay: 1s # Delay for 1 second so the bay is in the feeder.
- switch.turn_off: motor
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
inverted: false
name: "Food level sensor"
id: food_level_sensor
device_class: "problem" # Classify this as a problem entity in Home Assistant.
on_state:
- if:
condition:
binary_sensor.is_on: food_level_sensor
then:
- logger.log: "Food level is low!"
else:
- logger.log: "Food level is sufficient."
switch:
- platform: gpio
pin:
number: GPIO10
inverted: false
id: motor
name: "Motor"
restore_mode: ALWAYS_ON
on_turn_on:
- light.turn_on: red_led
on_turn_off:
- light.turn_off: red_led
- platform: restart
name: "System - Restart"
- platform: safe_mode
name: "System - Safe mode"
status_led:
pin:
number: GPIO4
I’ve created a simple automation that allows you to set the time of feeding and the amount of servings the fish need.
For this automation to work you’ll need to create two helpers within Home Assistant:
A Time helper (Date and/or Time → set the input to Time,
A Number helper (Number → set minimum to 1 and maximum to 10 or something)
You should replace input_datetime.{{fish_feedingtime}}, input_number.{{fish_meals}} and switch.{{motor fishfeeder}} with the entity ID’s applicable to your situation.
alias: Fish Feeding
description: ""
trigger:
- platform: time
at: input_datetime.{{fish_feedingtime}}
condition: []
action:
- repeat:
count: "{{ states('input_number.{{fish_meals}}') | int }}"
sequence:
- target:
entity_id:
- switch.{{motor fishfeeder}}
action: switch.turn_on
data: {}
- wait_for_trigger:
- platform: state
entity_id: switch.{{motor fishfeeder}}
to: "off"
mode: single
I’ve also created a Card Configuration for your dashboard based, you should have Mushroom Cards installed.
You should replace switch.{{motor fishfeeder}}, binary_sensor.{{food_level_sensor}}, input_number.{{fish_feedingtime}} and input_datetime.{{fish_meals}} with the entity ID’s applicable to your situation.
Thanks for the detailed description modifying the VSON WP8621_V12 feeder. I have the blue tooth version and have captured most of the Bluetooth communication protocol. I was going to create an esp32 program to communicate with the feeder and send the information to home assistant via esp home or MQTT.
I like what you did much better and think I may try your modification. I have not used an ESP32E before, did you program it using USB to Serial adapter? Were there any issues connecting it to the board?
I just wanted to confirm for anyone who would like to do this, that this works very well. Was an easy swap, adding 2 resistors and packing it back. Yaml works fantastically.
I have also completed this mod, had a little issue getting the part off, but otherwise went well. The feed shows up in home assistant and the automation works great.
Thanks for the great mod
Just want to say thanks! It’s working great!
I used a hacksaw blade to cut the old chip off… would not recommend. Haha but managed to get the new one on and it’s working perfectly. Can now leave for a few days without using those dissolving food things.
Hey, I have an odd problem… if home assistant is down for too long, the feeder dumps all of its food! Mine always dumps one portion of foot on first boot/power on - I’m thinking that’s the problem. But… not sure why it does this?
Flashed the YAML just fine to the ESP, but it seems to reboot itself after 15 mins or so. Has anybody else seen this?
Logs:
Blockquote 17:05:37 [D] [sensor:135]
‘System - Uptime’: Sending state 844.85400 s with 0 decimals of accuracy
17:06:32 [E] [api:156]
No clients; rebooting
17:08:36 [D] [sensor:135]
‘System - Uptime’: Sending state 124.31000 s with 0 decimals of accuracy
17:08:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -57.00000 dBm with 0 decimals of accuracy
17:08:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:09:36 [D] [sensor:135]
‘System - Uptime’: Sending state 184.31000 s with 0 decimals of accuracy
17:09:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -60.00000 dBm with 0 decimals of accuracy
17:09:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:10:37 [D] [sensor:135]
‘System - Uptime’: Sending state 244.31400 s with 0 decimals of accuracy
17:10:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -60.00000 dBm with 0 decimals of accuracy
17:10:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:11:36 [D] [sensor:135]
‘System - Uptime’: Sending state 304.31400 s with 0 decimals of accuracy
17:11:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -58.00000 dBm with 0 decimals of accuracy
17:11:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:12:36 [D] [sensor:135]
‘System - Uptime’: Sending state 364.31400 s with 0 decimals of accuracy
17:12:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -59.00000 dBm with 0 decimals of accuracy
17:12:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:13:36 [D] [sensor:135]
‘System - Uptime’: Sending state 424.31400 s with 0 decimals of accuracy
17:13:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -59.00000 dBm with 0 decimals of accuracy
17:13:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:14:36 [D] [sensor:135]
‘System - Uptime’: Sending state 484.31500 s with 0 decimals of accuracy
17:14:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -57.00000 dBm with 0 decimals of accuracy
17:14:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:15:36 [D] [sensor:135]
‘System - Uptime’: Sending state 544.31598 s with 0 decimals of accuracy
17:15:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -59.00000 dBm with 0 decimals of accuracy
17:15:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:16:36 [D] [sensor:135]
‘System - Uptime’: Sending state 604.31598 s with 0 decimals of accuracy
17:16:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -62.00000 dBm with 0 decimals of accuracy
17:16:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:17:36 [D] [sensor:135]
‘System - Uptime’: Sending state 664.31598 s with 0 decimals of accuracy
17:17:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -61.00000 dBm with 0 decimals of accuracy
17:17:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:18:36 [D] [sensor:135]
‘System - Uptime’: Sending state 724.31598 s with 0 decimals of accuracy
17:18:38 [D] [sensor:135]
‘WiFi - Signal’: Sending state -59.00000 dBm with 0 decimals of accuracy
17:18:38 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:19:36 [D] [sensor:135]
‘System - Uptime’: Sending state 784.32098 s with 0 decimals of accuracy
17:19:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -57.00000 dBm with 0 decimals of accuracy
17:19:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:20:36 [D] [sensor:135]
‘System - Uptime’: Sending state 844.32001 s with 0 decimals of accuracy
17:20:37 [D] [sensor:135]
‘WiFi - Signal’: Sending state -59.00000 dBm with 0 decimals of accuracy
17:20:37 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:21:32 [E] [api:156]
No clients; rebooting
17:23:34 [D] [sensor:135]
‘Open/Close Counter’: Sending state 0.00000 times with 0 decimals of accuracy
17:23:34 [D] [sensor:135]
‘WiFi - Signal’: Sending state -59.00000 dBm with 0 decimals of accuracy
17:23:37 [D] [sensor:135]
‘System - Uptime’: Sending state 124.25600 s with 0 decimals of accuracy
17:06 - “No Clients Rebooting”
then again at
17:20