AutoTools Toggle alert based on icon?

Discussion in 'AutoApps' started by damavox, Dec 17, 2018.

  1. damavox

    damavox New Member

    Joined:
    Dec 17, 2018
    Messages:
    2
    Likes Received:
    0
    https://forum.joaoapps.com/index.ph...een-2-icons-with-autotools-text-toggling.190/

    I used the tutorial above to toggle a widget that Connects to raspberry pi via ssh and runs a script that tells a 433mhz controlled relay to turn on or off. (Remote Light socket).

    What I want to add is a different Alert or maybe even a toast notification that will notify me that the light is either being turned on or off.

    Since there is no way for the remote Light socket to talk back to the pi or my phone this will have to be done purely based on the widget.

    So what I need help doing (using the tutorital linked above) is when the widget icon is toggled to the green icon it gives an alert and when the widget icon is toggled back to the red arrow icon, it gives a different alert.

    I.E.
    Red arrow toggled to Green arrow > Alert: "Light on."
    Green arrow toggled to Red arrow > Alert: "Light Off"

    I've played around and did some research trying to get it working but have came up empty.

    Any help would be greatly appreciated!!!
     
    Last edited: Dec 18, 2018
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    In step 2, at the end, check the path of the icon in %Icon. You can base the alert on what that contains :)
     
  3. damavox

    damavox New Member

    Joined:
    Dec 17, 2018
    Messages:
    2
    Likes Received:
    0
    Wow seems so obvious now that you've stated it. Took me a few minutes to realize I had to achieve this by creating if statements within the Alert but I figured it out within 5 minutes of trail and error.
    Thanks again!
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Awesome :) Glad you got it!
     

Share This Page