you run it like this java -jar RoboMapviewer3.0.0-1.jar (assuming java is in your path, and the viewer is in the current dir, otherwise add the paths appropriately)
Clicking in the graph should give a coordinate in the text window, dragging mouse will give the zone
Note: The rrmap files are saved by the binding in the userdata/miio folder.
The location is depending on the Openhab installation and differs per installation so expect it somewhere in one of these: Userdata like rrd4j databases /opt/openhab2/userdata or /var/lib/openhab2 or maybe even /usr/share/openhab2… but also reported as being in /var/lib/openhab2/miio/ directly
Note that the rrmap files are only saved when debug logging is enabled ( log:set debug org.openhab.binding.miio ) and the map Channel is linked to an item.
Though the viewer is standalone, not linked to the running of openhab, to download the rrmap files from the cloud you need:
have openHAB & miio binding installed
have your vacuum defined as thing AND have linked the map channel.
Have entered the cloud credentials in the binding config. Note you should now have the map visible in openHAB…
In the oh console enable debug: log:set DEBUG org.openhab.binding.miio
I thought I nailed it wrt to the dependencies. It is rather unfamiliar territory for me to make standalone jars
I’ll test it as well on another PC to see if I can replicate the issue
if you unzip the jar file, I think you can also run it with below command (the missing class is packed inside the jar). This is how I tested it before packing it into the jar
I could replicate the issue…Do not have a good final solution yet, but got it to run with the file provided:
What did work for me is to indeed unzip a copy of the jar (make the copy, rename the file from .jar to .zip) and extract the lib folder. With the lib folder in the same folder as the jar file, I was able to execute it with the earlier command java -jar RoboMapviewer2.5.7.jar
As the libs are there, it should not give this class not found error on the logging
I have another question how to use the coordinates
I have “draw” a zone and got this results:
Click @ point (404,0,234,0) => Coordinates: [X=314,0, Y=261,0]
Click @ point (399,0,416,0) => Coordinates: [X=315,7, Y=200,3]
Click @ point (277,0,417,0) => Coordinates: [X=356,3, Y=200,0]
Click @ point (275,0,234,0) => Coordinates: [X=357,0, Y=261,0]
Inside my rule I used to have this:
sendCommand(RoborockCommand,“app_zoned_clean[[22491,30568,23991,32668,1]]”)
How do I “convert” the information from the java program to my rule?
This is the puzzle still to solve… I was hoping these match, but seems not so based on your example.
are the clicks the same coordinates as the zone clean coordinates? (as it allmost seems factor 100)
maybe this helps:
During the conversion to coordinates in the map drawing logic, early in the processing, I divide by 50 to come from the robot provided values to the coordinates in the app.
Maybe the to get to the zone coordinates, it is the reverse.
For the Y coordinates, it is calculated as value from robo / 50 - top
for the X it is doing something like (imgWidth + left) - value from robo / 50
note these top, left width etc values can be seen in the viewer
I used to use an app called flolevac to get the coordinates.
But after 3.5.7 firmware the app stop working.
You can see the discussion here:
I assume the flolevac app use the same method as the link you posted above to get the coordinates for the app_zoned_clean command.
I preffered to use the app_zoned_clean command instead of the app_segment_clean command.
So if you manage to implement overlaid grids to draw out the x and y-axis in your java program I’m happy to test it
I toyed a bit with moving the vacuum (command: app_goto_target[x,y]) which gives the exact coordinate of the goto pos in the viewer, hence helps finding the formula.
Seems for me the calculation from viewer coordinate to goto coordinate: ( offset + Click Coordinate) * 50
Hi
Just downloaded the new version and it might be different when open the java program on OSX.
But I can’t copy the text by using Command+C or right click.
Update: Control+C seems to works fine.
But inside OSX the normal shortcut for copy&paste is:
command+C & command+V
Thanks Marcel, I very appreciate your work on this. Your new version works for me on Mac and Windows.
However, I missed one important step - can someone let me know from where and how I can get the rrmap file that need to be opened by the viewer?
I can find the map and also open it. The zone is marked and the coordinates are also displayed in the app.
When I start the zone command (“app_zoned_clean[28150,28000,2970029100,1]”) the vacuum cleaner (S6) also starts immediately and reports zone cleaning. So far everything is fine!
Unfortunately the coordinates seem to be wrong. The whole ground floor is cleaned.