I would like to run my script by everyone, I would love to know if there are stuff I can improve/make easier.
Context:
I bought a robot vacuum (roomba j9+ from irobot), and since a recent(?) release the maps are not available anymore from the local api. My goal was to cut it from the internet, for multiple reasons (privacy, still want to use it if the internet is down, …). So I managed to get the blid, password, map id and region ids (initially setup/created from the irobot app) by using dorita980 (awesome project btw).
My setup:
So from that, and some testing, I created a script that triggers a new job from a list of regions/zones.
In order to do that, I had to create a toggle for each regions/zones, meaning I have 8 regions + 2 zones. When the script runs, if the toggle is on, then it will clean that room and turn the toggle off. That also means in the script I have a similar list of regions/zones with the corresponding id. On top of than I have the same list, also as toggles, in order to vacuum only, or vacuum + mop. So now I have to maintain 3 lists (I mean they should not change, but still, not optimal).
Now this script can be triggered manually on it’s own, all good, but I also have an automation based on calendar events, that automatically turn on some rooms and start the cleaning (plus some additional checks and notifications).
In order to match the features of the robot, I’ve created a bunch of toggles/dropdowns so anything can more or less match what the irobot app is doing (scrubbing, fan speed, number of pass, …)
So in the end I have:
- 1 script
- 10 toggles for cleaning a room
- 10 toggles for mopping it
- 1 extra toggle or dropdown for each additional settings (total of 4 + 2 I hardcoded as I don’t need them)
It works just great, but is there any way to have something easier to setup? Anyone came up with something better?
I’d love to have some feedback
Here’s the python script for anyone interested: https://gist.github.com/po8rewq/b99c16b4f1452d1fcd88aeb5669cc37f