forked from Hypfer/Valetudo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
79,656 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.