How to create sensor in python for http

hi all
i want to connect my web app with stackstorm using http request …what is the procedure … and i also want to know …how to create rule and how to trigger rule …actually i have downloaded email pack from github and this is working when i’m sending email in manually but i don’t knw how to trigger it automatically …i have used IMAP sensor

thanks in advanced

Hi @annu9103,

might be that I misunderstand something but did you read Sensors and Triggers — StackStorm 3.2.0 documentation? This page describes how to add a Python sensor and even has some kind of template.

Same for Rules — StackStorm 3.2.0 documentation but you can also create the rule via the WebUI. Just click on the Rules icon on the menu top center and add one.

Please let us know if you experience any specific errors and feel free to share error messages, information what you already tried, etc. We’re happy to help. :slight_smile:

Cheers,
Marcel

@winem
thanks for your response …could you plz describe how to trigger imap sensor. actually i have downloaded one email pack …i have made one rule …trigger section contain email.imap_sensor and criteria has (trigger.from contain annu@gmail.com) and action part has email.send_email. and in action part i have assign some account details …actually i m new in this …i don’t knw hoe to trigger a rule …i can manually send a mail to me from other email account which i have assigned in action part… ( st2 run email.send_email account=msss email_to=annu@gmail.com messag e=“Hi there, wow!” email_from="abc@gmail.com" subject=“Intros”
)
i want to see this rule trigger by itself

Hi,

the described use-case confuses me a bit so let’s see if I get this correct:
st2 should send out an email whenever there is an unread email from annu@gmail.com? At least this is what your described configuration would do.

Is the sensor registered? Verify it with st2 sensor list first and if that’s the case we would probably need some logs to see what’s going on here. Check Sensor Troubleshooting — StackStorm 3.2.0 documentation to activate the debug logging of the sensorcontainer. This will show any errors or issues when processing the sensor.

Cheers,
Marcel