Script to use mycod...
 
Notifications
Clear all

[Solved] Script to use mycodo to send an email  

  RSS

sam26k
(@sam26k)
Eminent Member
Joined: 1 year ago
Posts: 38
February 5, 2019 5:30 pm  

Hi Kyle,

Is it possible to write a command sequence in Linux Bash or Python to send an email using the Mycodo daemon?

Thanks

PS: This is first post hope I did it right.


Quote
Topic Tags
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 193
February 6, 2019 10:32 pm  

This is possible. I dont's have time at the moment, but I will respond soon with example code for how to do this.

Mycodo Developer


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 193
February 12, 2019 10:32 am  

I realized I will need to add a small function to mycodo_client.py to accomplish this. I have another project that's high priority until after this weekend, but I will implement this in the next release and leave example code here for how to use it.

Mycodo Developer


ReplyQuote
sam26k
(@sam26k)
Eminent Member
Joined: 1 year ago
Posts: 38
February 12, 2019 5:53 pm  

Ok thanks for update.  When ever you get time.  The pump I'm using turned out to be pretty wimpy and never applies excessive pressure anyway but plan on increasing the  capacity later.  I already have the control code scripts for sequencing the pump and solenoids working fairly well if there is no error conditions, so don't worry about that.


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 193
May 11, 2020 4:45 pm  

Unfortunately this request got away from me. I only found it again because I was searching for a forum post. Well, I added this feature to mycodo_client.py and will be released with Mycodo 8.5.0. Any place where Python commands can be used, an email can now be sent:

from mycodo.mycodo_client import DaemonControl

control = DaemonControl()
control.send_email(
["email1@email.com", "email2@email.com"],
"This is the Subject",
"This is the message body")

Mycodo Developer


ReplyQuote