Please login or register.

Login with username, password and session length
Pages: 1 ... 5 6 [7]

Author Topic: 📧HG Smart E-mailer  (Read 28791 times)

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: 📧HG Smart E-mailer
« Reply #90 on: January 30, 2020, 10:48:42 AM »

SMTP2GO may not be a final solution, but if it works for now it would possibly help users who are stuck with gmail/yahoomail.  My ISP is my cell company and they don't even give me an external IP so I can no longer connect to my RPi remotely.  In my case, I believe the only option if I want to have a server at home is sign up for a VPN that gives that kind of access.  If I were P2P these days, it would be a no brainer but I haven't done that in years.

As for the email, I would recommend finding a permanent solution but good to know that SMTP2GO works as a temporary step.

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: 📧HG Smart E-mailer
« Reply #91 on: January 30, 2020, 11:01:19 AM »

In my trying 4 different email accounts today and none sending, after I added the email test send when I change "E-MailAccount" program, it started working;  last set of parameters I had in it was my gmx.com account with mail.gmx.com, port 465, SSL   so I am leaving them.   No changes but adding test email to email parameters program made it work for me...
Logged

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: 📧HG Smart E-mailer
« Reply #92 on: February 03, 2020, 09:00:13 AM »

OK, here is the latest update after testing things over the last few days.

With help from petera, tuicemen and mike I at least have my emails sending.

Petera had informed of where the email account settings were stored - they are supposed to be in a file called systemconfig.xml (NOTE: if you decide to muck around with that yourself please make a backup of it first).

I manually edited the settings in that file to be what my ISP defined.  I even tested them with an external tool on my pc called SMPT Diag Tool.

So what is strange is that the info I had manually edited in the systemconfig.xml file did not seem to be reflected in the "E-Mail Account" HG program (which I used mike's update to trigger an email on changing each field - this was most helpful).

Petera had suggested deleting each setting in the E-Mail Account Program (from the Options) one by one, then putting back in my real settings.  I tried this a few times with no luck.

Finally this morning I tried this:
delete a setting, hit return, wait 30 seconds
tab to the next field
repeat to delete each field
when finished, Exit the Options

I then checked my systemconfig.xml file and nothing had changed - so not really sure what fields the E-Mail Account program is using vs what the systemconfig.xml file is storing and what the difference is.

Then I went back into the E-mail Account Options and did this:
enter in a value for the E-mail address field, hit enter and wait 30 seconds.
with mike's change to that program I got a notification that an email was not sent.

I tabbed to the SMTP mail server address field
entered in my value, hit return and waited 30 seconds
this time I got an email sent notification and after a few seconds I did receive an email

I checked my systemconfig.xml file and nothing in it had changed - all the fields still had the same values as before.

Then I tabbed to the next field (SMTP username) and entered  a value, hit enter and waited 30 seconds.  No notification about an email sent or not, and no email received.

I decided to try the remaining fields - entering a value and waiting 30 seconds between each.  Nope - still no notification and no email.

checked the systemconfig.xml file again, all my fields still have the same values.

At this point I was thinking I should have just stopped once I received an email :(

So back to step one again.

Cleared out each of the fields in the E-Mail Account Options, one by one deleting the field and waiting 30 seconds then tab to the next field and did the same.

Exited the Options.

Went back into Options,

Entered in my email address, hit return, waited 30 seconds.  Got notification that email was not sent
tabbed to the SMTP server address field.  Entered in my value, hit enter, waited 30 seconds.  Got notification that email was sent and after a few seconds I did receive the email.

Then I stopped - exited the Options screen.  Which at this point only has my email address and SMTP server address - all the other fields are blank.

checked the systemconfig.xml file again - all the fields have values (even the ones that are blank in the E-Mail Account Options screen).

I then inactivated the E-Mail Account program (it is not running) and activated the Smart_Emailer program.

Went to the Dashboard in HG, opened the settings for one of my lights and checked the Enable Emails setting, saved.  Turned the light on from HG and got the email :)


Not sure why the systemconfig.xml settings and the E-Mail Account options do not match, nor why my email sends with only the email account and smtp server address defined in the Email Account Options but it is working now.

Good time to make a back up.

Thanks for everyone's help.



Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: 📧HG Smart E-mailer
« Reply #93 on: February 03, 2020, 09:59:20 AM »

Make sure that backup is a full SD card image.

One piece of advice too. If you are ever editing a Program ensure you disable it first and when finished editing enable it again for obvious reasons.

On the email settings issue, assuming your smtp server allows you to forward emails ensure that the last box enabling ssl in the settings is ticked and you can clearly see that tick and you use the correct port number.

Finally I really do advise running HG in debug mode to monitor all processes when troubleshooting an issue. For those who are not sure how to do this

sudo systemctl stop homegenie.service

cd

cd /home/pi/homegenie

sudo mono HomeGenie.exe --log

When finished running in debug mode just press Ctrl-c and type

cd

sudo systemctrl start homegenie.service

to restart HG

Glad to hear your email notification is working again. A bit of hard work to get there but at least you are a little more knowledgeable of the system files.
« Last Edit: February 03, 2020, 11:15:16 AM by petera »
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: 📧HG Smart E-mailer
« Reply #94 on: February 03, 2020, 10:17:38 AM »

Great!   

I enjoyed reading your bit about "I then checked my systemconfig.xml file and nothing had changed - so not really sure what fields the E-Mail Account program is using vs what the systemconfig.xml file is storing and what the difference is."   Hahaha!!!   I went that road too!  So frustrating to find where the data is supposed to be then see it not changing!

Interesting you saying you disabled the email program (where your email info is stored)...   For some reason I thought that had to be running for email to work...  Guess not.  Great to know!

For kicks I turned on email notifications on a few of  my plaini X10 eagle eye sensor triggered light switches...  Found my Barn light, which I cannot see, is turning on and off 5-6 times a day!  middle of the night, day, etc!  How neat to learn!!!!  Might be ground hogs moving around inside...
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: 📧HG Smart E-mailer
« Reply #95 on: February 03, 2020, 10:19:18 AM »

Perhaps Petera hit on something big here:  disable a program before making changes then re enable after...

Wonder if THAT would have made the email changes take affect properly?    I will never know because I AIN'T TOUCHING IT AGAIN UNTIL IT BREAKS AGAIN!
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: 📧HG Smart E-mailer
« Reply #96 on: February 03, 2020, 11:08:58 AM »

If HG is running with the app enabled, I suspect changing values in the xml file won't be picked up.  I assume that the values in the xml file will only be read on load of the app.  Also, I'd assume that values in the app will be written to the xml on shutdown/stopping of the app.  If so, then making changes to the xml will be of no use unless you first stop either the app or HG service and then starting it again after modifying values.

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: 📧HG Smart E-mailer
« Reply #97 on: February 03, 2020, 01:09:38 PM »

If HG is running with the app enabled, I suspect changing values in the xml file won't be picked up.  I assume that the values in the xml file will only be read on load of the app.  Also, I'd assume that values in the app will be written to the xml on shutdown/stopping of the app.  If so, then making changes to the xml will be of no use unless you first stop either the app or HG service and then starting it again after modifying values.

That's pretty much it.

If anyone wants to examine the XML files just import them into something like Excel (I chose that for the windows users) and examine them that way. This is a copy of the base systemconfig.xml for comparison purposes. 

https://github.com/genielabs/HomeGenie/blob/master/BaseFiles/Common/systemconfig.xml

Depending on how file locking is handled in HG, as you say it's unlikely any changes made "on the fly" will keep once you exit the editing session. You'll see a similar incidence of this if you try and edit a service daemon while the service is running. At least the OS reminds you to reload the service daemon before the edited service daemon takes effect.

As I mentioned before I don't experience this problem but I don't run HG on a Pi Zero. I don't want to get too deeply into further discussion on this but suffice to say a Pi Zero fully loaded is going to struggle. Maybe users who constantly experience this problem should invest in a Raspberry Pi 3b+ and try for themselves.
Logged

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: 📧HG Smart E-mailer
« Reply #98 on: February 04, 2020, 11:39:25 AM »

So now that I have the emails working I noticed I was getting an email (or actually a text message, as I am using the ability to email as a text message) four times each time the light was turned on.

I took a look at the Smart_Emailer program and made a tweak which I think fixes this, though it may (or may not) be specific to my usage.  I do not have the security feature installed so I do not use the Arm / Disarm, just the notification as part of a light being turned on.

What I did was add a variable called lastmodule which stores the last module that was processed.  Then I modified one of the first conditions to check if the current module being processed was different that the lastmodule - if so, proceed, else do not.  In both cases, the lastmodule variable should get updated so that the check can be made again on the next trigger.

I have attached the update program if anyone is interested.  I also did some formatting to align the { and }, hope that is OK :)
Note: 1033-Smart_E-mailer.hgx was renamed as a .txt file, so you will need to rename before importing and you may want to back up your current version first.

Thanks
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: 📧HG Smart E-mailer
« Reply #99 on: February 04, 2020, 11:51:52 AM »

 #:) the HG Smart E-mailer was intended as something to be modified, tweaked and improved on by others.
As with all the programs I posted, I had hoped others would expand on them and share their works so everyone could benefit.
Users that state their programs are too personalized to share is BS.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: 📧HG Smart E-mailer
« Reply #100 on: February 04, 2020, 01:43:26 PM »

THANKS soxfan!  I used to get multi emails also like that.   I thought mine stopped I think (maybe not)...  I should not say they stopped repeat 2 or 4x as my HG stopped reading all my DS10's for some reason.  Not a big deal to me as my x10 alarm sees them fine and all I really use HG for is to arm & disarm the real x10 alarm.  That said, it was nice to have all DS10 sensors live in HG so they could send an email stating which one triggered!  Only happened one time at 2am in the snowy night and I was able to go directly to that door to find out why...  I plan to reinstall all DS10's into HG again but no time yet.  So I will keep your improvement for that day!

As for having to turnoff a program before modifying its options...  Never saw that written anywhere, and it certainly is not true for all programs I have and change data on real time - except perhaps it is true for the e-mail program...
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: 📧HG Smart E-mailer
« Reply #101 on: February 04, 2020, 01:46:41 PM »

I might add that since I turned on smart emailer for my non alarm switches, they are reporting only 1x when they go from 0 to 1...
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: 📧HG Smart E-mailer
« Reply #102 on: February 04, 2020, 02:25:58 PM »

I believe why soxfan1966 gets multi confirmation emails for some of his x10 devices is the fact that other RF transceivers are in his setup.
I never accounted for that when I originally coded this.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: 📧HG Smart E-mailer
« Reply #103 on: February 04, 2020, 03:38:23 PM »

sounds feasible;  I too have XTBR 220v repeater and must have multiple TM751's around as needed...   To me multiple emails for an event is not devastating;  it is 10000% better than no email alternative.
Logged
Pages: 1 ... 5 6 [7]
 

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