Skip to content

Instantly share code, notes, and snippets.

@jeremysherriff
Created July 22, 2022 05:03
Show Gist options
  • Save jeremysherriff/786457fd0bdbadf0a43d564889c17900 to your computer and use it in GitHub Desktop.
Save jeremysherriff/786457fd0bdbadf0a43d564889c17900 to your computer and use it in GitHub Desktop.
Viomi styj02ym vacuum err_state mapping
#!/bin/bash
if [[ -z $1 ]]; then
errcode="0"
else
errcode=$1
fi;
# use case statement to make decision for errcode
case $errcode in
"0") echo "Task in progress";;
"500") echo "$errcode Radar timed out";;
"501") echo "$errcode Wheels stuck";;
"502") echo "$errcode Low battery";;
"503") echo "$errcode Dust bin missing";;
"507") echo "$errcode Could not reposition";;
"508") echo "$errcode Uneven ground";;
"509") echo "$errcode Cliff sensor error";;
"510") echo "$errcode Collision sensor error";;
"511") echo "$errcode Could not return to dock";;
"512") echo "$errcode Could not return to dock";;
"513") echo "$errcode Could not navigate";;
"514") echo "$errcode Vacuum stuck";;
"515") echo "$errcode Charging error";;
"516") echo "$errcode Mop temperature error";;
"521") echo "$errcode Water tank is not installed";;
"522") echo "$errcode Mop is not installed";;
"525") echo "$errcode Insufficient water in water tank";;
"527") echo "$errcode Remove mop";;
"528") echo "$errcode Dust bin missing";;
"529") echo "$errcode Mop and water tank missing";;
"530") echo "$errcode Mop and water tank missing";;
"531") echo "$errcode Water tank is not installed";;
"2100") echo "Low battery";;
"2101") echo "Insufficient battery, will continue cleaning after recharge";;
"2102") echo "Returning to base";;
"2103") echo "Charging";;
"2104") echo "Returning to base";;
"2105") echo "Fully charged";;
"2108") echo "Returning to previous location?";;
"2109") echo "Cleaning up again";;
"2110") echo "Self-inspecting";;
*) echo "$errcode Unknown";;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment