Join Setting a Variable On a Remote Device

Use Join to set any global (Uppercase) variable on a remote device

  1. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    joaomgcd submitted a new AutoApps project:

    Setting a Variable On a Remote Device - Use Join to set any global (Uppercase) variable on a remote device

    Read more about this project...
     
    wldcrd likes this.
  2. Elizabeth Ellis

    Elizabeth Ellis Member

    Joined:
    Nov 3, 2016
    Messages:
    34
    Likes Received:
    5
    This seems like a useful profile for what I'm trying to do, but I'm not sure. When would this be a good idea to use? like why would you want to set a remote variable? (This is a serious question, :) I'm sure you'd want to...I am just seriously wondering what are some good ways to put this to use.) Right now I'm trying to input text spoken aloud by AV using autoremote and this seems like a good way to do it maybe...
     
  3. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    For example, you may want to alert your spouse that you're home by setting %SpouseHome to 1 on his/her device which will then trigger a profile on their device. :) There are many situations where this can be used.
     
  4. Elizabeth Ellis

    Elizabeth Ellis Member

    Joined:
    Nov 3, 2016
    Messages:
    34
    Likes Received:
    5
    okay. thanks
     
  5. amicus

    amicus New Member

    Joined:
    Sep 11, 2016
    Messages:
    8
    Likes Received:
    0
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Sorry, but that doesn't actually tell me what the error is. Can you please enable the "Continue Task on Error" option in the action that's giving you the error and on the next step use a flash action with the text %errmsg?
    Thanks in advance
     
  7. mtneerndixie

    mtneerndixie New Member

    Joined:
    Feb 24, 2015
    Messages:
    19
    Likes Received:
    0
    Could this be used to transfer the value of a var from one task to another on the same device? And, can I set multiple vars from one Join Push by seperating them by ","

    For instance, my AN buttons have the value of a global var I create so that the button handler profile I have to catch it will have the correct value of the %anbuttonXaction, etc. If I put these setvar commands in the when received "action" field of an AN, would it set the global vars that my buttons would then trigger when pushed? Seems like it would:

    Ex: Action when AN Received
    setvar=:=Button1=:=%anbutton1action,setvar=:=Button2=:=%anbutton2action........
    and so on.

    While I'm talking about it, could I also use the JSONBin AW service to do this also?

    Thanks!
     
    Last edited: May 25, 2017
  8. duckredbeard

    duckredbeard New Member

    Joined:
    Mar 9, 2018
    Messages:
    16
    Likes Received:
    0
    I have found a great use for this project. I have my kids' tablets send their variables to my phone whenever they:
    1. Turn on their display
    2. Turn off their display
    3. Begin charging their tablets
    4. End charging their tablets.
    I then use Minimalistic Text widgets to display the information (variables) sent. The widget also includes a time/date stamp to show when the last change was made. At a glance, I can see if they are on their tablets and if they are being charged. If I tap on the widget, it sends an AutoRemote Message that initiates a "report" back to my device. I then get an AutoRemote Notification with more info, including what application they are using and their battery level. (A google sheet is also maintaining a log of display on/off, charge start/end, applications opened/closed, applications installed, all with time and date stamps.)

    Take a look at the screenshot, all are the Minimalistic Text widgets, most are populated with Tasker variables and most are also shortcuts to Tasker tasks. The kids' tablets are the dark pink and blue boxes below the alarm info. Screenshot_20180718-185516.jpg
     
  9. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Very cool :)
     
  10. Greg W

    Greg W New Member

    Joined:
    Dec 3, 2018
    Messages:
    2
    Likes Received:
    0
    Great stuff.

    Is there a way to set the variable to a sensor value or an attribute value from Home Assistant?

    I can get Home Assistant to send me a message through Join with those values, but I cant get it to send the value as a Tasker variable correctly.

    For example, Home Assistant can send my phone a message with the "notify.phones" service, and the following in the JSON service data:
    message: Family room receiver is set to {{ states('sensor.family_room_receiver_source') }}​
    I get the following Join message on my phone, "Family room receiver is set to Sonos." Which is perfect.

    But if I do the same with the "joaoapps_join.android_send_tasker" service, I only get the string, not the value. This is what I'm putting:
    command: setvar=:=FrRec=:={{ states('sensor.family_room_receiver_source') }}​
    The variable FrRec in Tasker will change to "{{ states('sensor.family_room_receiver_source') }}," not "Sonos" like it should.

    Any suggestions?
     
  11. GeneMar

    GeneMar New Member

    Joined:
    Oct 25, 2018
    Messages:
    7
    Likes Received:
    0
    Agreed. In Home Assistant, I'd like to use notify.join_phone to just say something on my phone (without a notification).
    If notify. will always generate a notification, I could use:
    command: HASS=:=say=:=Uptime is at {{ sensor.uptime }}

    But, it appears that template-rendering is only supported in the message: field of notify.
    If so, any opportunity to enhance?:rolleyes:

    Thanks!
     
  12. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Sorry, unfortunately I didn't develop that add-on myself. Maybe you can try asking their developers?
     

Share This Page