Skip to content

Instantly share code, notes, and snippets.

@Ceralor
Last active February 9, 2023 00:34
Show Gist options
  • Save Ceralor/c05bcc9b7c669346c6b9403527c52b27 to your computer and use it in GitHub Desktop.
Save Ceralor/c05bcc9b7c669346c6b9403527c52b27 to your computer and use it in GitHub Desktop.
Eufy Robovac 35C ESPHome for Home Assistant

Robobvac 35C Config

Since ESPHome doesn't actually support the vacuum entity type, much less creating one in Home Assistant, we have to make due with the TuyaMCU features offered.

We create a few buttons, a switch, and sensors, as well as selects for setting mode and speed. Then there's a vacuum template file for Home Assistant to take advantage of this.

In the end, you'll have a vacuum entity in Home Assistant that's fully local, fully ESPHome, but not perfectly-so.

Of note: ESPHome team, 115200 is a valid baudrate for (some) TuyaMCUs. The one in the vacuum does not support 9600 baud. Please stop alerting me to this. Tasmota has figured this out already.

friendly_name: Robovac
unique_id: robovacesphome
value_template: "{{ states('sensor.robovac_35c_status') }}"
battery_level_template: "{{ states('sensor.robovac_35c_battery') | int }}"
fan_speed_template: "{{ states('select.robovac_35c_fan_speed') }}"
attribute_templates:
error: "{{ states('sensor.robovac_35c_error') }}"
availability_template: "{{ states('binary_sensor.robovac_35c_power') }}"
start:
service: switch.turn_on
target:
entity_id: switch.robovac_35c_play_pause
pause:
service: switch.turn_off
target:
entity_id: switch.robovac_35c_play_pause
stop:
service: switch.turn_off
target:
entity_id: switch.robovac_35c_play_pause
return_to_base:
service: button.press
target:
entity_id: button.robovac_35c_go_home
clean_spot:
service: select.select_option
target:
entity_id: select.robovac_35c_mode
data:
option: Quick
locate:
service: button.press
target:
entity_id: button.robovac_35c_locate_vacuum
set_fan_speed:
service: select.select_option
target:
entity_id: select.robovac_35c_fan_speed
data:
option: "{{ fan_speed }}"
fan_speeds:
- Standard
- BoostIQ
- Max
- 'Off'
substitutions:
device_friendly_name: Robovac 35C
device_name: robovac
esphome:
name: ${device_name}
esp8266:
board: esp01_1m
logger:
baud_rate: 0
# Enable Home Assistant API
api:
# password: !secret robovac_ota_password
ota:
password: !secret robovac_ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Robovac Fallback Hotspot"
password: !secret robovac_ota_password
captive_portal:
uart:
rx_pin: GPIO13
tx_pin: GPIO15
baud_rate: 115200
time:
- platform: homeassistant
id: ha_time
tuya:
time_id: ha_time
on_datapoint_update:
- sensor_datapoint: 15
datapoint_type: enum
then:
- text_sensor.template.publish:
id: text_status
state: !lambda |-
switch(x) {
case 0: return "cleaning";
case 1: return "paused";
case 2: return "idle";
case 3: return "docked";
case 4: return "docked";
case 5: return "returning";
default: return "error";
};
- sensor_datapoint: 106
datapoint_type: enum
then:
- text_sensor.template.publish:
id: text_error
state: !lambda |-
switch(x) {
case 0: return "";
case 1: return "Stuck";
case 2: return "Bumper";
case 3: return "Sensors";
case 4: return "Battery";
case 5: return "Wheel";
case 6: return "Brush";
case 7: return "Fan";
case 8: return "Roller";
default: return "Error";
};
switch:
- platform: tuya
name: ${device_friendly_name} Play/Pause
switch_datapoint: 2
- platform: tuya
id: switch_findme
switch_datapoint: 103
- platform: tuya
id: switch_gohome
switch_datapoint: 101
binary_sensor:
- platform: tuya
name: ${device_friendly_name} Power
sensor_datapoint: 1
entity_category: diagnostic
button:
- platform: template
name: ${device_friendly_name} Go Home
on_press:
- switch.turn_on: switch_gohome
- platform: template
name: ${device_friendly_name} Locate Vacuum
entity_category: diagnostic
on_press:
- switch.turn_on: switch_findme
- delay: 10s
- switch.turn_off: switch_findme
sensor:
- platform: tuya
name: ${device_friendly_name} Battery
sensor_datapoint: 104
device_class: battery
unit_of_measurement: '%'
accuracy_decimals: 0
state_class: total
# - platform: tuya
# name: ${device_friendly_name} DP3
# sensor_datapoint: 3
text_sensor:
- platform: template
name: ${device_friendly_name} Status
id: text_status
entity_category: diagnostic
- platform: template
name: ${device_friendly_name} Error
id: text_error
entity_category: diagnostic
select:
- platform: "tuya"
name: ${device_friendly_name} Fan Speed
enum_datapoint: 102
entity_category: config
options:
0: Standard
1: BoostIQ
2: Max
3: 'Off'
- platform: "tuya"
name: ${device_friendly_name} Mode
enum_datapoint: 5
options:
0: Auto
1: Quick
2: Spot
3: Edge
4: Stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment