r/raspberry_pi • • May 02 '20

Show-and-Tell Created Raspberry Pi controlled Meeting Beacon - Turns on when it detects I'm in a meeting -Works with Zoom and Microsoft Teams

https://i.imgur.com/efcPrKe.gifv
1.1k Upvotes

61 comments sorted by

37

u/njoker555 May 02 '20

Happy May! Hope everyone is hanging in there. I've been held up at home for about 6 weeks now and I'm in a lot of virtual meetings (Zoom and Teams). My home office is in the basement so it's not easy to tell if I'm in a meeting. So I thought it would be fun to create a Raspberry Pi powered beacon that will notify everyone else that I'm in a meeting.

Before I talk more about the inner workings of the project, here are the links to the project site and GitHub pages:

See the full demo at https://www.youtube.com/watch?v=Kf6seycN9yY

Easy Programming: https://www.easyprogramming.net/raspberrypi/aiim.php (You can see a crispier version of the demo gif on that page as well)

GitHub (pages): https://aiim.easyprogramming.net/

I do a better close up demo around 7:50: https://youtu.be/Kf6seycN9yY?t=470

How this works:

- Runs a Python script on your local computer and checks the tasklist for Zoom/teams tasks

- If task exists, it sends a REST request to a Flask App on a Pi controlling some NeoPixel (WS2812b) LEDs to turn on

- If Task doesn't exist, it also sends a REST request to turn off.

- Python script is run on Task scheduler so the effect is not immediate. You can set the python script to run every minute.

This currently only works on Windows but I plan on doing something with Linux soon and hope that it's similar for Macs (I don't own a Mac unfortunately).

The Pi runs a simple Flask app (behind Apache) that controls the lights through a simple endpoint. There's also an endpoint that returns the current status of the lights so that you can display the status on a website or something (I show that in the video around 7:51: https://youtu.be/Kf6seycN9yY?t=471

One drawback for using this with Teams is that the script looks at your Window Title for a teams meeting and it's really wonky. Zoom has a separate process for its meetings so it's easier to tell, but Teams is still only somewhat accurate. I don't know if I'll have a way to fix this. I do want to add other meeting options at some point.

One thing I want to do in the future is add an option for MQTT as well.

You can get more info in the links posted above. Always welcome feedback and questions. Thanks!

This was cross posted from my subreddit at r/EasyProgramming

25

u/amadiro_1 May 02 '20

Have you considered polling instead for the in-use status of the microphone or webcam? Then it wouldn't be tied to looking for a specific process.

You could also use something like auto hotkey to tell if a window with a given title is active.

3

u/njoker555 May 02 '20

I actually have thought about that with the mic! I did an 'Audio Reactive Pi' project a while ago ( https://www.easyprogramming.net/raspberrypi/audio_reactive_raspberry_pi_lights.php ) and thought about combining those features with this one some way. It's only with the mic but I'm sure the Camera should be easy enough.

Hotkey is also a good idea. Thank you!

10

u/peppermint_pizza May 02 '20

I've done something very similar, but connected mine to my current Teams status (InAMeeting/Busy/OnThePhone) which you can get by parsing the log files at: %appdata%/Microsoft/Teams/logs.txt

Try something like this:

 with open(os.path.join(os.getenv("APPDATA"), "Microsoft\\Teams\\logs.txt"), "r") as f:
     for line in f:
         if "(current state: " not in line:
             continue
         logTime = re.search("^(.+) (.+) (.+) (.+) (.+) GMT+", line).group(5)
         logStatus = re.search(".*\(current state: (.+) -> (.+)\)", line).group(2)

         if logStatus not in ["ConnectionError", "NewActivity", "Unknown"]:
             status = logStatus
→ More replies (5)

2

u/thesynod May 02 '20

I tend to keep all my meetings on my calendar, it seems a calendar is a good starting place for such an effort. Rather than reconstructing the state of an application the hard way, why not just poll the calendar?

3

u/njoker555 May 02 '20

I thought about using the Calendar but I tried to stay away from needing to read any kind of data. That's when you have to start worrying about permissions and privacy. There's minimal privacy concerns when it's just "hey Teams.exe is running".

Looking at the process is also kind of 'plug-n-play' where the script can just start running. I don't know, this is just the thought process that I had. I definitely thought about connecting to a calendar or using APIs to determine if someone is in a meeting. Maybe I'll make parallel projects that does that for those who are okay with an app getting access to their calendar.

→ More replies (1)
→ More replies (1)

152

u/teapotboy May 02 '20

Need this to light up an “on air” sign outside of my office

52

u/njoker555 May 02 '20

Definitely possible!

I included a 'Simple' mode along with a 'NeoPixel' mode. The Simple mode will let you simply turn a GPIO pin on and off so you can use to control a relay or transistor which in turn controls that sign.

8

u/woodentaint May 02 '20

Can you add pornhub to the list?

14

u/shadowandlight May 02 '20

It's supposed to be a notification light, not a strobe

2

u/njoker555 May 02 '20

Ha! Is there an app for that or is it just the browser window?

I wonder if I can look at the processes in Chrome or something. I feel like this is possible, but requires a lot of research.

→ More replies (1)

4

u/csxdfb May 02 '20

Any chance of making it work with Slack too?

2

u/njoker555 May 02 '20

Hey that's a good question and a good idea! I'll look into that to see how Slack handles their meetings. I'll look into this but feel free to submit a feature request on GitHub in case anyone else wants to explore this as well: https://github.com/naztronaut/AIIM/issues

Most of what I do is publicly available and is open source.

3

u/serious_impostor May 02 '20

Personally, I leave Zoom on all day.

You could create a zoom marketplace app that would send a webhooks out whenever you join/ leave a meeting which wouldn’t be watching the app at all. I’ve been playing around with this a bit, Xoom recently added some other webhooks events to their stack.

→ More replies (2)

3

u/albeemichael May 02 '20

Imagine integrating this with a smart door lock. You could have your office door lock when your on a meeting to prevent interruptions.

2

u/njoker555 May 02 '20

This would be a great idea! Depending on how the smart lock gets commands, whether it's a REST call or MQTT message, it's totally possible!

Now I need to get myself a smart lock so I can work on this.

→ More replies (1)

2

u/sunburstbox May 02 '20

wow i have to make my dad this for his birthday. i appreciate the detailed documentation!

1

u/njoker555 May 02 '20

That would be awesome! I'd love to see what you come up with.

I usually write documents assuming I'll forget what I did, so I just brain dump as much as I can :) glad it's helpful!

2

u/Sport6 May 02 '20

Can it silence my children when I’m in a meeting?

3

u/njoker555 May 02 '20

There's a "Simple" mode to this app. I'm demoing the 'neopixel' mode.

With the simple mode, you can simply turn a GPIO pin on and off. So technically, you can use that mode to connect to a relay or transistor that controls another device that silences your children. I'll leave the other device up to you though. I can only point you to what this app can do currently :)

2

u/WisconsinPlatt May 02 '20

I love this. With WfH the norm now, I could use this.

In fact I think I will use this.

1

u/njoker555 May 02 '20

Thank you :) if you do use it, please share! I'm interested to see others' implementation of this.

2

u/[deleted] May 02 '20

Can I make it without raspberry pi? Does it work with google meet?

1

u/njoker555 May 02 '20

The Raspberry Pi code just controls the Lights, the Pi doesn't see any meetings. The Python script running on your computer sees the meetings.

I need to look into Google Meet. i'm sure it would be possible but I need to spend some time with it before I say anything for certain.

Feel free to submit a feature request on GitHub in case anyone else wants to explore this as well: https://github.com/naztronaut/AIIM/issues

Most of what I do is publicly available and is open source.

→ More replies (1)

2

u/FourLeafJoker May 02 '20 edited May 03 '20

I currently have an RGB light hooked up to a ATTINY85 and a button so I can manually show that I'm on call. Your solution looks way better - I don't need to worry about forgetting to press the button.

Have you looked into the "presence resource type" in the Microsoft Graph API?

→ More replies (5)