# Neato BotVac Vacuum Cleaner Widget for HABPanel

**URL:** <https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994>\
**Category:** HABPanel Examples\
**Created:** [December 24, 2018, 3:53pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994 "2018-12-24T15:53:45Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![kugelsicha](https://community.openhab.org/user_avatar/community.openhab.org/kugelsicha/32/57143_2.png) [@kugelsicha](https://community.openhab.org/u/kugelsicha)\
**Post date:** [December 24, 2018, 3:53pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/1 "2018-12-24T15:53:45Z")

</div>

Hi,

Over the last days i played a bit with the Matrix Theme for HABPanel…

This is the widget i made for Neato BotVac Vacuum Cleaner Connected Series… I may share the code later, need a bit of clean up.. it looks pretty neat and i’m very happy with the result… even the way was very long and included some pip python installs…

- grab the Last Cleaning Map from Neato via pybotvac
- take that image, crop/resize and change the background to grafana “fill” color
- “Update Map” runs script via Exec binding
- since the “DOCK” funktion only works if the basestation has been seen from the Robot, this button is only visible and clickable if DockHasBeenSeen item is ON

 ![habpanel_mobile_1](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/c/6/c64c7ae26c438eb97f7e66972281f04ab6cb97bf.png) ![habpanel_mobile_2](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/2/6/268d572b5ae42c527cdb62f31de31b03a6cb0b3f.png) ![habpanel_robot_desktop](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/4/a/4ab71ac91df03725de1b3877304255d8af5b0341.png)

Thanks to @ysc @pmpkk for this very cool UI!

**Edit 28/03/2019:**

Here is the code…

**HABPanel widget code:**

```auto
<div class="section">
	<div class="sectionIconContainer"><div class="sectionIcon"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#vacuum-cleaner"></use></svg></div></div>
	<div class="bigDash">
		<div class="description">HoLLe's Alfred - Aktuell</div>
		<div class="top">
			<div class="icon on"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#event-list"></use></svg></div>
			<div class="value">
				<div class="main">{{itemValue('AlfredState')}}</div>
			</div>
		</div>
		<div class="bottom">
			<div class="sceneGroup">
				<div class="scene on" ng-click="sendCmd('AlfredCommand', 'clean')">Clean</div>
			</div>
			<div class="sceneGroup">
				<div class="scene on2" ng-click="sendCmd('AlfredCommand', 'pause')">Pause</div>
			</div>
			<div class="sceneGroup">
				<div class="scene on2" ng-click="sendCmd('AlfredCommand', 'resume')">Resume</div>
			</div>
			<div class="sceneGroup">
				<div class="scene on2" ng-click="sendCmd('AlfredCommand', 'stop')">Stop</div>
			</div>
		</div>
		<div class="bottom">
			<div class="sceneGroup">
				<div class="scene on2" ng-class="{true: 'disabled'}[itemValue('AlfredDockHasBeenSeen')!='Ja']" ng-click="sendCmd('AlfredCommand', 'dock')">Andocken</div>
			</div>
			<div class="sceneGroup">
				<div class="scene on" ng-click="sendCmd('Alfred_GetNewMap', 'ON')">Update Map</div>
			</div>
		</div>
		<div class="bottom">
			<div class="error">{{itemValue('AlfredError')}}</div>
		</div>
	</div>

	<div class="bigDash">
	<div class="description">Aktion - Aktuell</div>
		<div class="top">
			<div class="icon on"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#battery-connected"></use></svg></div>
			<div class="value">
				<div class="main">{{itemValue('AlfredBattery')}}</div>
				<div class="sub">%</div>
			</div>
		</div>
		<div class="bottom">
			<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#buildings-03"></use></svg></div>
			<div class="value">In Station</div>
			<div class="valueGroup"><div class="value">{{itemValue('AlfredIsDocked')}}</div></div>
				<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#buildings-29"></use></svg></div>
			<div class="value">Station erkannt</div>
			<div class="valueGroup"><div class="value">{{itemValue('AlfredDockHasBeenSeen')}}</div></div>
		</div>
		<div class="bottom">
			<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#charging-1"></use></svg></div>
			<div class="value">Am Laden</div>
			<div class="valueGroup"><div class="value">{{itemValue('AlfredIsCharging')}}</div></div>
			<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#event-date"></use></svg></div>
			<div class="value">Zeitplan</div>
			<div class="valueGroup"><div class="value">{{itemValue('AlfredIsScheduled')}}</div></div>
		</div>
		<div class="bottom">
			<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#buildings-28"></use></svg></div>
			<div class="value">Kategorie</div>
			<div class="valueGroup"><div class="value">{{itemValue('AlfredCategory')}}</div></div>
		</div>
		<div class="bottom">
			<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#buildings-38"></use></svg></div>
			<div class="value">Reinigungs-Modus</div>
			<div class="valueGroup"><div class="value">{{itemValue('AlfredMode')}}</div></div>
		</div>
		<div class="bottom">
			<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#buildings-37"></use></svg></div>
			<div class="value">Reinigungs-Art</div>
			<div class="valueGroup"><div class="value">{{itemValue('AlfredModifier')}}</div></div>
		</div>
		<div class="bottom">
			<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#close-arrows"></use></svg></div>
			<div class="value">Spot-Länge</div>
			<div class="valueGroup"><div class="value">{{itemValue('AlfredSpotHeight')}}</div></div>
			<div class="icon off"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/smarthome.svg#close-arrows-4"></use></svg></div>
			<div class="value">Spot-Breite</div>
			<div class="valueGroup"><div class="value">{{itemValue('AlfredSpotWidth')}}</div></div>
		</div>
	</div>

	<div class="bigDash">
		<div class="description">Reinigungs-Karte</div>
		<div class="graph">
			<img width="300" height="300" src="/static/neato-botvac/botvac-last-map.png" />
			<div class="legend">{{itemValue('Alfred_GetNewMap')}} x {{itemValue('Alfred_GetNewMap_exit')}} x {{itemValue('Alfred_GetNewMap_last')}}</div>
		</div>
	</div>
</div>

```

**items / neato.items:**

```auto
Group GNeato
//String AlfredName "Name [%s]" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:name"}
Number AlfredBattery "Akku Status [%.0f %%]" <battery> (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:battery-level"}
String AlfredState "Status [MAP(neato.map):%s]" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:state"}
String AlfredError "Fehler [%s]" <error> (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:error"}
//String AlfredVersion "Version [%s]" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:version"}
//String AlfredModel "Model [%s]" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:model-name"}
//String AlfredFirmware "Firmware [%s]" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:firmware"}
String AlfredAction "Aktuelle Aktion [MAP(neato.map):%s]" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:action"}
Switch AlfredDockHasBeenSeen "Ladestation erkannt [MAP(neato.map):%s]" <presence> (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:dock-has-been-seen"}
Switch AlfredIsDocked "In Ladestation [MAP(neato.map):%s]" <presence> (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:is-docked"}
Switch AlfredIsScheduled "Zeitplan [MAP(neato.map):%s]" <time> (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:is-scheduled"}
Switch AlfredIsCharging "Am Laden [MAP(neato.map):%s]" <heating> (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:is-charging"}
String AlfredCategory "Reinigung [MAP(neato.map):%s]" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:cleaning-category"}
String AlfredMode "Reinigungs Modus [MAP(neato.map):%s]" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:cleaning-mode"}
String AlfredModifier "Reinigungs Art [MAP(neato.map):%s]" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:cleaning-modifier"}
Number AlfredSpotWidth "Spot-Breite [%.0f]" <niveau> (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:cleaning-spotwidth"}
Number AlfredSpotHeight "Spot-Höhe [%.0f]" <niveau> (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:cleaning-spotheight"}
//String AlfredNavigationMode "Nav Mode" (GNeato) {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:cleaning-navigation-mode"}
String AlfredCommand "Befehl" <movecontrol> {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:command"}

String AlfredMapId "Map ID" {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:map-id"}
String AlfredMapUrl "Map Url" {channel="neato:vacuumcleaner:OPSXXX-YOUR_ROBOT_SERIAL:map-url"}

//Alexa Dummy Switch - see .rules
Switch AlfredAlexa "Alfred" ["Switchable"]

Switch Alfred_GetLastMapTrigger "TEST %s"

// state of the execution, is running or finished
Switch Alfred_GetNewMap {channel="exec:command:neato_new_map:run"}
// Arguments to be placed for '%2$s' in command line
String Alfred_GetNewMap_Args {channel="exec:command:neato_new_map:input"}
// Output of command line execution 
String Alfred_GetNewMap_out {channel="exec:command:neato_new_map:output"}
Number Alfred_GetNewMap_exit {channel="exec:command:neato_new_map:exit"}
DateTime Alfred_GetNewMap_last {channel="exec:command:neato_new_map:lastexecution"}

```

**rules / neato.rules:**

```auto
rule "Getting last map for neato botvac connected"
	when
	   Item Alfred_GetLastMapTrigger received command ON
	then
		//Alfred_GetLastMapRunning.postUpdate("Download ...")
		executeCommandLine("/usr/bin/python /etc/openhab2/scripts/neato-botvac-getlastmap.py", 5000)
        logInfo("Your command exec", "Result:" + Alfred_GetLastMapTrigger.state )
		//Alfred_GetLastMapRunning.postUpdate("-")
		Alfred_GetLastMapTrigger.postUpdate(OFF)
end

```

**transform / neato.map**

```auto
ui_alert_busy_charging=beschäftigt mit Aufladen
ui_error_navigation_noprogress=Navigationsproblem
ui_alert_recovering_location=Standort wiederherstellen
ui_error_brush_overload=Bürsten überlastet
ui_error_dust_bin_full=Staubbehälter voll
ui_error_dust_bin_emptied=Staubbehälter entleert
ui_error_brush_stuck=verstopfte Bürsten

// Curent state of the vacuum cleaner
INVALID=Chillen
IDLE=Idle
BUSY=Busy
PAUSED=Pause
ERROR=Error

ON=Ja
OFF=Nein

// Current action of the vacuum cleaner
HOUSE_CLEANING=Haus Reinigung
SPOT_CLEANING=Spot Reinigung
MANUAL_CLEANING=Manuelle Reinigung
DOCKING=Angedockt
USER\ MENU\ ACTIVE=Aktives Benutzermenü
SUSPENDED\ CLEANING=Reinigung abgebrochen
UPDATING=Aktualisieren
COPYING\ LOGS=Logs kopieren
RECOVERING_LOCATION=zum Ausgangspunkt zurückkehren
IEC\ TEST=Iec Test

// Current or last cleaning mode
CLEAN-MODE-ECO=Eco
CLEAN-MODE-TURBO=Turbo

// Modifier of current or last cleaning
CLEAN-MODIFIER-NORMAL=Normal
CLEAN-MODIFIER-DOUBLE=Doppelt

// Current or Last category of the cleaning
CLEAN-CATEGORY-HOUSE=Haus Reinigung
CLEAN-CATEGORY-SPOT=Spot Reinigung
CLEAN-CATEGORY-MANUAL=Manuelle Reinigung

CLEAN-NAVIGATIONMODE-NORMAL=Normal
CLEAN-NAVIGATIONMODE-EXTRACARE=Extra Care

NULL=NULL
-=NA
=NA

UNRECOGNIZED=unerkannt
NORMAL=Normal
TURBO=Turbo
HOUSE=House Reinigung
ECO=Eco

```

Because the binding doesnt support maps right now… I used these following tools to get the cleaning map thing to work.

you need to install pybotvac → [GitHub - stianaske/pybotvac: Python module for interacting with Neato Botvac Connected vacuum robots.](https://github.com/stianaske/pybotvac)

additional for image crop and format:  
you need to install PIL Pillow → [GitHub - python-pillow/Pillow: Python Imaging Library (Fork)](https://github.com/python-pillow/Pillow)  
and  
you need to install numpy → [GitHub - numpy/numpy: The fundamental package for scientific computing with Python.](https://github.com/numpy/numpy)

**scripts / neato-botvac-getlastmap.py**

```auto
#!/usr/bin/python
from pybotvac import Account
from os import system
from PIL import Image
import numpy as np

email = 'YOUR_NEATO_EMAIL'
password = 'YOUR_NEATO_PASSWORD'
serial = 'OPS49416-884AEAF3DA74'
path_tmp = '/etc/openhab2/html/neato-botvac/tmp/'
path_dst = '/etc/openhab2/html/neato-botvac/'
map_file = 'botvac-last-map.png'

account = Account(email, password)
link = account.maps[serial]['maps'][0]['url']

account.get_map_image(link, path_tmp)

system('mv ' + path_tmp + '*-user-map.png ' + path_dst + map_file)

img = Image.open(path_dst + map_file).convert('RGB')
area = (73, 214, 713, 854)
cropped_img = img.crop(area)
cropped_img.save(path_dst + map_file)
orig_color = (51,61,74)
replacement_color = (38, 49, 29)
img3 = Image.open(path_dst + map_file).convert('RGB')
data = np.array(img3)
data[(data == orig_color).all(axis = -1)] = replacement_color
img2 = Image.fromarray(data, mode='RGB')
img2.save(path_dst + map_file)

```

---

<div class="post-metadata">

**Author:** ![Zitelli](https://community.openhab.org/letter_avatar_proxy/v4/letter/z/c68b51/32.png) [@Zitelli](https://community.openhab.org/u/Zitelli)\
**Post date:** [December 25, 2018, 10:09am UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/2 "2018-12-25T10:09:20Z")

</div>

I would be very interested to see that. Looks great! Which binding are you using?

---

<div class="post-metadata">

**Author:** ![kugelsicha](https://community.openhab.org/user_avatar/community.openhab.org/kugelsicha/32/57143_2.png) [@kugelsicha](https://community.openhab.org/u/kugelsicha)\
**Post date:** [December 25, 2018, 8:28pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/3 "2018-12-25T20:28:08Z")

</div>

Sure… as I said i need some time to clean up the code…

I’m running on the latest openHABian snapshot builds with the original Neato Binding included…

---

<div class="post-metadata">

**Author:** ![Simon\_Lundell](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@Simon\_Lundell](https://community.openhab.org/u/Simon_Lundell)\
**Post date:** [January 21, 2019, 8:34pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/4 "2019-01-21T20:34:22Z")

</div>

Will this work on both the botvac and the D3-D7 models?

---

<div class="post-metadata">

**Author:** ![kugelsicha](https://community.openhab.org/user_avatar/community.openhab.org/kugelsicha/32/57143_2.png) [@kugelsicha](https://community.openhab.org/u/kugelsicha)\
**Post date:** [January 22, 2019, 3:36pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/5 "2019-01-22T15:36:23Z")

</div>

> [@Simon\_Lundell](#):
>
> Will this work on both the botvac and the D3-D7 models?

Of course it should… but i only tested with the D5

---

<div class="post-metadata">

**Author:** ![Simon\_Lundell](https://community.openhab.org/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@Simon\_Lundell](https://community.openhab.org/u/Simon_Lundell)\
**Post date:** [January 22, 2019, 4:56pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/6 "2019-01-22T16:56:21Z")

</div>

Nice, I have a D7 and a D5. I also have the old Botvac 85e that I added MQTT to. I tried to get the items work as close as possible to the Neato Binding, maybe I can get that to work as well.

---

<div class="post-metadata">

**Author:** ![Tobus](https://community.openhab.org/letter_avatar_proxy/v4/letter/t/ea666f/32.png) [@Tobus](https://community.openhab.org/u/Tobus)\
**Post date:** [February 23, 2019, 7:02pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/7 "2019-02-23T19:02:18Z")

</div>

Hi Holger,  
I ordered today my D3, so I want to ask, if you can share your code with us? The widget looks amazing!!

Thanks  
Tobias

---

<div class="post-metadata">

**Author:** ![Sharpy](https://community.openhab.org/user_avatar/community.openhab.org/sharpy/32/26469_2.png) [@Sharpy](https://community.openhab.org/u/Sharpy)\
**Post date:** [February 24, 2019, 1:44am UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/8 "2019-02-24T01:44:12Z")

</div>

How do you get the map into openhab?

---

<div class="post-metadata">

**Author:** ![active](https://community.openhab.org/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@active](https://community.openhab.org/u/active)\
**Post date:** [March 5, 2019, 7:48am UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/9 "2019-03-05T07:48:18Z")

</div>

Really nice work!

What do you think, when you have cleaned up your code, to share us the widget?  
Would be really nice!

Thanks a lot!  
Christoph

---

<div class="post-metadata">

**Author:** ![Homer-Sim](https://community.openhab.org/user_avatar/community.openhab.org/homer-sim/32/18374_2.png) [@Homer-Sim](https://community.openhab.org/u/Homer-Sim)\
**Post date:** [March 21, 2019, 7:03pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/10 "2019-03-21T19:03:46Z")

</div>

@kugelsicha Is this widget reality or just to tease us 🙂

---

<div class="post-metadata">

**Author:** ![kugelsicha](https://community.openhab.org/user_avatar/community.openhab.org/kugelsicha/32/57143_2.png) [@kugelsicha](https://community.openhab.org/u/kugelsicha)\
**Post date:** [March 28, 2019, 10:04am UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/11 "2019-03-28T10:04:47Z")

</div>

Hi all and sorry for the late reply… but i havn’t had time the last weeks…

I’ve updated the first post and added the code i’m using…

the neato binding doesnt support maps right now, so i needed to install additional libs to get the map image working…

The best way would be to include the map part in the binding, but I cant do it on my own… so maybe some dev is willing to help here…

If someone has improvements for the code above, please let me know…

cheers  
/Holger

---

<div class="post-metadata">

**Author:** ![Tobus](https://community.openhab.org/letter_avatar_proxy/v4/letter/t/ea666f/32.png) [@Tobus](https://community.openhab.org/u/Tobus)\
**Post date:** [December 24, 2019, 1:08pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/12 "2019-12-24T13:08:29Z")

</div>

Hi Kigelsicha,  
I tried the code above, expecially the map. Therefore I created the getlastmap.py file, but when executing

```csv
from pybotvac import Account

```

I get the error message:

```csv
python /etc/openhab2/scripts/neato-botvac-getlastmap.py
Traceback (most recent call last):
  File "/etc/openhab2/scripts/neato-botvac-getlastmap.py", line 2, in <module>
    from pybotvac import Account
  File "/usr/local/lib/python2.7/dist-packages/pybotvac/ __init__.py", line 1, in <module>
    from .account import Account
  File "/usr/local/lib/python2.7/dist-packages/pybotvac/account.py", line 13, in <module>
    from .robot import Robot
  File "/usr/local/lib/python2.7/dist-packages/pybotvac/robot.py", line 7, in <module>
    from datetime import datetime, timezone
ImportError: cannot import name timezone

```

pybotvac is installed. Do you have the same issue?

Merry Christmas  
Tobias

---

<div class="post-metadata">

**Author:** ![HOSW](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/b3f665/32.png) [@HOSW](https://community.openhab.org/u/HOSW)\
**Post date:** [March 6, 2020, 6:11pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/13 "2020-03-06T18:11:43Z")

</div>

Hi

it’s a bit late, I was facing the same issue a few moments ago. for me the problem was solved when using python v3.7. python v2 was constantly giving me the same error…

Cheers

Martin

---

<div class="post-metadata">

**Author:** ![NCO](https://community.openhab.org/user_avatar/community.openhab.org/nco/32/55938_2.png) [@NCO](https://community.openhab.org/u/NCO)\
**Post date:** [February 3, 2021, 4:58pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/14 "2021-02-03T16:58:42Z")

</div>

I used your script before (on OH2.5), and on OH3 I wanted to revive it.

So I installed pybotvac and imported the robot.

But when I run get last map I get:

```
openhabian@homer:~/pybotvac $ python3 /etc/openhab/scripts/neato-botvac-getlastmap.py
Traceback (most recent call last):
  File "/etc/openhab/scripts/neato-botvac-getlastmap.py", line 12, in <module>
    account = Account(email, password)
TypeError: __init__ () takes 2 positional arguments but 3 were given

```

The script looks like (and worked in the past):

```
#!/usr/bin/python
from pybotvac import Account
from os import system
email = 'xxx'
password = 'xxx'
serial = 'OPSxxx-xxx'
path_tmp = '/etc/openhab/html/tmp/'
path_dst = '/etc/openhab/html/neato-botvac/'
map_file = 'botvac-last-map.png'
account = Account(email, password)
link = account.maps[serial]['maps'][0]['url']
account.get_map_image(link, path_tmp)
system('mv ' + path_tmp + '*-user-map.png ' + path_dst + map_file)

```

---

<div class="post-metadata">

**Author:** ![NCO](https://community.openhab.org/user_avatar/community.openhab.org/nco/32/55938_2.png) [@NCO](https://community.openhab.org/u/NCO)\
**Post date:** [February 20, 2021, 8:21am UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/15 "2021-02-20T08:21:31Z")

</div>

Got it!  
Just needed to import more than just Account:  
`from pybotvac import Account, Neato, OAuthSession, PasswordlessSession, PasswordSession, Vorwerk`

I don’t know why, though (just changing from OH2.5 to OH3…  
Might be related to changes in the installed python package!?

---

<div class="post-metadata">

**Author:** ![tobiloeb](https://community.openhab.org/user_avatar/community.openhab.org/tobiloeb/32/77468_2.png) [@tobiloeb](https://community.openhab.org/u/tobiloeb)\
**Post date:** [May 17, 2021, 6:44pm UTC](https://community.openhab.org/t/neato-botvac-vacuum-cleaner-widget-for-habpanel/60994/16 "2021-05-17T18:44:46Z")

</div>

Hi there,

here are some adjustments to get this running. I am using openhab 3.

**Rule** :  
The executeCommandLine has changed, so I had to use: `executeCommandLine(Duration.ofSeconds(5000), "/usr/bin/python", "/etc/openhab/scripts/neato-botvac-getlastmap.py")`

**Script** :

1. I needed to install `sudo apt-get install libatlas-base-dev` on my Pi to get numpy running
2. Got the same error as NCO and fixed it like this:  
`password_session = PasswordSession(email=email, password=password, vendor=Neato()) account = Account(password_session)`

Hope this helps someone else. 🙂
