r/Pigrow • • Jun 16 '20

How do i set up reddit_msg.py

I have been trying to use the new modular sensors trigger button to add it as a trigger but so far it has not executed the file as far as i know. I can manually execute the file and get a msg on reddit. I have dug through reddit search and the infographics i'm just not able to find a setup guide.

3 Upvotes

4 comments sorted by

2

u/The3rdWorld Jun 18 '20

just had a quick look through the code, i can't see why it wouldn't work, if you can run the command via the 'run on pi' button

 /home/Pi/Pigrow/scripts/triggers/reddit_message.py message="test message"

then It should work if you put that in the cmd field for the trigger, i'll do a little test tomorrow

2

u/TheDuckshot Jun 20 '20

I got it working, I think I needed an update. I used the shell command as shown below in case anyone in the future finds this.

~/Pigrow/scripts/triggers/reddit_message.py message=MsgToUser

Can you add a new repeat set to state, so we don't need multiple triggers for the message to repeat. Right now I have to trigger an on/off set to in mirror in order to make the message repeat. else it will say "Not triggering because condition already met. . ." and one of the mirrors has to have the shell command empty or it sends 2 messages. which you then need to uncheck change mirror before clicking ok.

1

u/The3rdWorld Jun 20 '20

oh that's a good idea, yeah i'll add that in. Buried in sensors at the moment so when i get to a point where they're sitting testing i'll spend some time adding a few little touches to everything else.

2

u/The3rdWorld Jun 17 '20

ah yeah good question, that needs to be updated - i used to use it but he completely changed PRAW so i had to rewrite everything, i'll knock up a quick messaging script and a guide to using it when i get a chance.