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

SmartThings Button not a Switch?

General Discussion
2
5
315
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.
  • K
    KenJ
    last edited by Jan 24, 2021, 5:45 PM

    Is there a way to create a SmartThings Button, not a switch?

    I am using this for a Whole House Audio system the Power on works for Switching the zone on/off, but I am also using to increase/decrease the volume and just need a button.

    R 1 Reply Last reply Jan 25, 2021, 12:17 AM Reply Quote 0
    • R
      Russ @KenJ
      last edited by Russ Jan 25, 2021, 12:17 AM Jan 25, 2021, 12:17 AM

      @KenJ, if you remove the // from the off() line, then every time you tap the button it will turn itself back off, so it will act like a button instead of an on/off switch.

      def on() {
      	log.debug "Executing 'on'"
      	sendEvent(name:"switch",value:on)
      	parent.on(this)
      
          // off()
      }
      

      This is the line in the device code:
      https://github.com/rvmey/SmartThingsPublic/blob/06ee7ca6523d948c814b8f3f070810eef3b29072/devicetypes/vandermeyconsulting/triggercmd-switch.src/triggercmd-switch.groovy#L63

      The problem might be that this change will make all of the TRIGGERcmd SmartThings switches act this way. I'm not sure if that's what you want.

      Russell VanderMey

      K 1 Reply Last reply Jan 25, 2021, 1:34 PM Reply Quote 0
      • K
        KenJ @Russ
        last edited by KenJ Jan 25, 2021, 2:46 PM Jan 25, 2021, 1:34 PM

        @Russ Thanks, will remove the on/off function? So does it effect everything.

        R 1 Reply Last reply Jan 25, 2021, 11:41 PM Reply Quote 0
        • R
          Russ @KenJ
          last edited by Jan 25, 2021, 11:41 PM

          @KenJ, yes, it does affect everything, so it might not be what you want.

          Russell VanderMey

          K 1 Reply Last reply Jan 26, 2021, 1:23 AM Reply Quote 0
          • K
            KenJ @Russ
            last edited by Jan 26, 2021, 1:23 AM

            @Russ that's what I thought, it's working turning off/on so I will not change it. Thanks

            1 Reply Last reply Reply Quote 0
            2 out of 5
            • First post
              2/5
              Last post