Queries
The query domains for the Fleet API are
...
fuse_fleet:vehicleChannels()
Query the fleet for a the current vehicle channels. The result is an array of objects that associate a picoId
with the current channel for that vehicle.
You should avoid using the channel as a means of identifying the vehicle since it could change. This function always provides the current mapping from the vehicle canonical name in the system, the picoId
, and the pico channel.
...
Query fleet for summary of vehicle fillups. See the Fuel API description for general information about fuel.
The parameters are a year given as a four digit string (e.g. "2014") and a month given as a two digit string (e.g. "08" for August)
The result is an array of objects with the following properties:
Key | Description |
---|---|
cost | total cost of all fillups in the given month |
distance | total distance driven between fillups |
fillups | number of fillups |
picoId | pico identifier |
volume | volume of fillups (e.g. gallons, liters, etc.) |
Events
Services
fuse_fleet:create_vehicle
Selector:
select when fuse need_new_vehicle
Synopsis:
Creates a new vehicle in the fleet.
Idempotent. Will not create a vehicle that already exists (as identified by VIN and Device ID)
Uses:
- vin - Vehicle identification numbner
- deviceId - Fuse device identifier
- name - vehicle name (free form)
Raises:
cloudos:picoAttrSet
cloudod:subscribe
fuse_fleet:delete_vehicle
Selector:
select when fuse delete_vehicle
Synopsis:
Deletes a vehicle from the fleet.
Uses:
- vehicle_name - Pico name for vehicle to delete
Raises:
cloudos:picoAttrClear
cloudod:unsubscribe
carvoyant:vehicle_not_needed
fuse_fleet:find_fuse_carvoyant_diffs
Selector:
select when fuse fleet_updated
Synopsis:
Finds differences between vehicle records for Fuse fleet and vehicle records in Carvoyant. Used a guard rule for syncing fleet with Carvoyant.
Uses:
Raises:
fuse:vehicles_not_in_carvoyant
when fired
fuse_fleet:sync_fuse_with_carvoyant
Selector:
select when fuse vehicles_not_in_carvoyant
Synopsis:
Synchronizes the Fuse fleet and vehicle records in Carvoyant.
Works by send a carvoyant:init_vehicle
event to each vehicle that needs to be updated.
Uses:
vehicle_data
- array of picoIds for any vehicles not in sync
Raises:
fuse:vehicles_not_in_carvoyant
when fired
fuse_fleet:update_vehicle_data_in_fleet
Selector:
select when fuse updated_vehicle
Synopsis:
Catches data transmissions from the vehicle to the fleet.
Uses:
keyvalue
- the type of data being updated along with a keyvalue
- a map of the data to be stored.
Raises:
none