Please login or register.

Login with username, password and session length

Author Topic: 142 E-mail Account program Upgrade  (Read 4404 times)

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
142 E-mail Account program Upgrade
« on: January 30, 2020, 09:56:41 AM »

Maybe someone can add some diagnostics to the 142 E-mail Account program?

It is presently:
// detect when an option of this program is changed and store the new value to system settings
When.ModuleParameterChanged((module, parameter)=>{
  if (module.Instance.Equals(Program.Module) && parameter.Name.StartsWith("ConfigureOptions.")) {
   var settingName = parameter.Name.Substring(17); // skip "ConfigureOptions." part
    Settings.Parameter("Messaging."+settingName).Value = parameter.Value;
  }
  return true;
});
Program.GoBackground();


If this would have a quick email send routine in it if something changed and maybe a list of what the parameters are now, it wold go a long way!
Logged

brobin

  • Hero Member
  • *****
  • Helpful Post Rating: 160
  • Posts: 1458
Re: 142 E-mail Account program Upgrade
« Reply #1 on: January 30, 2020, 09:59:10 AM »


The magic words “at least for now”. That’s exactly what users have experienced. Works today, doesn’t work tomorrow. Not ideal for a reliable notification system.
Well 3 years and running is pretty reliable in this day and age and I'm sure they'd tell users to convert to a paid account before dropping their free plan.  There are plenty of paid services that disappear with little to no notice - there are no guarantees at any price.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: 142 E-mail Account program Upgrade
« Reply #2 on: January 30, 2020, 10:03:30 AM »

I added test send to it for when a value changes;  it just sent for first time with this added inwho knows how long?

// detect when an option of this program is changed and store the new value to system settings
When.ModuleParameterChanged((module, parameter)=>{
  if (module.Instance.Equals(Program.Module) && parameter.Name.StartsWith("ConfigureOptions.")) {
   var settingName = parameter.Name.Substring(17); // skip "ConfigureOptions." part
    Settings.Parameter("Messaging."+settingName).Value = parameter.Value;

 var subject = "test email";
var messagetext = "HG Test Email";
var recipients = "mike@xxxere.com";
Net.SendMessage( recipients, subject, messagetext );

   if (Net.SendMessage(recipients, subject, messagetext) == true)
      Program.Notify("E-Mail Notification", "SUCCESS! Notification sent.");
   else Program.Notify("E-Mail Notification", "ERROR: Notification **NOT** sent.");
 
  }
  return true;
});
Program.GoBackground();
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: 142 E-mail Account program Upgrade
« Reply #3 on: January 30, 2020, 10:06:03 AM »

It's as if the issue I have with HG not accepting changes to the email account program may be it ends too quickly?  before it has chance to really rewrite the parameters?  adding the test send email slowed it down and it did not end the program until the send was finished in 20 seconds...  now everything magically works again...
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: 142 E-mail Account program Upgrade
« Reply #4 on: January 30, 2020, 10:10:54 AM »

Nice!  #:)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: 142 E-mail Account program Upgrade
« Reply #5 on: January 30, 2020, 10:52:36 AM »

I find that hard to believe, but if that's true then you could add a pause to the program to let it finish.  If that fixes it, just leave the delay in there.  Unless you need the notification of course...

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: 142 E-mail Account program Upgrade
« Reply #6 on: January 30, 2020, 10:55:59 AM »

I find that hard to believe, but if that's true then you could add a pause to the program to let it finish.  If that fixes it, just leave the delay in there.  Unless you need the notification of course...
Agreeded, a simple sleep 20 may do the trick. However the notification is a nice touch.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: 142 E-mail Account program Upgrade
« Reply #7 on: January 30, 2020, 11:01:41 AM »

Is this being tested on a Raspberry Pi Zero fully loaded. A side by side comparison between the Pi Zero and a Raspberry Pi 3b+ and you'll not be experiencing difficulties like this.

You have all the diagnostics you need if you run HG in debug mode. Stop your HG service. Locate the folder where the HomeGenie.exe file resides and switch to it. From there type

sudo mono HomeGenie.exe


and your HG server will start manually. You can watch everything happening in HG from that screen while you access HG from your web browser. To close the server just press the Ctrl-C keys. That's all the diagnostics you will ever need in JG
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.