more G-Labs products

Author Topic: Gmail not working after r491-p2 update  (Read 1149 times)

June 09, 2015, 04:20:31 AM
Read 1149 times

MJCfromCT

  • *
  • Information
  • Newbie
  • Posts: 22
Hi - I have had several door/window sensors working well over the past few months with an older version of homegenie.  Yesterday I updated to the latest version via the web UI, and now email (via Gmail) is not working properly.  I had the following code working for all of my door/window sensors:

Code: [Select]
Net.SendMessage("[email protected]",   // recipients
                "HomeGenie - Back Door Opened",                          // subject
                "Back Door Opened");        // message text

with the following trigger code:

Code: [Select]
return Modules.InGroup("Main Level")
             .WithName("Back Door").Get() // get reference to the selected module
             .Parameter("Sensor.DoorWindow").DecimalValue == 255;

This worked prior to the r491-p2 update.

Now, I get no email notifications.  I tried to write a simple program to run and test email functionality:

Code: [Select]
Net.SendMessage("[email protected]", "Subject here", "This is the message text." );
I see a runtime error in the log:

Quote
Program   Program.Status   Running
2015-06-09T01:09:24.2977940+00:00   HomeAutomation.HomeGenie.Automation   1012   Automation Program   Runtime.Error   
2015-06-09T01:09:24.2940940+00:00   MIG.Gateways.WebServiceGateway   192.168.1.1   api/HomeAutomation.HomeGenie/Automation/Programs.Run/1012/null   HTTP   GET
2015-06-09T01:09:24.9505770+00:00   HomeAutomation.HomeGenie.Automation   NetHelper   Message could not be sent.   Exception.StackTrace     at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x00000] in <filename unknown>:0
  at HomeGenie.Automation.Scripting.NetHelper.SendMessage (System.String from, System.String recipients, System.String subject, System.String messageText) [0x00000] in <filename unknown>:0
2015-06-09T01:09:24.9517120+00:00   HomeAutomation.HomeGenie.Automation   1012   Automation Program   Program.Status   Idle
2015-06-09T01:09:24.9468400+00:00   MIG.Gateways.WebServiceGateway   192.168.1.1   

Any thoughts as to what changed with r491-p2, and how I need to correct my settings to get my email notifications working properly again?  Thanks in advance.

June 10, 2015, 01:37:28 AM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Check that the email settings are correct and that the email helper script is compiled and enabled.  I've seen where a script says it's running, but when I enter it, there is an error that recompiling magically solves.  Otherwise, I'm not sure.

June 10, 2015, 03:07:16 AM
Reply #2

MJCfromCT

  • *
  • Information
  • Newbie
  • Posts: 22
hi bkenobi, thanks for the reply.  While the email settings were correct, I believe I found the problem.  I had the HTTP service port set to something other than port 80 (for my remote login purposes).  After setting it back to port 80, my email test program works as intended.  I then set it back to its original port and it continues to work fine.

However, my programs for email notification of door opening and closing don't seem to work with this newest update.  Homegenie notifies me of a sensor "Level = 1" when I open a door, and "Level = 0" when I close it.  I used to see a notification of a "DecimalValue = 255" when the door opened, and "DecimalValue = 0" when closed.  Any thoughts on how I can tweak my program listed above to work with what seems like a new way that Homegenie is interpreting door/window sensor opening/closings?

June 10, 2015, 04:13:15 AM
Reply #3

MJCfromCT

  • *
  • Information
  • Newbie
  • Posts: 22
After troubleshooting, looks like the trigger code needed to be changed from:

Code: [Select]
return Modules.InGroup("Main Level")
             .WithName("Back Door").Get() // get reference to the selected module
             .Parameter("Sensor.DoorWindow").DecimalValue == 255;

to:

Code: [Select]
return Modules.InGroup("Main Level")
             .WithName("Back Door").Get() // get reference to the selected module
             .Parameter("Status.Level").DecimalValue == 1;

June 10, 2015, 04:57:16 PM
Reply #4

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
That would have been my guess.  I'm not sure why the DecimalValue would have changed.  Either it was a bug, is a bug, or Gene should have some documentation on GitHub that indicates the change in approach.