Announcement

Collapse
No announcement yet.

Generic commands for all activities

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Generic commands for all activities

    Sorry if this has been asked before or if there is a feature request thread.

    I'm trying to create Alexa driven events like "Play" for voice control.

    When I press "Play" on my handheld remote the hub sends a play command to whatever activity(devices) is currently active..DVR, Roku...etc

    To create an event "Play" using the plug-in I must first find the current activity and then send the "play" command to the correct AV device (based on activity).

    So that results in a set of if/then events to check each activity. e.g. If you want to control 4 command and have 3 activities you end up making 12 events

    It would nice if the plug-in could leverage the handheld remote's interface to the hub and issue a generic "play" command and let the hub "do the right thing".

    The Alexa Play event would then be: if triggered then send generic Play cmd.

    This may be way too hard to implement...but I thought I'd ask...

    #2
    So, interestingly enough, I was thinking of a way to do this for Volume control (for voice control via Google Home in my case). The thing with the remote is that is controlled via the hub and the plugin has no interaction or availability to know how the remote is programmed for the current activity.

    The best way for me to handle this is to basically have you reprogram again for the plugin. My initial thinking i that I could create a "control" device where you would add your own buttons to, say "Play" and then you could assign what that button does for each activity. I'm not sure it would be any better than using events, but it might be cleaner to set up. Let me think about it and get back to you.

    (if you think i've forgotten about it, don't hesitate to post back saying "WHAT THE HELL IS UP!?! GET BACK TO ME!" )

    Comment


      #3
      I know I just posted, but now that I think about it more, I think this is a great idea. For instance you want to pause whatever is on the TV (or mute it) no matter what activity is on.

      I will work on an initial working model and push it out in the beta stream for people to test out.

      Comment


        #4
        You could replicate this by linking a virtual device to each activity, so when you say “play TV” or “Pause” you trigger several events each one pressing the play or pause button for each activity you have, but adding a condition to each event only if the virtual device corresponding to each activity is on. That way you would only be sending one command for what’s playing on your TV.
        Makes sense?

        Comment


          #5
          So here were my thoughts:

          1) Add an option (per hub) to add a new type of device called something like a "Activity Remote Device" or something like that.

          2) Once this was turned on and the device created for any given hub, in the config there would be a new tab for managing it.

          3) The user would go to this tab and select the "Hub" they want to work with and start to add "commands". For this example we will use "Play"

          4) The plugin would add a new status/command to the device and assign it a value. In the background the plug-in would create settings that default all activities to "Do nothing".

          5) The user could then select an Activity (for example lets say "Watch Roku") and then be given a list of Devices

          6) For this example we will select the Roku Device and then given a list of Commands for that device

          7) The user would select "Play"


          Now, if you wanted to set up another activity for that same button you just repeat steps 5-7 for each activity. The reason for defaulting all the activities to "Do nothing" to start is so that you can do it one at a time.

          Now, my approach above basically puts all the remote commands on 1 virtual device instead of 1 virtual device for each command. I see some pros and cons:

          Pros:
          Less devices are created in HomeSeer.

          Cons:
          This would basically prevent Google Home or Alexa voice control.

          (ok only 1 pro and 1 con to start).

          The con I don't think is that big of a deal though unless you are willing to say "Hey Google/Alexa, turn on Play" which makes no sense semantically. Also in a house like mine where I have 4 hubs, I would have to say the room too "Hey Google/Alexa, Turn on the Living Room Play"

          I have an idea for handling volume via voice control, but I'm still working out the details in my head and i'm not sure it would even work for the reasons above. If I can't make it work semantically and have it flow, I don't want to do it.

          Comment


            #6
            Frank,

            I like this approach, it's much cleaner than a set of events or virtual devices.

            The con I don't think is that big of a deal though unless you are willing to say "Hey Google/Alexa, turn on Play" which makes no sense semantically.
            For Alexa I think you can get around this con with Alexa routines. They take on the format of "Alexa Bedtime", no on/off is needed. But there may be a collision with the built in Play, Pause...etc commands; this would require some testing.

            Also in a house like mine where I have 4 hubs, I would have to say the room too "Hey Google/Alexa, Turn on the Living Room Play"
            I agree, I have 7 hubs and 5 echos/dots. It would be nice if Alexa was more room aware for all smart devices. Alexa groups help with associating HS lights devices with a specific room. I don't think groups will help with this problem.

            Let me know if you move forward, I'll be happy to be a beta tester.

            Comment


              #7
              I'm gonna start this tonight.

              I have a question I want to ask though as I work on it:

              My initial idea was to create 1 device per hub were multiple commands would be added. This just won't work with Voice Control like Google and Alexa devices.

              Would it be better to allow the user to create multiple of these control devices per hub and that way you can add only 1 command per device and multiple devices or create 1 device with multiple commands?

              Comment


                #8
                Originally posted by sirmeili View Post
                Would it be better to allow the user to create multiple of these control devices per hub and that way you can add only 1 command per device and multiple devices or create 1 device with multiple commands?
                I'm sorry but I'm not following your description of the two options you're proposing. Can you give me a simple example of both (or diagram).

                I'm also thinking about the the format of the Alexa phrase to control these special devies...it might be awkward...

                Comment


                  #9
                  Ok: Option 1:

                  each hub can have one and only 1 "Remote" device (this would be limited by the plugin). This "Remote device can have any number of commands that can be mapped by activity.

                  I.E. Living room Hub has 1 Remote activity with the following commands:
                  Play
                  Stop
                  Volume Up
                  Volume Down

                  Option 2:
                  Each hub can have any number of "Remote" devices (1-X). Each Remote device can have any number of commands that can be mapped by activity.

                  I.E. Living room hub has 3 "Remote" Devices
                  Device 1: Play
                  Device 2: Volume Up and Volume Down
                  Device 3: Mute

                  the benefit to this approach is that you could make each one a Voice Control device (I could even have an option to make it voice controlled by the plugin to remove the need for events).

                  For instance "Play" on Device one could be used like "Alexa, turn the living room play on", which as you've said, you can use Alexa routines to make more semantically appropriate.

                  In this example Device 2 wouldn't work great for Voice control, but I wanted to show an example where one of the devcies could have 2 commands.



                  Now, option 2 might react slower by just a little bit and obviously coding the "settings" for it would be a bit more of a hassle, but It's more than doable. I think the config screens for Option 2 might end up being more confusing (harder to get intuitive).

                  I think I might start with Option 1 for testing purposes but code with Option 2 in mind.

                  Comment


                    #10
                    I've taken some time today from the Florida Heat and worked on this. I have Option 2 working, but I'm still working on the Configuration screens. I'm trying to find the best way to handle this and make it user friendly.

                    I currently have a "Virtual" remote with a "Volume Up" button that triggers different devices (Tv and Receiver) depending on the activity.

                    I am a bit worried about the size of the JSON settings file size for the hubs (I'm storing this in that file). I may split this out into it's own settings file to keep the settings files low. Since you have 7 hubs, when I release the beta we can see if that's really necessary or not.


                    Quick question (for any that read this): Is there any benefit to configuring the "virtual remote" buttons to do things when the hub is in the 'PowerOff" mode/activity? I was thinking of hiding that activity in the configuration, but before doing so wanted to ask.
                    Attached Files

                    Comment


                      #11
                      One more question,

                      My hopes were to allow the user to easily (drag and drop) the order and layout of the buttons on teh device, but I Don't think this will be possible as HS doesn't expose a way for me to change the position after the statuses are added.

                      So, I was thinking would anyone object to just making it a dropdown like the "device" devices?

                      *I just thought that maybe I could all the user to reorder and I could just delete and re-add all the statuses. I"ll have to test out and see if it works.

                      Comment


                        #12
                        Originally posted by sirmeili View Post
                        the benefit to this approach is that you could make each one a Voice Control device (I could even have an option to make it voice controlled by the plugin to remove the need for events).

                        For instance "Play" on Device one could be used like "Alexa, turn the living room play on", which as you've said, you can use Alexa routines to make more semantically appropriate.

                        In this example Device 2 wouldn't work great for Voice control, but I wanted to show an example where one of the devcies could have 2 commands.



                        Now, option 2 might react slower by just a little bit and obviously coding the "settings" for it would be a bit more of a hassle, but It's more than doable. I think the config screens for Option 2 might end up being more confusing (harder to get intuitive).

                        I think I might start with Option 1 for testing purposes but code with Option 2 in mind.
                        I understand your options now, thanks. I agree option #2 is Alexa friendly. Also agree a device with two values "vol up" and "vol down" will not work for alexa...must be on/off only.

                        Comment


                          #13
                          Originally posted by sirmeili View Post
                          Quick question (for any that read this): Is there any benefit to configuring the "virtual remote" buttons to do things when the hub is in the 'PowerOff" mode/activity? I was thinking of hiding that activity in the configuration, but before doing so wanted to ask.
                          Wow...great progress!

                          I see no value in doing anything in "pwr off" state; given that "power on" is driven from by an activity selection; at which time the "remote device" is usable.

                          Side note: I assume your prototype device with "vol up" and "vol dwn" is NOT for Alexa use...let me know if I missed something.

                          Comment


                            #14
                            Originally posted by sirmeili View Post
                            One more question,

                            My hopes were to allow the user to easily (drag and drop) the order and layout of the buttons on teh device, but I Don't think this will be possible as HS doesn't expose a way for me to change the position after the statuses are added.

                            So, I was thinking would anyone object to just making it a dropdown like the "device" devices?

                            *I just thought that maybe I could all the user to reorder and I could just delete and re-add all the statuses. I"ll have to test out and see if it works.
                            Sorry..are you talking about the layout of the Device page or the New Config page for the "Remote device"?

                            In either case, I would start with dropdown and get fancy later with drag and drop...

                            Comment


                              #15
                              Originally posted by krh1009 View Post
                              Wow...great progress!

                              I see no value in doing anything in "pwr off" state; given that "power on" is driven from by an activity selection; at which time the "remote device" is usable.

                              Side note: I assume your prototype device with "vol up" and "vol dwn" is NOT for Alexa use...let me know if I missed something.
                              Well, with the harmony hubs you can still control devices even if the hub's activity is "PowerOff" (you can't use their Remotes like this, but on the Phone apps, you can just control devices regardless if there is an active activity or not). My idea was that someone might have a need for this even though I can't think of one.

                              As to your side note, you are correct, this device can't be used for voice control unless you set one of the statuses to "control use On"* and one to "Control use Off". In this cause you could say "Alexa, turn living room volume on" and it would turn the volume up by 1 and saying "Alexa turn Living room volume off" would turn the volume down by one. I imagine, you might be able to even incorporate dimming to do multiple volume up/down, but I have to look into this and test out the best way to do it.

                              For me, what I would do is set up a living room volume remote using this. Call it "Living room Volume" and create 3-4 buttons:

                              Volume Up
                              Volume Down
                              Mute
                              and optionally Mute off

                              Mute I would set to "Control Use: off" and if I had "Mute off" I would set it to "Control Use: On", however you could just set Volume Up or Down to be the Control Use: On as most devices turn the mute off if the volume up/down button is pressed.

                              So if you set up this device you could say "Alexa, turn the Living room Volume Off" and it would send Mute for the activity. Alternatively you could say "Alexa, turn the living room Volume On" and it would un-mute (either by pressing mute again or turning the volume up or down).

                              *Control Use is a setting on the status graphics page. I think I can set this when I create a status, but not "update" it (I guess HS doesn't think devs would want to update these values after the fact). I have an idea to get around this by deleting all the statuses and then recreating them with correct values, but I need to test it all out.

                              Comment

                              Working...
                              X