Roomba Plugin - Discontinued

Posted on
Wed Nov 30, 2016 7:53 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Roomba Plugin - Discontinued

https://github.com/FlyingDiver/Indigo-R ... tag/v0.0.1

Based on Bollar's scripts as posted in this thread: viewtopic.php?f=138&t=17271

  1. Create Roomba Device
  2. Enter IP address. Plugin will check if the robot is reachable at that address.
  3. Use the "Get Credentials" Menu Item (Plugsins -> Roomba -> Get Credentials) to authenticate to the Roomba.
  4. Use the plugin defined Actions to control your Roomba

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Nov 30, 2016 8:19 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Roomba Plugin - first test release

Neat.

I don't know if this is your problem or not, but...
Code: Select all
   Action Group                    Test Roomba Plugin
   SQL Logger                      creating table device_history_1033922261 for "Roomba"
   SQL Logger Error                exception trying to create table device_history_1033922261 ("Roomba")
   SQL Logger Error                duplicate column name: id
   SQL Logger Error                CREATE TABLE device_history_1033922261 ( id #AUTO_INCR_KEY, ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "batpct" INTEGER, "cycle" TEXT, "day" TEXT, "errorcode" TEXT, "errortext" TEXT, "expirem" INTEGER, "flags" INTEGER, "id" INTEGER, "mssnm" INTEGER, "notready" INTEGER, "phase" TEXT, "rechrgm" INTEGER, "sqft" INTEGER, "theta" INTEGER, "time" TEXT, "x" INTEGER, "y" INTEGER, "devicestatus" INTEGER, "devicestatus_docked" BOOL, "devicestatus_running" BOOL, "devicestatus_unknown" BOOL);
   SQL Logger Error                exception trying to insert row into table device_history_1033922261 ("Roomba") -- unable to modify table
   SQL Logger Error                no such table: device_history_1033922261
   SQL Logger Error                INSERT INTO device_history_1033922261 ("batpct", "cycle", "day", "errorcode", "errortext", "expirem", "flags", "id", "mssnm", "notready", "phase", "rechrgm", "sqft", "theta", "time", "x", "y", "devicestatus", "devicestatus_docked", "devicestatus_running", "devicestatus_unknown") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Wed Nov 30, 2016 8:30 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Roomba Plugin - first test release

Don't think that's my code.

Do you have another device with the same name?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Nov 30, 2016 8:32 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Roomba Plugin - first test release

Oh, wait. I bet the SQL logger has an "id" key, and the plugin also has a state with that name. I'll change the name of the state in the plugin.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Nov 30, 2016 8:37 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Roomba Plugin - first test release

Well no, but I don't think it's the device. I already have a variable named 'id' so that's probably the issue.. It would be helpful (for me at least), if you renamed 'id' to something else.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Wed Nov 30, 2016 8:48 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Roomba Plugin - first test release

Bollar wrote:
Well no, but I don't think it's the device. I already have a variable named 'id' so that's probably the issue.. It would be helpful (for me at least), if you renamed 'id' to something else.


I think it's the SQL logger itself.

Code: Select all
   SQL Logger Error                exception trying to create table device_history_1033922261 ("Roomba")
   SQL Logger Error                duplicate column name: id


The error is while it's creating a device history table, which would have all the states in it. So I don't think it's actually protecting the column names. I think it's using the raw state names as column names, which is dangerous programming technique.

Yeah, I just checked. That's exactly what it's doing. Bad programmer. :)

I'm changing that state to "rID". I'll wait until tomorrow to push an update in case there are any more bug reports tonight.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Nov 30, 2016 9:02 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Roomba Plugin - first test release

Oops. :mrgreen:

Image

Posted on
Thu Dec 01, 2016 7:50 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Roomba Plugin - beta tests

v0.0.2 released. Use internal updater or get from https://github.com/FlyingDiver/Indigo-R ... tag/v0.0.2

Changed state ID to rID to remove conflict with SQL Logger.
Enabled Trigger processing.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Dec 01, 2016 7:55 am
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Roomba Plugin - beta tests

Hm, curious:

Code: Select all
   Roomba                          Starting Roomba
   Error                           device "MyRoomba" state key rID not defined (ignoring update request)
   SQL Logger                      creating table device_history_1033922261 for "MyRoomba"
   SQL Logger Error                exception trying to create table device_history_1033922261 ("MyRoomba")
   SQL Logger Error                duplicate column name: id
   SQL Logger Error                CREATE TABLE device_history_1033922261 ( id #AUTO_INCR_KEY, ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "batpct" INTEGER, "cycle" TEXT, "day" TEXT, "errorcode" TEXT, "errortext" TEXT, "expirem" INTEGER, "flags" INTEGER, "id" INTEGER, "mssnm" INTEGER, "notready" INTEGER, "phase" TEXT, "rechrgm" INTEGER, "sqft" INTEGER, "theta" INTEGER, "time" TEXT, "x" INTEGER, "y" INTEGER, "devicestatus" INTEGER, "devicestatus_docked" BOOL, "devicestatus_running" BOOL, "devicestatus_unknown" BOOL);
   SQL Logger Error                exception trying to insert row into table device_history_1033922261 ("MyRoomba") -- unable to modify table
   SQL Logger Error                no such table: device_history_1033922261
   SQL Logger Error                INSERT INTO device_history_1033922261 ("batpct", "cycle", "day", "errorcode", "errortext", "expirem", "flags", "id", "mssnm", "notready", "phase", "rechrgm", "sqft", "theta", "time", "x", "y", "devicestatus", "devicestatus_docked", "devicestatus_running", "devicestatus_unknown") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
   Roomba                          Checking for updates...
   Roomba                          No updates are available

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Thu Dec 01, 2016 8:10 am
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Roomba Plugin - beta tests

As far as testing goes, it did begin and pause/dock based on triggers I had previously setup.

It would be great if you could push the error / not ready in the same Plugin trigger, so I don't have to create a separate trigger for each error / not ready I want to track. I currently have one trigger for errors and one for not readys and each stores the latest numerical value and associated text.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Thu Dec 01, 2016 8:49 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Roomba Plugin - beta tests

Bollar wrote:
Hm, curious:

Code: Select all
   Roomba                          Starting Roomba
   Error                           device "MyRoomba" state key rID not defined (ignoring update request)
   SQL Logger                      creating table device_history_1033922261 for "MyRoomba"
   SQL Logger Error                exception trying to create table device_history_1033922261 ("MyRoomba")
   SQL Logger Error                duplicate column name: id
   SQL Logger Error                CREATE TABLE device_history_1033922261 ( id #AUTO_INCR_KEY, ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "batpct" INTEGER, "cycle" TEXT, "day" TEXT, "errorcode" TEXT, "errortext" TEXT, "expirem" INTEGER, "flags" INTEGER, "id" INTEGER, "mssnm" INTEGER, "notready" INTEGER, "phase" TEXT, "rechrgm" INTEGER, "sqft" INTEGER, "theta" INTEGER, "time" TEXT, "x" INTEGER, "y" INTEGER, "devicestatus" INTEGER, "devicestatus_docked" BOOL, "devicestatus_running" BOOL, "devicestatus_unknown" BOOL);
   SQL Logger Error                exception trying to insert row into table device_history_1033922261 ("MyRoomba") -- unable to modify table
   SQL Logger Error                no such table: device_history_1033922261
   SQL Logger Error                INSERT INTO device_history_1033922261 ("batpct", "cycle", "day", "errorcode", "errortext", "expirem", "flags", "id", "mssnm", "notready", "phase", "rechrgm", "sqft", "theta", "time", "x", "y", "devicestatus", "devicestatus_docked", "devicestatus_running", "devicestatus_unknown") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
   Roomba                          Checking for updates...
   Roomba                          No updates are available


You need to edit the device to get it to pick up the new state definition. I spent some time last night trying to figure out how to do that automatically, and wasn't able to.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Dec 01, 2016 8:58 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Roomba Plugin - beta tests

Bollar wrote:
As far as testing goes, it did begin and pause/dock based on triggers I had previously setup.

It would be great if you could push the error / not ready in the same Plugin trigger, so I don't have to create a separate trigger for each error / not ready I want to track. I currently have one trigger for errors and one for not readys and each stores the latest numerical value and associated text.


The logic for the triggers (as of now) is:

If NotReady == 16, do the binFull trigger actions
If NotReady == 7, do the binMissing trigger actions

Are you saying that you would prefer:

if NotReady != 0, do NotReady trigger

And then you could just save or log the value?

And the same for ErrorCode != 0?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Dec 01, 2016 10:10 am
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Roomba Plugin - beta tests

FlyingDiver wrote:
Bollar wrote:
As far as testing goes, it did begin and pause/dock based on triggers I had previously setup.

It would be great if you could push the error / not ready in the same Plugin trigger, so I don't have to create a separate trigger for each error / not ready I want to track. I currently have one trigger for errors and one for not readys and each stores the latest numerical value and associated text.


The logic for the triggers (as of now) is:

If NotReady == 16, do the binFull trigger actions
If NotReady == 7, do the binMissing trigger actions

Are you saying that you would prefer:

if NotReady != 0, do NotReady trigger

And then you could just save or log the value?

And the same for ErrorCode != 0?


Probably. I want to be able to send the message to Pushover, along with the descriptive text and I would prefer not to create a new trigger for each error state. Currently I have a trigger to send a Pushover message with the contents of roombaErrorText whenever roombaError >0 (in my version of the code).

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Thu Dec 01, 2016 10:16 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Roomba Plugin - beta tests

Well, you could do that now with a trigger based on the device state instead of a specific plugin action. But I can certainly add a generic trigger based on any non-zero value of the state. What have you seen happening with the error value? What's the relationship between the two?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Dec 01, 2016 2:55 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Roomba Plugin - beta tests

FlyingDiver wrote:
Well, you could do that now with a trigger based on the device state instead of a specific plugin action. But I can certainly add a generic trigger based on any non-zero value of the state. What have you seen happening with the error value? What's the relationship between the two?

Maybe I'm misunderstanding you, or we're misunderstanding each other. What I want is to be able to send the specific error or not ready message to Pushover without having to create a trigger for each type of event that the plugin can report. That's what I currently do with my script.
Attachments
fullsizeoutput_3276.jpeg
fullsizeoutput_3276.jpeg (43.97 KiB) Viewed 5391 times

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Who is online

Users browsing this forum: No registered users and 0 guests

cron