TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Enable or disable ads with Pi-hole on a Raspberry Pi

    Scheduled Pinned Locked Moved Raspberry Pi
    8 Posts 3 Posters 3.2k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RussR Offline
      Russ
      last edited by Russ

      This video shows how you can say, Alexa, turn off ads or Hey Google, turn on ads to toggle ads on or off on your network.

      Use this article to setup your Raspberry Pi if you haven't already.

      Use the Smart Home Alexa skill or Google Assistant action.

      Use a line like this in your /root/.TRIGGERcmdData/commands.json:

      {"trigger":"PiHole","command":"/usr/local/bin/pihole_on_off.sh","ground":"background","voice":"ads","allowParams":"true"},
      

      This is the bash script I wrote to /usr/local/bin/pihole_on_off.sh and made it executable with chmod +x /usr/local/bin/pihole_on_off.sh

      #!/bin/bash
      case "$1" in
        "off")
          pihole enable
          ;;
        "on")
          pihole disable
          ;;
        *)
          echo "Run this with on or off as the parameter."
          exit 1
          ;;
      esac
      

      This page gives a list of pihole commands:|
      https://docs.pi-hole.net/core/pihole-command/

      Russell VanderMey

      1 Reply Last reply Reply Quote 0
      • CutezatorC Offline
        Cutezator
        last edited by

        Hello.
        Nice hack 🙂
        I think you inverted the commands, Off should be "pihole disable".

        RussR 1 Reply Last reply Reply Quote 0
        • RussR Offline
          Russ @Cutezator
          last edited by Russ

          @Cutezator, I kept getting confused but I think I got it right because I'm saying "turn off ads" not "turn off pi hole". Turning off ads means enabling pi hole.

          Russell VanderMey

          1 Reply Last reply Reply Quote 0
          • Furkan CevikF Offline
            Furkan Cevik
            last edited by

            This post is deleted!
            Furkan CevikF 1 Reply Last reply Reply Quote 0
            • Furkan CevikF Offline
              Furkan Cevik @Furkan Cevik
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • Furkan CevikF Offline
                Furkan Cevik
                last edited by

                Hey Russ, so i set up everything like u said.

                I can run the script like u with /usr/local/bin/pihole_on_off.sh on/off.

                I also can enable/disable it on my trigger cmd command management.

                But how do i do with with my voice? can i change what i need to say? Im confused here lol.

                RussR 1 Reply Last reply Reply Quote 0
                • RussR Offline
                  Russ @Furkan Cevik
                  last edited by Russ

                  @Furkan-Cevik, good question. I should have covered this in the video. You need to enable one of these:

                  • "TRIGGERcmd Smart Home" Alexa skill
                  • "TRIGGERcmd Smart Home" Google Assistant action

                  Then your commands become Smart Home switches and you can say, Alexa (or Hey Google), turn on/off ads.

                  Your command will run on your Raspberry Pi with on or off as the parameter.

                  Russell VanderMey

                  Furkan CevikF 1 Reply Last reply Reply Quote 0
                  • Furkan CevikF Offline
                    Furkan Cevik @Russ
                    last edited by

                    @Russ Works now, thanks!

                    1 Reply Last reply Reply Quote 0
                    • tuicemenT tuicemen moved this topic from Instructions on
                    • T TI_Gaming_TV referenced this topic on

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • First post
                      Last post