[RELEASE] Automatic Connected Car- Integration with SmartThings

project_garage
dth_car

(Yves Racine) #1

Hello,

My Automatic Service Manager is now able to receive real-time events through webhooks.

I think that this integration would potentially bring more ST users to Automatic and vice-versa. It’s sort of win-win situation for both platforms. ST support of websockets could also be a good solution in the long term.

Benefits of the direct integration with Automatic (instead of going thru IFTTT):

  • Less lag time to receive real time events (as IFTTT is an additional platform in the flow of events)
  • You can customize the fuel cost according to your local cost (whether in USD or other currencies)
  • Nice graph to show the distance vs. cost metrics

Regards.

Here are some screenshots of My Automatic Device that I’ve created so far:



EDIT: Please take note that, for now on, the latest version of MyAutomatic Device is now only available at my store:

The MonitorAutomaticCar smartapp is also available for a modest contribution.

You can also find Technical Support packages if needed.

For more details about MyAutomatic Device and its related smartapps, please consult the wiki:

http://thingsthataresmart.wiki/index.php?title=My_Automatic_Device
http://thingsthataresmart.wiki/index.php?title=Category:Unpublished_SmartApps

P.S. My Automatic device and related smartapps took several hundreds hours of development & testing, I’m now asking for a modest contribution.

Thank you for your support!

Regards.


Automatic (connected car device) now at 20% off
Automatic.com integration
Automatic now works with Nest
2016 Honda Pilot app
Turn on switch when connected to wifi - possible?
How to deal with multiple vehicles, multiple people and multiple garage doors?
Suggest a Device
Stringify - interesting concept and UI
Demo of EcobeeSwitch+, Ask Alexa, My ecobee, My Flair, My Automatic integrations
Garageio Integration
IFTTT couldn't connect to Smartthings
Car Mileage and Gas Reminders
List of official representatives from Third Party Companies?
#2

Sounds like a big project!

What does this give you that Automatic’s IFTTT channel does not?

http://blog.automatic.com/automatic-ifttt/


(Yves Racine) #3

@JDRoberts, if you use IFTTT, the delays between the different platforms (Automatic->IFTTT->ST and vice -versa) are too long, so a direct integration would be more efficient & useful for Home Automation scenarios.

Based on my experience, IFTTT is not meant to be used for real time event processing (not the base version of it).

See this thread in the Automatic Forum:

Also, with a direct integration to ST, you would be able, in smartapps, to subscribe to (quasi) real-time events coming from Automatic, such as "trip finished, ignition on/off, hard acceleration, hard brake, engine light on/off, etc).

Bye for now.

P.S. BTW, there is already a direct integration with Nest: https://www.automatic.com/apps/nest,
so I think that ST should have the same direct integration.


(Evan Leal) #4

This would be awesome!


(The fish is still dead.) #5

I’ve been on the fence about getting an Automatic for my car. A real integration with ST would probably make that sale.


(Yves Racine) #6

@btk, @Ronin

As specified above,

If you are interested in the Automatic- SmartThings direct integration, please send an email to developer@automatic.com, mention my name and the ticket number (#58340) , and ask to complete this integration ASAP.


(Yves Racine) #7

Hello,

Just to let everybody know, I got the following email from Automatic:


Adam Altma
Adam Altman (Automatic)
Aug 5, 1:06 PM

Hi Yves,

This is Adam, Head of Product at Automatic. Thanks for taking the time to push on the request. While we’d like Automatic to work with as many external systems as possible, it’s not our core focus at the moment to expand the footprint by building integrations in-house in this area. So TLDR we’re not likely to make the requested proxy app. Instead, what we would do is encourage and support any independent dev or company who wanted to make and maintain a go-between service. The tools to do so are available. And we would be happy to promote it for them.

I’ll post this same text in the thread – just haven’t had the time to till now.

Thanks again.

Cheers,
Adam


(Yves Racine) #8

Hello,

For those of you who are still interested in this integration, you can grab my latest Automatic code
at my github:

I have written a service manager (called MyAutomaticServiceMgr) to integrate with Automatic.

You can have the following information exposed to ST:

vehicleId
make
model
submodel
displayName
year

Stats

Today AvgTripConsumption in miles/US gallons (or km per liter)
Today AvgTripDistance in miles (or km)
Today AvgTripDuration in minutes
Today totalDistance
Today AvgTripFuelVolume in US gallons (or Liters)
Today totalFuelVolume
Today totalDuration in minutes
Today totalNbTrip
Today totalHardAcceleration
Today totalHardBrakes
Today AvgScoreSpeeding
Today AvgScoreEvents

Yesterday AvgTripConsumption in miles/US gallons (or km per liter)
Yesterday AvgTripDistance in miles (or km)
Yesterday AvgTripDuration in minutes
Yesterday totalDistance
Yesterday AvgTripFuelVolume in US gallons (or Liters)
Yesterday totalFuelVolume
Yesterday totalDuration in minutes
Yesterday totalNbTrip
Yesterday totalHardAcceleration
Yesterday totalHardBrakes
Yesterday AvgScoreSpeeding
Yesterday AvgScoreEvents

Weekly AvgTripDuration in minutes
Weekly totalDistance
Weekly AvgTripFuelVolume in US gallons (or Liters)
Weekly totalFuelVolume
Weekly totalDuration in minutes
Weekly totalNbTrip
Weekly totalHardAcceleration
Weekly totalHardBrakes
Weekly AvgScoreSpeeding
Weekly AvgScoreEvents

Events for a given trip are generated for subscription in smartapps

eventVehicleId
eventType, examples: Trip Completed, Hard Brake, Hard Acceleration, Speeding
eventTripId
eventTripDistance
eventTripAvgFuelConsumption
eventTripStartLocation:
eventTripEndLocation:
eventTripStartAddress
eventTripEndAddress
eventTripSpeed
eventTripGForce
eventTripLocationLat
eventTripLocationLon
eventTripStartedAt
eventTripEndedAt

For the moment, the authentication process is a bit complex as Automatic does not support
redirect URL to multiple ST users.

Please follow the readme file at my github.

P.S. I’d need a go-between app (or proxy) to do the real time events processing… I’m still investigating on how to do it as I don’t want to have the resources (cloud or servers infrastructure).


(Jody) #9

Not all events should need to be updated automatically. I might be able to help with the real-time part, just let me know which events you would like to see update in real-time. I will check out your code and see what I need to make this happen.


(Yves Racine) #10

Hi @jodyalbritton, the list of real time events is the following:

  • see My Automatic Device, around line 1578 in the IDE, the list in getEventName()

      'ignition:on': 'Ignition On',
      'ignition:off': 'Ignition Off',
      'trip:finished': 'Trip Completed',
      'notification:speeding': 'Speed Exceeded Threshold',
      'notification:hard_brake': 'Hard Brake',
      'notification:hard_accel': 'Hard Acceleration',
      'region:changed': 'Region Changed',
      'mil:on': 'MIL (check engine light) On',
      'mil:off': 'MIL (check engine light) Cleared',
    

My code is almost ready to process those real time events (I haven’t had the chance to test it, but for the most part, I think that it should work) as I can already process some of those events after the trip is completed (not in RT).

My Service Manager has already the procEvent() method where RT events data from Automatic will be posted to be processed by the Automatic Device Handler.

The problem is that Automatic is not able to support multiple ST connections and, on the other side, ST requires authentication from Automatic to post data, so a proxy app needs to be deployed outside of the ST platform to manage multiple ST connections talking with an ST-authenticated
Automatic real time event processor.

There is a node.js example app that one can reuse for this proxy-app at

AUTOMATICATOR (NODE.JS) uses Heroku as container.

Websockets are used in the node.js app to retrieve RT events from Automatic.

Webhooks would need to be used to post data to MyAutomaticServiceManager (after being ST authenticated).

P.S. I already talked to @slagle (Tim Slagle) about deploying it somewhere, but as we all know, there is no bandwidth on the ST side to work on such project at the moment (with HubV2 and all)…

Regards.


MonitorAutomaticCar smartapp
(Yves Racine) #11

Hello, today I created a smartapp that uses MyAutomatic Device for monitoring trip events, Speeding and Events scores (based on calculated values by Automatic’s algorithm)

Typical Use Case: Parents may want to closely monitor their kids’ car driving abilities.

The smartapp can detect any speeding, hard acceleration, hard brakes events after a trip has been completed and alerts parents of bad driving behaviors.

Parents may want to set a minimum Speeding Score or Events Score and if the kids’ scores go below these thresholds, the parents will be notified ASAP.

The monitoring could be even more tight during the wet/snow season. Based on weatherStation, it can automatically switch to a monitoring cycle interval in minutes instead of hours when it’s raining or snowing outside…

The MonitorAutomaticCar smartapp is now available at my store:

Regards.

P.S. I haven’t tested all event scenarios yet, but the foundation is working fine.


#12

Any updates on this? Your work so far looks great.

My web software knowledge is negligible. Is your github project something I can download and start using with my Automatic, or is further infrastructure required on my own end?


(Yves Racine) #13

@Michael_D,

My work is complete for the moment.

Please refer to the ST community wiki for more details on the installation steps.

http://thingsthataresmart.wiki/index.php?title=My_Automatic_Device

P.S. You do not need any HW except the Automatic Device itself.
Regards.


#14

Good stuff. Got it set up and working. Many thanks.


(Kristopher Kubicki) #15

Totally missed it when you released it – looking forward to trying it out


(Yves Racine) #16

Hello all,

If you want ST to provide more real-time processing, please write to @slagle about it… He may able to help in setting a proxy app.

Regards.


#17

I’d love to be able to add this device type as an open/close type of sensor, open = ignition on, close = ignition off, in order to trigger opening my driveway gate, garage, house locks, etc.

From reading your earlier posts, the realtime processing can’t be handled on ST’s end? And Automatic isn’t interested in communicating realtime events either? No other work around besides a third party running a server to process this info?


(Yves Racine) #18

Hi @Michael_D

As I said in an earlier post,

There is no possible workaround at the moment. Maybe, one day ST will support websockets…

Regards.


#19

Thanks, Yves.

@slagle, Tim, any idea if this is an integration the ST team could take further?


(Tim Slagle) #20

It is something we can take further but I am currently trying to find someone who can work on this. Backlog is huge :frowning: