Hello,
Today I want to share my smart garage for my xiaomi roborock S5 robot vacuum cleaner.
When the robot vacuum cleaner starts, the door opens automatically and when it starts to recharge the door closes. I do this by some rules that indicate the status of the robot vacuum cleaner.
I built the closet myself.
I used this actuator and voltage converter.
https://www.vekto.nl/voeding-12vdc-60w-4-5a-dinrail-ingang-85-264vac
To control the actuator with openhab I used the following modbus module with 1x usb to RS485 converter.
And i let it switch this relay.
You have to install the following bindings for more info read the doc’s of the bindings.
https://www.openhab.org/v2.5/addons/bindings/modbus/
I did the configuration with text file’s
Modbus.things
Bridge modbus:serial:slave1 [ port="/dev/ttyUSB-RS485" ,id=1 , baud=9600, stopBits="1", parity="none",timeBetweenTransactionsMillis=35,dataBits=8, encoding="rtu" ]{
Bridge poller slave1coils [ start=0, length=8, refresh=1000, type="coil" ]{
Thing data do00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil",updateUnchangedValuesEveryMillis="5000000" ]}
Modbus.items
Switch Roborock { channel="modbus:data:slave1:slave1coils:do0:switch" }
Roborock.items(dont forget to set the device id to your vacuumcleaner)
Number statusId "Status id [:%s]" (gVac,gVacStat) {channel="miio:generic:070A5AF2:status#state_id" }
Roborock.rules
rule "Roborock start vacuum"
when
Item statusId changed to 5
then
sendCommand(Roborock, ON)
end
rule "Roborock start charging"
when
Item statusId changed to 8
then
sendCommand(Roborock, OFF)
end
.sitemap
Frame label="Roborock" {
Switch item=Roborock
Switch item=actionControl mappings=[vacuum="Vacuum", pause="Pause",spot="Spot", dock="Dock"]
Text item=statusStatus
}