Hello! Recently purchased a robot vacuum cleaner that works through the WeBack cloud. Since I did not find any existing integration, I reverse-engineered the application and wrote mine.
Add custom repository to HACS and install “Weback cloud integration”: https://github.com/opravdin/weback-hass
(will publish it in HACS soon)
Or manually move component to your custom_components folder.
Configuration is simple: (email login is not working for now)
weback: username: +7-1234567890 password: <password>
Vacuum robots that mentioned as
_CLEAN_ROBOT in Amazon’s API (weback is based on Amazon IoT). I wrote a script to test your device for compatibility, it’s available in the repository.
I am new in developing hass modules, so I have some (probably dumb) questions:
- Currently this integration works on polling update method, but it is possible to listen amazon’s mqtt topic for messages. Where can I see examples of integration with this approach?
- I’m not sure if I implemented the polling mechanism correctly. Right now it looks like this:
@property def should_poll(self) -> bool: """Return True if entity has to be polled for state.""" if self.last_fetch is None: return True if ( datetime.datetime.now() - self.last_fetch ).total_seconds() > self.scan_interval.total_seconds(): return True return False
- How best to pass battery_level attribute: via device_state_attributes or via @property?
- Some devices (including mine) support mop mode control when garbage container replaced with water tank. There are 3 levels of water intensity in API so I want to add controls like fan’s ones. How to implement that?
I would be very grateful if someone would test the integration or check the code for errors or bad practices. I tried to follow the checklist, but I still doubt if everything is done correctly. Really want to improve the integration so that it can get into the Home Assistant core