New app: AutoTorque

Discussion in 'App/Feature Suggestion' started by Daniel D, Feb 11, 2015.

  1. Evil Genius

    Evil Genius Member

    Joined:
    Mar 5, 2015
    Messages:
    111
    Likes Received:
    9
    Interesting @MikeW could you show us how you did that?

    @joaomgcd wouldn't auto notification be able to do this?
     
  2. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
  3. Evil Genius

    Evil Genius Member

    Joined:
    Mar 5, 2015
    Messages:
    111
    Likes Received:
    9
  4. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    I'm not quite sure how I could do an effective video of this. It really just an autonomous looping task that doesn't do anything most of the time and there's no indication that it's even running until the Estimated Distance to Empty value from Torque drops below 60 miles.

    But if there's something specific you want to see, or a concept that I could explain better, I'll be happy to try. Might give me a chance to try out Lollipop's screen recording capability.
     
  5. Evil Genius

    Evil Genius Member

    Joined:
    Mar 5, 2015
    Messages:
    111
    Likes Received:
    9
    That would be great. I would love for my car to tell me the status of certain things like gas, speed, etc. If you do make a video, could you break down exactly how you did this in Tasker. Sometimes people make videos and don't explain things very much.

    I think integration with the Waze app would be cool. With Waze, you are not required to have an OBD dongle. In that case, being able to tell Tasker by voice to report an accident or a police officer in a speed trap would be most excellent.
     
  6. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    I'll see what I can do. Give me a few days.

    Tasker isn't necessary for giving voice commands to Waze; it has its own set built right in.
    Here's the reference guide for that:
    https://support.google.com/waze/answer/6081262

    You're still going to need an OBDII dongle and another program such as Torque in order to get info from your car. Waze by itself doesn't support that. There's been some discussion about it, but nothing has been implemented yet.
     
  7. Evil Genius

    Evil Genius Member

    Joined:
    Mar 5, 2015
    Messages:
    111
    Likes Received:
    9
    I actually knew that. I have an Automatic OBD dongle. I do not know if that will work (doubt it) but if you break it down on how to do this I will most definitely go out and buy a new one.
     
  8. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Sure. I can show you how I did with Torque. It's more of a set up procedure with that app rather than anything fancy with Tasker.

    Hadn't seen the Automatic before, but the specs look like it's a pretty standard OBDII/Bluetooth dongle. Torque should work with it. There's a free version you could test with if you wanted to.
     
  9. Evil Genius

    Evil Genius Member

    Joined:
    Mar 5, 2015
    Messages:
    111
    Likes Received:
    9
    Will do, I will test it later on today.
     
  10. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Sorry this took so long, but I had a few things that I had to take care of first.

    Here's a video that shows how to get Torque data into Tasker:


    Hope it's helpful.
     
  11. Evil Genius

    Evil Genius Member

    Joined:
    Mar 5, 2015
    Messages:
    111
    Likes Received:
    9
    Mike thank you. You are a fantastic teacher. You should consider making more Tasker tutorials.

    I ultimately want a say action to tell me if the gas level goes under a certain percentage, not miles to empty. Also, can you tell me about your loop you mentioned? You can just write it here, no need to make another video unless you want. Thank you so much.
     
  12. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    Thanks for the kind words. I enjoyed putting that together and might do some more if I think of anything worth sharing.

    If you want fuel level instead of range, Torque has a couple of other values that you could log instead of the "Distance to Empty (Estimated)" that I used in my example. If you're lucky, your ECU will report fuel level directly with the "Fuel Level (From Engine ECU)" PID. If not, you can still get a pretty close estimate by logging "Fuel Remaining (Calculated from Vehicle Profile)". That's what I have to do with my Z3 and I've found it to be quite accurate as long as you set the the weight and and fuel capacity correctly in Torque's vehicle profile. Both of those values are going to be in percentages.

    Assuming that you replace the estimated distance to empty with one of those, you could use a loop something like this:

    TorqueExample (435)
    A1: Run Shell [ Command:/data/data/burrows.apps.busybox/app_busybox/tail -1 /storage/emulated/0/torqueLogs/trackLog.csv Timeout (Seconds):0 Use Root:Off Store Output In:%obd_log Store Errors In: Store Result In: Continue Task After Error:On ]
    A2: Variable Split [ Name:%obd_log Splitter:, Delete Base:Off ]
    A3: Say [ Text:Your fuel level is at %obd_log6 percent. Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] [If [ %obd_log6 < 25 ]
    A4: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
    A5: Goto [ Type:Action Number Number:1 Label: ]

    It just reads the sixth variable in the Torque log file and uses it as part of the Say action. It then waits for one minute and loops back to the top. You just need to kick it off when you get in the car and kill it when you leave. The say action will only execute if the value is less than 25%.

    One thing, though: This will speak up every minute and give you an update (after it reaches the threshold). If you find that annoying, you need to add some logic to make it speak only once, or maybe a couple of times before shutting up.

    Hope that helps.
     
    Last edited: Nov 10, 2015
  13. Evil Genius

    Evil Genius Member

    Joined:
    Mar 5, 2015
    Messages:
    111
    Likes Received:
    9
    @MikeW what if you want to monitor more than one thing besides the gas? Ultimately, I want Tasker to tell me if I have less than 15% gas. I also want it to tell me upon command. However, I also want it to tell me to slow down if I go over 80 MPH.

    This is just one example. I just wanna learn how to do ore than one thing at a time.
     
  14. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    All you need to do is add the PID to log within Torque, the way I added the Distance to Empty value in the first part of my video. You can add as many there as you like. Then, in Tasker, you use the same splitting routine i showed; you don't have to change anything at all because the new value will be split out automatically. You then just access it with the next highest number in the pseudo array. In my video, I was looking at the sixth entry in the Torque log line, or %obd_log6. If you add another entry in Torque it would end up in %obd_log7. The next one would be %obd_log8, and so on.

    Hope that helps.
     
  15. Evil Genius

    Evil Genius Member

    Joined:
    Mar 5, 2015
    Messages:
    111
    Likes Received:
    9
    @MikeW is there a way we can use this same method for traffic updates or navigation from Waze or perhaps Google Maps?
     
  16. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    I don't normally use Waze for navigation, so I can't speak to that. For Google Maps, however, you'd probably be better off using AutoNotification to scrape that info from the navigation notification. I do something similar to display ETA information on the main screen of my Digital Dash.

    The basic description of what I'm doing is here:
    http://mikesgeneralblog.blogspot.com/2015/10/navigation-eta-information-revisited.html

    You'd need to modify that to grab what you want and if you are looking to get the turn-by-turn info you'd want to remove the cooldown period I put on the profile so that you get more frequent updates.

    There is a Google Maps Routing API that you can call that will return either a json or xml file containing turn-by-turn instructions for an entire trip, but it isn't designed for real-time work. You're better off leveraging what Google Maps is already pulling in and putting on the notification.
     
  17. Evil Genius

    Evil Genius Member

    Joined:
    Mar 5, 2015
    Messages:
    111
    Likes Received:
    9
    Im not very good at scraping data with AN. I do have it though. I would pefer Google Maps over Waze anyays.

    No turn-by-turn that is fine, but what about traffic? Heavy traffic or accidents? @MikeW
     
  18. MikeW

    MikeW Member

    Joined:
    Feb 16, 2015
    Messages:
    113
    Likes Received:
    9
    If it gets reported in the Notification (and I believe it does) you should be able to monitor for it. One way would be to set an AN profile with a filter based on certain keywords that would appear when Maps puts up that information. For example, if it were to start each traffic warning with "Traffic Update..." you could filter for that in a profile.

    I haven't looked at doing this, so I can't provide specifics, but that idea should work.
     
  19. IVB

    IVB New Member

    Joined:
    Mar 28, 2016
    Messages:
    2
    Likes Received:
    0
    Outstanding tutorial MikeW, thanks for that. FYI in case anyone is trying this on a Nexus 6P, i'm doing it now, after tons of stupid mistakes & struggling I found that this tail command works:

    (in place of MikeW's first command, within the RunShell):
    tail /sdcard/torqueLogs/trackLog.csv -n 1

    BTW one other thing I kept screwing up was that SwiftKey kept inserting random spaces. IE, -n would be - n . Took forever to notice those.

    I'm on to the next step now, hopefully that works, but wanted to post that bit as it just took me 3 hours to work through just that bit.
     
  20. IVB

    IVB New Member

    Joined:
    Mar 28, 2016
    Messages:
    2
    Likes Received:
    0
    Schawing, I now have access to Fuel remaining (plus whatever else) in my home automation system! It'll be part of the daily TTS over in-ceiling speakers (which is fired off from Tasker after I dismiss Gentle Alarm). I'll see how to pull in Waze info so I can see traffic (for me), train (for wife). Thanks MikeW!
     

Share This Page