Skip to content

tlanfer/squirtttv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SquirtTTV

GitHub release

Update 07.07.2024

Brand new version, comes with a fancy little UI to make setup easier. No more fiddling with yaml files 🎉 Almost the whole companion app has been rewritten. Its probably riddled with bugs. But it worked on a quick test.

What changed:

  • WebUI: Right click the tray icon and select settings to open the settings UI.
    • See on the web ui if your integrations are connected
  • Multiple devices:
    • You can now configure any number of devices and use them at the same time
    • You can use different devices for different alerts, multiple at the same time, or randomize between them

Update 21.04.2024

I ported this to run on an esp32 c2. Works great so far, but might not be compatible with other controllers.

I also added an "is this really a squirter?" detection to the mDNS auto discovery stuff. That means old squirters wont be detected unless you set "legacy: true" in the config file.

What is this

This lets you squirt someone with water when something happens on twitch.

Building the hardware

  1. Wire up an ESP8266 so that pin D6 triggers the water pistol

    • Start with a "Gloria AutoPump Mini" electronic water sprayer
    • Remove the original micro switch from the trigger
    • Replace the micro switch with a mosfet, or some other way for GPIO 12 to trigger the pump.
    • A neat solution is using a Wemos D1 mini and a mosfet shield for it
  2. Install the firmware on it using Arduino

  3. On the first start, the device will open up a wifi access point

  4. Use your phone to connect to the wifi AP, then give the device your home wifi credentials.After you save, it should reboot and be available on your network

  5. Go to http://<device-ip>/edit to upload the web ui from the firmware/ui/ folder

I'm sure this will work with other electric sprayers as well, but i only tested it with the Gloria AutoPump Mini.

Preparing the hardware

  1. Plug the USB device into power
  2. If you just built the device and followed the previous section, you can skip the following steps
  3. On the first start, the device will open up a wifi access point
  4. Use your phone to connect to the wifi AP, then give the device your home wifi credentials
  5. After you save, it should reboot and be available on your network

Preparing the companion

  1. Go here and download the latest companion.exe
  2. Run the executable once. It will create an example config file named config.example.yaml
  3. Copy config.example.yaml to config.yaml
  4. Customize the config to your liking (see the configuration reference for details)

⚠ Note that the configuration file uses YAML formatting. Verify the configuration dump after launching the app and if it doesn't match what you expect, check if you got your indentation right.

Usage

In this order:

  1. Put batteries in your sprayer
  2. Plug the USB device into power
  3. Start the companion app

The companion should automatically find your sprayers on the network. You can go to http://<your-sprayers-ip>/ to send test sprays to experiment with duration.

Configuration reference

cooldown: 5s
duration: 1s
squirters:
  - 192.168.1.200
twitch: tlanfer
streamlabs: eyJ0eX....
events:
  - type: bits
    min: 0
    max: 100
  - type: bits
    min: 200
    max: 250
  - type: dono
    min: 20
    max: 30
  - type: dono
    min: 100
  - type: subs
    min: 10
chat:
  - role: mod
    message: '!squirt'
  - user: mycoolbot
    message: '!squirt'
Key Description
cooldown Ignore events after a spray happened
duration How long to activate the sprayer. Around 500ms-1s seems to be alright.
squirters (optional) List of hosts where squirters are running. If none are given, the companion app will try to auto detect squirters on your network
twitch Watch this channel for cheers or subs. You can leave this empty if you dont want twitch integration. You need at least one of twitch/streamlabs.
streamlabs Connect to streamlabs for donations. You can leave this empty if you dont want to react to donations. Get your Socket API Token on streamlabs > API Tokens.
You need at least one of twitch/streamlabs.
events A list of events that can trigger the sprayer. If at least one matches, the sprayer activates.
events.type One of "bits", "dono", "subs".
events.min Minimum amount for this event. Defaults to 0 if left out.
events.max Maximum amount for this event. Can be left out, defaults to infinity.
chat A list of chat messages that can trigger the sprayer
chat.role (Optional) The minimum role a user must have. Values are pleb -> sub -> mod
chat.user (Optional) A specific user that this rule matches for
chat.message a text that must be in the message (partial match)