Skip to content

Commit

Permalink
Initial Github Import
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Jul 12, 2018
1 parent 7c46437 commit 13cb788
Show file tree
Hide file tree
Showing 50 changed files with 79,656 additions and 2 deletions.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# Valetudo
Free your vacuum from the cloud
# Valetudo - Free your vacuum from the cloud

Valetudo provides all settings and controls of the Xiaomi Vacuum in a mobile-friendly webinterface.
It runs directly on the vacuum and requires no cloud connection whatsoever.

### Features:
* Live Map View
* Configure Timers
* Start/Stop/Pause Robot
* Find Robot/Send robot to charging dock
* Power settings
* Consumables status
* Wifi settings

### Getting started
You'll find information on how to install valetudo in the deployment folder.

If your vacuum is already rooted **and you know what you're doing**
just download the latest valetudo binary from the releases page and scp it to `/usr/local/bin/`.
Then grab the `valetudo.conf` from the deployment folder put it inside `/etc/init/`
run `service valetudo start` and you're good.

### Misc
The current version of valetudo is the result of 8 not so rainy afternoons. Expect bugs.

Theres a Todo.md with stuff that needs to be done


Valetudo does not feature access controls and I'm not planning on adding it since I trust my local network.
You could just put a reverse proxy with authentication in front of it if you really need it.

Please don't just forward the port to make it accessible on the go..
### FAQ
**Q:** Why the name?

**A:** Valetudo is the roman name for the greek goddess Hygieia which is the goddess of health, cleanliness and hygiene. Also I'm bad at naming things.
6 changes: 6 additions & 0 deletions Testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
For local testing use the following environment variables:

* VAC_ADDRESS
* VAC_TOKEN
* VAC_WEBPORT
* VAC_MAP_TEST
36 changes: 36 additions & 0 deletions Todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Todo

### Architecture
* Completely refactor client
* Remove copy/pasted code
* Split into multiple files
* Minify?
* Unit tests would be nice

### Features
#### Simple
* Support Fan speed values of Gen1
* Hide toolbar in map view if scrolling down
* Localization
* Timezone Settings
* Add support for per-timer fanspeeds
* Add timer editing
* Add timer validation

#### Complex

* Zoned cleanup
* Spot cleaning
* Manual control
* Carpet mode settings
* DND Settings
* Volume Control
* Language Pack Upload
* Firmware Update

### Bugs
* Fix routing (back button is currently just a hack)

###Misc
* All todos inside all js files

40 changes: 40 additions & 0 deletions Valetudo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const fs = require("fs");
const Vacuum = require("./miio/Vacuum");
const Webserver = require("./webserver/WebServer");


const Valetudo = function() {
this.address = process.env.VAC_ADDRESS ? process.env.VAC_ADDRESS : "127.0.0.1";

if(process.env.VAC_TOKEN) {
this.tokenProvider = function() {
return Buffer.from(process.env.VAC_TOKEN, "hex");
}
} else {
this.tokenProvider = Valetudo.NATIVE_TOKEN_PROVIDER;
}

this.webPort = process.env.VAC_WEBPORT ? parseInt(process.env.VAC_WEBPORT) : 80;

this.vacuum = new Vacuum({
ip: this.address,
tokenProvider: this.tokenProvider
});

this.webserver = new Webserver({
vacuum: this.vacuum,
port: this.webPort
})
};


Valetudo.NATIVE_TOKEN_PROVIDER = function() {
const token = fs.readFileSync("/mnt/data/miio/device.token");
if(token && token.length >= 16) {
return token.slice(0,16);
} else {
throw new Error("Unable to fetch token")
}
};

module.exports = Valetudo;
Loading

0 comments on commit 13cb788

Please sign in to comment.