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

    Google assistant say the Raspberry Pi temperature

    Raspberry Pi
    3
    6
    991
    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.
    • H
      hm123
      last edited by

      I put my Rasberry Pi in a handmade box and I am concerned about it's temperature. So I created this trigger to be able to check the Pi temperature using google assistant.

      {"trigger":"Pi temperature","command":"python3 /home/pi/temperature.py","ground":"background","voice":"system temperature","voiceReply":"The pi temperature is {{result}} degrees","allowParams": "false"}
      

      The Python3 script

      #!/usr/bin/env python3
      
      import subprocess
      import os
      
      reply = str(subprocess.check_output(['vcgencmd', 'measure_temp']))
      result = reply[reply.find('=') + 1: reply.find('C')- 1]
      os.system('~/.TRIGGERcmdData/sendresult.sh ' + result)
      
      RussR tuicemenT 2 Replies Last reply Reply Quote 1
      • RussR
        Russ @hm123
        last edited by

        @hm123, that is awesome. Thanks for sharing it.

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • tuicemenT
          tuicemen @hm123
          last edited by

          @hm123, I love this idea!
          I have a pi zero with extra USB hat mounted inside a X10 CM15 controller.zwave_cm15.jpg

          I have a script to display several system stats (including CPU temperature) in my HomeGenie server.
          RPi Tools.png
          Although this has been running fine, monitoring temperature for this PI via voice would be a welcome addition.

          I'm having a problem testing this and that may be due to the fact that I've not subscribed yet. perhaps @Russ could confirm.
          I don't get a reply back from my Google mini so I assume it counts as two calls in under a min.
          Would this work with Alexa as well?

          1 Reply Last reply Reply Quote 0
          • tuicemenT
            tuicemen
            last edited by tuicemen

            I think figured it out was trying with the smarthome skill verses Trigger command. Glad it works with Alexa too. To bad all TRIGGERcmd actions couldn't all be combined into 1 skill.

            RussR 1 Reply Last reply Reply Quote 0
            • tuicemenT tuicemen referenced this topic on
            • tuicemenT tuicemen referenced this topic on
            • tuicemenT tuicemen referenced this topic on
            • RussR
              Russ @tuicemen
              last edited by Russ

              @tuicemen, I agree. The TRIGGERcmd Smart Home skill recognizes your words the best, but it doesn't have this feature to have your Alexa say things that your command outputs.

              Your question gave me an idea of how I might be able to make that work though. I'm thinking I could do something similar to what Voice Monkey did.

              In the meantime you could use Voice Monkey. You can call their API with a curl command and provide what you want your Alexa to say, like this:

              curl "https://api.voicemonkey.io/trigger?access_token=(voice_monkey_token)&monkey=(your_monkey_name)&announcement=The temp is 60 degrees"
              

              Russell VanderMey

              tuicemenT 1 Reply Last reply Reply Quote 0
              • tuicemenT
                tuicemen @Russ
                last edited by

                @russ thanks for that suggestion though I may wait to see what you come up with.
                The TRIGGERcmd Command does work, even if a bit clunky but maybe I'm just not using it correctly.
                In any case I don't plan to use this temperature call often as I do have the read out in HomeGenie.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post