Better Email plugin discussion thread

Posted on
Fri Jun 17, 2016 8:10 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

My bad. I don't actually have a POP account for testing purposes. Try this release: https://github.com/FlyingDiver/BetterEm ... ag/v1.2.11

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

Posted on
Sat Jun 18, 2016 1:21 pm
RedYuriPrime offline
Posts: 58
Joined: Oct 14, 2014
Location: Oxford

Re: Better Email plugin discussion thread

Hi Joe,
Thanks for the new version.

Device now reports success and event triggers when email comes in, but the debug text still reports an error - during processing. Haven't yet worked out what doesn't complete as a result.

Better Email Debug Connecting to POP Server: Better Email Incoming Pop Server
Better Email Debug Retrieving Message # 1
Better Email Debug Parsing message GmailId15564ebe0e8de18b
Better Email Debug Received Message Subject: Pop test
Better Email Debug Received Message From: RedYuriPrime<geoff@????.com>
Better Email Debug Checking Triggers for Device Better Email Incoming Pop Server (753413257)
Better Email Debug Checking Trigger Scan Received Email (110434724), stringMatch
Better Email Debug Checking Device State messageSubject for string: Pop test
Better Email Debug Executing Trigger Scan Received Email (110434724)
Trigger Scan Received Email
Better Email Debug Error fetching Message 1: global name 'props' is not defined
Action Collection checked emails using BetterEmail
Better Email Debug Logged out from POP server
Better Email Debug Polling serverId: 23444819, serverTypeId: smtpAccount(Better Email Outgoing SMTP Server)
Better Email Debug Better Email Outgoing SMTP Server: SMTP poll, 0 items in queue

Geoff

Z-wave system with 80+ devices, Indigo7 on a dedicated MacMini
Controlling lighting, heating, hotwater, security; but still a lot to learn ... :shock:

Posted on
Sat Jun 18, 2016 2:09 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

OK, was in the delete message routine that I missed last time.

https://github.com/FlyingDiver/BetterEm ... ag/v1.2.12

That should be the last of them. Please test it again and let me know so I can push an official release.

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

Posted on
Sat Jun 18, 2016 3:22 pm
RedYuriPrime offline
Posts: 58
Joined: Oct 14, 2014
Location: Oxford

Re: Better Email plugin discussion thread

Hi Joe,

Not checked every option, but checked it out using a plain string match in the email subject and putting the body of the email into a variable. That now works fine.

Many thanks.
Geoff

Z-wave system with 80+ devices, Indigo7 on a dedicated MacMini
Controlling lighting, heating, hotwater, security; but still a lot to learn ... :shock:

Posted on
Mon Jun 20, 2016 6:04 am
RedYuriPrime offline
Posts: 58
Joined: Oct 14, 2014
Location: Oxford

Re: Better Email plugin discussion thread

Hi Joe,
Working more with your plugin, I have found the following problems remaining:
1) despite saying that it is deleting the emails in the inbox, it is not.
2) the plugin sees to be rejecting certain characters.
It will read in the following string from the body of the email:
ROOM: Lounge:WeekDays =

but fails when the string reads:
ROOM: Lounge:WeekDays = {"00:00":

with the following from debug log:

Better Email Debug Connecting to POP Server: Better Email Incoming Pop Server
Better Email Debug Retrieving Message # 1
Better Email Debug Parsing message GmailId1556da6d79c1ab57
Better Email Debug Received Message Subject: Instruction
Better Email Debug Received Message From: RedYuriPrime<geoff@????.com>
Better Email Debug Error fetching Message 1: decode() argument 1 must be string, not None
Better Email Debug Logged out from POP server

Ultimately I am trying to load the whole of the email body which reads:

ROOM: Lounge:
WeekDays = {'00:00':17,'08:00':19,'10:00':20,'16:00':21,'22:30':21,'23:00':17}
WeekEnd = {'00:00':17,'08:00':19,'10:00':20,'16:00':21,'22:30':21,'23:59':17}
Not_In_Use = {'00:00':17,'08:00':19,'10:00':19,'16:00':19,'22:30':19,'23:00':17}
Fixed = {'00:00':20}

Geoff

Z-wave system with 80+ devices, Indigo7 on a dedicated MacMini
Controlling lighting, heating, hotwater, security; but still a lot to learn ... :shock:

Posted on
Mon Jun 20, 2016 7:26 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

I set up one of my test servers for POP instead of IMAP. I'm not seeing the errors you're getting. So I think there's actually something in the format of the email that's doing something weird, and it's not something visible in the sample text you posted.

Can you have whatever is generating those email send one to indigo<at>flyingdiver<dot>com? That'll hit my test server and I can test it directly.

Delete is working. It's not deleting yours because it's failing to process it properly and it won't delete messages it detects errors handling.

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

Posted on
Mon Jun 20, 2016 11:00 am
RedYuriPrime offline
Posts: 58
Joined: Oct 14, 2014
Location: Oxford

Re: Better Email plugin discussion thread

Hi Joe,
will do straight after this, but below is the code that is generating the mail -

The intention is that the user can then modify the settings (times/temperatures) and reload, using essentially the same format. If there is anything funny in the text then it is probably generated by the json.dumps() statements.

def emailRoomDataOut():
if indigo.variables["HeatEmailDataSendTrigger"].value=="true":
indigo.variable.updateValue("HeatEmailDataSendTrigger", "false")
dataRequested = indigo.variables["HeatEmailDataRequest"].value
strEmailSubject = "Requested Heating Data, Room = " + dataRequested
strEmailBody = "||\n"
for roomObject in Room:
if dataRequested == roomObject.name or dataRequested == "All":
strEmailBody += "ROOM: "+roomObject.name+":\n"
strEmailBody += ("WeekDays = " +json.dumps(roomObject.WeekDays,sort_keys = True) +"\n")
strEmailBody += ("WeekEnd = " +json.dumps(roomObject.WeekEnd,sort_keys = True) +"\n")
strEmailBody += ("Not_In_Use = " +json.dumps(roomObject.Not_In_Use,sort_keys = True) +"\n")
strEmailBody += ("Fixed = " +json.dumps(roomObject.Fixed,sort_keys = True) +"\n")
strEmailBody += ("defaultMode = "+roomObject.defaultMode +":\n")
strEmailBody += ("days = " +json.dumps(roomObject.days,sort_keys = True) +"\n \n")

if strEmailBody != "":
strEmailBody +="##\n"
sendEmail(strEmailSubject,strEmailBody,Recipients = "110")
indigo.server.log ("%H% Provided room data requested: " + dataRequested)
else:
errString = ("%H% room data requested by user for unknown room "+dataRequested)
indigo.server.log ("%H% Cannot Provide data for room " +dataRequested)
return

Z-wave system with 80+ devices, Indigo7 on a dedicated MacMini
Controlling lighting, heating, hotwater, security; but still a lot to learn ... :shock:

Posted on
Mon Jun 20, 2016 11:36 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

I recognize that error now. It's caused by Gmail making messages multi-part even when they're not. When you sent the email to my server, it worked fine. I had previously fixed this for IMAP servers, but I didn't do the same changes to Gmail because I didn't think Gmail did POP. My bad.

Try this: https://github.com/FlyingDiver/BetterEm ... ag/v1.2.13

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

Posted on
Mon Jun 20, 2016 11:51 am
RedYuriPrime offline
Posts: 58
Joined: Oct 14, 2014
Location: Oxford

Re: Better Email plugin discussion thread

It works!! Brilliant. :D

Thanks for help
Geoff

Z-wave system with 80+ devices, Indigo7 on a dedicated MacMini
Controlling lighting, heating, hotwater, security; but still a lot to learn ... :shock:

Posted on
Thu Jun 23, 2016 1:24 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

I'm trying to get a handle on how many people are using this plugin. If you're using it, please post a reply. Any issues or requests are welcome as well.

Thanks!

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

Posted on
Fri Jun 24, 2016 3:51 am
peteinau offline
Posts: 65
Joined: Jan 10, 2015

Re: Better Email plugin discussion thread

Hi,

I'm mostly using mine to receive emails as a trigger from IFTTT for my home automation components that don't have a good way to connect to Indigo.

Thanks,
Pete

Posted on
Fri Jun 24, 2016 6:49 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Better Email plugin discussion thread

Ditto what Peteinau said.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Tue Jun 28, 2016 10:20 am
RedYuriPrime offline
Posts: 58
Joined: Oct 14, 2014
Location: Oxford

Re: Better Email plugin discussion thread

I am using it to input heating profiles, or at least will be when I get it working! :shock:

Incidentally, Joe, just realised I probably sent you a couple of accidental emails to your test input address having not changed the configuration from when you were debugging :oops: - my apologies and problem now resolved!

Geoff

Z-wave system with 80+ devices, Indigo7 on a dedicated MacMini
Controlling lighting, heating, hotwater, security; but still a lot to learn ... :shock:

Posted on
Thu Jun 30, 2016 10:18 am
RedYuriPrime offline
Posts: 58
Joined: Oct 14, 2014
Location: Oxford

Re: Better Email plugin discussion thread

Hi Joe,

Just logged onto my host after sorting a problem with the internet by rebooting router. Discovered that every 10 seconds BetterEmail was creating the following dialogue in my logfile. Not causing any problems, and stopped as soon as internet sorted, but probably not what you intended.

Better Email Debug Plugin version detected: 1.2.13
Better Email Debug Current version is: 1.2.13
Better Email Debug Getting latest release from FlyingDiver/BetterEmail...
Better Email Debug GET /repos/FlyingDiver/BetterEmail/releases/latest
Better Email Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 706, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Better Email.indigoPlugin/Contents/Server Plugin/ghpu.py", line 86, in checkForUpdate
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Better Email.indigoPlugin/Contents/Server Plugin/ghpu.py", line 173, in _prepareForUpdate
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Better Email.indigoPlugin/Contents/Server Plugin/ghpu.py", line 95, in getUpdate
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Better Email.indigoPlugin/Contents/Server Plugin/ghpu.py", line 115, in getLatestRelease
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Better Email.indigoPlugin/Contents/Server Plugin/ghpu.py", line 143, in _GET
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 920, in request
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 957, in _send_request
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 914, in endheaders
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 786, in _send_output
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 745, in send
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 1118, in connect
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 547, in create_connection
gaierror: [Errno 8] nodename nor servname provided, or not known

Better Email Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Regards,
Geoff

Z-wave system with 80+ devices, Indigo7 on a dedicated MacMini
Controlling lighting, heating, hotwater, security; but still a lot to learn ... :shock:

Posted on
Thu Jun 30, 2016 11:45 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Better Email plugin discussion thread

Not my code that failed, it's the GHPU updater module. But I put a try/except block around it so it won't crash the plugin next time.

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

Page 7 of 9 1 ... 4, 5, 6, 7, 8, 9

Who is online

Users browsing this forum: No registered users and 2 guests