Page 10 of 11

Re: Automatic OBD-II Indigo Plugin

PostPosted: Fri Mar 02, 2018 10:55 am
by dgarozzo
That sounds like a great idea! You should be able to see the json responses in the device variables, right? Do you need me to expose them some other way?


Sent from my iPhone using Tapatalk

Re: Automatic OBD-II Indigo Plugin

PostPosted: Fri Mar 02, 2018 11:01 am
by DVDDave
dgarozzo wrote:
I will double check my directions on the required Google API access. Very sorry about that!


Sent from my iPhone using Tapatalk

Thanks for the great plugin! Glad we got this figured out. :D

Re: Automatic OBD-II Indigo Plugin

PostPosted: Fri Mar 02, 2018 11:04 am
by rapamatic
dgarozzo wrote:
That sounds like a great idea! You should be able to see the json responses in the device variables, right? Do you need me to expose them some other way?


I think it would be a lot easier to setup indigo triggers if the fuel level (or whatever we are interested in, maybe battery voltage too) is directly exposed as a device state (just like location, ETA, or currentMilesFromHome)...


Sent from my iPad using Tapatalk

Re: Automatic OBD-II Indigo Plugin

PostPosted: Mon Mar 05, 2018 6:51 pm
by dgarozzo
I currently use the following script as an Server Action Execute Script for a trigger of Type Automatic OBD-II Event, Event: Approaching Home.

Code: Select all
car = indigo.devices["Automatic OBD Audi"]
indigo.server.speak("The car is almost home at " + car.states["location"])


One way you can create a trigger based on your fuel would be to create a Trigger on Device State Changed for your device. Choose the State: vehicle, Has Any Change. Then in Condition, you could script something like:

Code: Select all
import json
car = indigo.devices["Automatic OBD Honda"]
myVechicleJson = json.loads(car.states["vehicle"])
indigo.server.log(myVehicleJson["fuel_level_percent"])

# code to return true if fuel level is below 10%



Except, ugh, it looks like the Condition has to be Applescript and not Python??!?!?!?!! So, you'd have to do that in the Action instead of the Condition (or figure out the Applescript equivalent), and then code your action in Python. That kinda stinks.

I'll work on breaking out the useful Vehicle attributes into States.

Re: Automatic OBD-II Indigo Plugin

PostPosted: Tue Mar 06, 2018 7:00 pm
by dgarozzo
v1.0.5 - Plugin has been updated to include fuelLevelPercent, batteryVoltage, and activeDtcs as States for the Device.

Re: Automatic OBD-II Indigo Plugin

PostPosted: Thu Mar 08, 2018 9:25 am
by rapamatic
dgarozzo wrote:
v1.0.5 - Plugin has been updated to include fuelLevelPercent, batteryVoltage, and activeDtcs as States for the Device.


Sweet, this is perfect - thanks man!

By the way, I'm getting a fair amount of exception notices in my log - I assume this is just some intermittent bad data coming in from automatic, but any way to not show these messages?

Messages like this:

Code: Select all
Mar 8, 2018, 8:17:21 AM    Automatic OBD-II                FYI - Exception caught getting vehicle info: state value type must be bool, int, real, or string


Thanks
-Ray


Sent from my iPad using Tapatalk

Re: Automatic OBD-II Indigo Plugin

PostPosted: Thu Mar 08, 2018 3:28 pm
by dgarozzo
Shouldn’t be any exceptions. I’ll look into it.


rapamatic wrote:
dgarozzo wrote:
v1.0.5 - Plugin has been updated to include fuelLevelPercent, batteryVoltage, and activeDtcs as States for the Device.


Sweet, this is perfect - thanks man!

By the way, I'm getting a fair amount of exception notices in my log - I assume this is just some intermittent bad data coming in from automatic, but any way to not show these messages?

Messages like this:

Code: Select all
Mar 8, 2018, 8:17:21 AM    Automatic OBD-II                FYI - Exception caught getting vehicle info: state value type must be bool, int, real, or string


Thanks
-Ray


Sent from my iPad using Tapatalk



Sent from my iPhone using Tapatalk

Re: Automatic OBD-II Indigo Plugin

PostPosted: Thu Mar 08, 2018 3:29 pm
by rapamatic
dgarozzo wrote:
Shouldn’t be any exceptions. I’ll look into it.



I'll turn on debugging so you get more info


Sent from my iPad using Tapatalk

Re: Automatic OBD-II Indigo Plugin

PostPosted: Thu Mar 08, 2018 4:26 pm
by rapamatic
Here's a sample debug log:

Code: Select all
Mar 8, 2018, 4:09:40 PM
   Automatic OBD-II Debug          Automatic - Minivan
   Automatic OBD-II Debug          _refreshStatesFromAPI for Automatic - Minivan (C_400027b0f9a87963)
   Automatic OBD-II Debug          Bearer 8e5c1e5f52565eb889fc982921a27e1d0b3114b3
   Automatic OBD-II Debug          vehicleJson updated
   Automatic OBD-II Debug          {"model":"Odyssey","fuel_level_percent":52.0,"display_name":null,"url":"https://api.automatic.com/vehicle/C_400027b0f9a87963/","created_at":"2017-04-30T15:03:25.617000Z","battery_voltage":13.391,"active_dtcs":[],"updated_at":"2018-03-08T22:09:40.535000Z","submodel":"Touring Elite","year":2014,"fuel_grade":"regular","id":"C_400027b0f9a87963","make":"Honda"}
   Automatic OBD-II Debug          _addVehicleToCars: C_400027b0f9a87963
   Automatic OBD-II Debug          getting fuel level percent
   Automatic OBD-II Debug          getting battery voltage
   Automatic OBD-II Debug          getting active dtcs (MILs)
   Automatic OBD-II                FYI - Exception caught getting vehicle info: state value type must be bool, int, real, or string
   Automatic OBD-II Debug          Bearer 8e5c1e5f52565eb889fc982921a27e1d0b3114b3
   Automatic OBD-II Debug          tripJson updated


Looks like its an issue with null data from the check engine light?


Sent from my iPad using Tapatalk

Re: Automatic OBD-II Indigo Plugin

PostPosted: Mon Mar 19, 2018 2:41 pm
by dgarozzo
v1.0.7 released. Should fix the exception.

Re: Automatic OBD-II Indigo Plugin

PostPosted: Mon Mar 19, 2018 2:43 pm
by dgarozzo
The problem wasn't null data - it was getting back a JSON object instead of a string. I needed to convert the JSON back to a string before setting the state.

Re: Automatic OBD-II Indigo Plugin

PostPosted: Thu Aug 30, 2018 3:07 pm
by Vig
Automatic has now 2 versions Lite and Pro. I assume Lite version would suffice?

Re: Automatic OBD-II Indigo Plugin

PostPosted: Thu Aug 30, 2018 4:19 pm
by dgarozzo
I’m pretty sure you’re gonna want the Pro.


Sent from my iPhone using Tapatalk

Automatic OBD-II Indigo Plugin

PostPosted: Fri Aug 31, 2018 4:05 am
by kw123
How much power does it consume.
Ie when I do not run the engine for 2 weeks will it drain the battery ... will the car still start?


Sent from my iPhone using Tapatalk

Re: Automatic OBD-II Indigo Plugin

PostPosted: Fri Aug 31, 2018 5:47 am
by dgarozzo
I’ve never had a problem with it.


Sent from my iPhone using Tapatalk