History

There are a set of endpoints related to retriveing historical data about a vessel. In all cases, the amount of historical data retrived will be related to the account type (Basic, Enhanced, etc.) of the credentials used to obtain the Authorization Token.

/history/weather

A call to the /history/weather method will look like this:

curl -H “Authorization: Bearer eyJhbGciOiJIUzI1N…XosykYIc” “https://api.floathub.com/v2/history/weather

except that you should include your actual (and much longer) Authorization Token in the place of the example eyJhbGciOiJIUzI1N...XosykYIc from above.

This call will return a JSON response that looks like this:

{"items":
  [
    {"AirTemp":63.5,"Pressure":30.26,"Time":"2022-10-12T13:00:00+0000","WaterTemp":63.5},
    {"AirTemp":63.38,"Pressure":30.27,"Time":"2022-10-12T14:00:00+0000","WaterTemp":63.5},
    {"AirTemp":63.32,"Pressure":30.27,"Time":"2022-10-12T15:00:00+0000","WaterTemp":63.5},
    {"AirTemp":63.46,"Pressure":30.28,"Time":"2022-10-12T16:00:00+0000","WaterTemp":63.5},
    {"AirTemp":63.5,"Pressure":30.28,"Time":"2022-10-12T17:00:00+0000","WaterTemp":63.5},
    {"AirTemp":63.73,"Pressure":30.28,"Time":"2022-10-12T18:00:00+0000","WaterTemp":63.5},
    {"AirTemp":63.86,"Pressure":30.29,"Time":"2022-10-12T19:00:00+0000","WaterTemp":63.5},
    ...
  ]
}

The data shows an hourly average for the data type in question, and all timestamps are set to the end of the hour long period over which the data is averaged. Note that unlike the status timestamps, this time is in ISO 8601 format and includes the timezone (but the timezone is always UTC, so the value is always +0000). This can make it easier to use in various graphing or charting contexts without having to manipulate the timestamp

/history/voltage

A call to the /history/voltage method will look like this:

curl -H “Authorization: Bearer eyJhbGciOiJIUzI1N…XosykYIc” “https://api.floathub.com/v2/history/voltage

except that you should include your actual (and much longer) Authorization Token in the place of the example eyJhbGciOiJIUzI1N...XosykYIc from above.

This call will return a JSON response that looks like this:

{"items":
  [
    {"House Bank":19.58,"Solar Panels":19.6,"Starter":12.7,"Time":"2022-10-12T13:00:00+0000"},
    {"House Bank":20.26,"Solar Panels":20.29,"Starter":12.7,"Time":"2022-10-12T14:00:00+0000"},
    {"House Bank":19.64,"Solar Panels":19.67,"Starter":12.71,"Time":"2022-10-12T15:00:00+0000"},
    {"House Bank":19.6,"Solar Panels":19.62,"Starter":12.7,"Time":"2022-10-12T16:00:00+0000"},
    {"House Bank":19.17,"Solar Panels":19.19,"Starter":12.7,"Time":"2022-10-12T17:00:00+0000"},
    {"House Bank":19.14,"Solar Panels":19.16,"Starter":12.7,"Time":"2022-10-12T18:00:00+0000"},
    {"House Bank":18.5,"Solar Panels":18.53,"Starter":12.7,"Time":"2022-10-12T19:00:00+0000"},
    {"House Bank":18.37,"Solar Panels":18.39,"Starter":12.7,"Time":"2022-10-12T20:00:00+0000"},
    {"House Bank":16.82,"Solar Panels":16.84,"Starter":12.7,"Time":"2022-10-12T21:00:00+0000"},
    {"House Bank":8.25,"Solar Panels":8.19,"Starter":12.7,"Time":"2022-10-12T22:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.69,"Time":"2022-10-12T23:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T00:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T01:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T02:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T03:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T04:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.69,"Time":"2022-10-13T05:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T06:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T07:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T08:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T09:00:00+0000"},
    {"House Bank":null,"Solar Panels":null,"Starter":12.7,"Time":"2022-10-13T10:00:00+0000"},
    ...
  ]
}

Note that null values (missing measurements) will be explicitly listed as null rather than simply not appearing in the list. To completely ignore a voltage source, a user can use the web interface to set their vessel preferences to indicate that the voltage source is not in use.

/history/speed

A call to the /history/speed method will look like this:

curl -H “Authorization: Bearer eyJhbGciOiJIUzI1N…XosykYIc” “https://api.floathub.com/v2/history/speed

except that you should include your actual (and much longer) Authorization Token in the place of the example eyJhbGciOiJIUzI1N...XosykYIc from above.

This call will return a JSON response that looks like this:

{"items":
  [
    {"Depth":6.82,"SOG":0.03,"STW":0.03,"Time":"2022-10-12T13:00:00+0000","Wind":7.78},
    {"Depth":6.69,"SOG":0.03,"STW":0.03,"Time":"2022-10-12T14:00:00+0000","Wind":9.06},
    {"Depth":6.13,"SOG":0.03,"STW":0.03,"Time":"2022-10-12T15:00:00+0000","Wind":9.72},
    {"Depth":6.66,"SOG":0.03,"STW":0.03,"Time":"2022-10-12T16:00:00+0000","Wind":8.16},
    {"Depth":6.56,"SOG":0.04,"STW":0.03,"Time":"2022-10-12T17:00:00+0000","Wind":7.78},
    {"Depth":6.59,"SOG":0.04,"STW":0.03,"Time":"2022-10-12T18:00:00+0000","Wind":7.78},
    {"Depth":6.53,"SOG":0.02,"STW":0.03,"Time":"2022-10-12T19:00:00+0000","Wind":7.78},
    {"Depth":6.95,"SOG":0.02,"STW":0.03,"Time":"2022-10-12T20:00:00+0000","Wind":7.78},
    {"Depth":6.56,"SOG":0.03,"STW":0.03,"Time":"2022-10-12T21:00:00+0000","Wind":6.03},
    {"Depth":6.82,"SOG":0.02,"STW":0.03,"Time":"2022-10-12T22:00:00+0000","Wind":5.83},
    {"Depth":6.59,"SOG":0.03,"STW":0.03,"Time":"2022-10-12T23:00:00+0000","Wind":5.83},
    {"Depth":6.76,"SOG":0.04,"STW":0.03,"Time":"2022-10-13T00:00:00+0000","Wind":5.83},
    {"Depth":6.43,"SOG":0.04,"STW":0.03,"Time":"2022-10-13T01:00:00+0000","Wind":7.51},
    {"Depth":6.2,"SOG":0.03,"STW":0.03,"Time":"2022-10-13T02:00:00+0000","Wind":7.78},
    {"Depth":6.56,"SOG":0.03,"STW":0.03,"Time":"2022-10-13T03:00:00+0000","Wind":9.04},
    {"Depth":6.36,"SOG":0.03,"STW":0.03,"Time":"2022-10-13T04:00:00+0000","Wind":9.72},
    {"Depth":6.33,"SOG":0.04,"STW":0.03,"Time":"2022-10-13T05:00:00+0000","Wind":9.72},
    ...
  ]
}

/history/pumps

A call to the /history/pumps method will look like this:

curl -H “Authorization: Bearer eyJhbGciOiJIUzI1N…XosykYIc” “https://api.floathub.com/v2/history/pumps

except that you should include your actual (and much longer) Authorization Token in the place of the example eyJhbGciOiJIUzI1N...XosykYIc from above.

This call will return a JSON response that looks like this:

{"items":
  [
    {"Backup":0.0,"Primary Bilge":0.0,"Sump":0.0,"Time":"2022-10-12T13:35:32+0000"},
    {"Backup":0,"Primary Bilge":0,"Sump":0,"Time":"2022-10-12T13:51:48+0000"},
    {"Backup":210.0,"Primary Bilge":0,"Sump":0,"Time":"2022-10-12T13:55:18+0000"},
    {"Backup":210.0,"Primary Bilge":0,"Sump":0,"Time":"2022-10-13T01:39:02+0000"},
    {"Backup":210.0,"Primary Bilge":61.0,"Sump":0,"Time":"2022-10-13T01:40:03+0000"},
    {"Backup":210.0,"Primary Bilge":61.0,"Sump":0,"Time":"2022-10-13T04:41:06+0000"},
    {"Backup":210.0,"Primary Bilge":121.0,"Sump":0,"Time":"2022-10-13T04:42:06+0000"},
    {"Backup":210.0,"Primary Bilge":121.0,"Sump":0,"Time":"2022-10-13T06:25:08+0000"},
    {"Backup":450.0,"Primary Bilge":121.0,"Sump":0,"Time":"2022-10-13T06:29:08+0000"},
    {"Backup":450.0,"Primary Bilge":121.0,"Sump":0,"Time":"2022-10-13T13:03:45+0000"},
    {"Backup":450.0,"Primary Bilge":121.0,"Sump":30.0,"Time":"2022-10-13T13:04:15+0000"},
    {"Backup":450.0,"Primary Bilge":121.0,"Sump":30.0,"Time":"2022-10-13T17:10:50+0000"},
    {"Backup":450.0,"Primary Bilge":211.0,"Sump":30.0,"Time":"2022-10-13T17:12:20+0000"},
    {"Backup":450.0,"Primary Bilge":211.0,"Sump":30.0,"Time":"2022-10-14T03:12:32+0000"},
    {"Backup":450.0,"Primary Bilge":241.0,"Sump":30.0,"Time":"2022-10-14T03:13:02+0000"},
    {"Backup":450.0,"Primary Bilge":241.0,"Sump":30.0,"Time":"2022-10-14T04:42:34+0000"},
    {"Backup":450.0,"Primary Bilge":271.0,"Sump":30.0,"Time":"2022-10-14T04:43:04+0000"},
    {"Backup":450.0,"Primary Bilge":271.0,"Sump":30.0,"Time":"2022-10-14T05:52:05+0000"},
    {"Backup":450.0,"Primary Bilge":361.0,"Sump":30.0,"Time":"2022-10-14T05:53:35+0000"},
    {"Backup":450.0,"Primary Bilge":361.0,"Sump":30.0,"Time":"2022-10-14T10:35:10+0000"},
  ]
}

Note that unlike the other historical categories, these are not hourly averages. This is the number of seconds the pump has run since the beginning of this time period, and the value is timestamped to each time any one of the available pumps cycles on or off. To take an example, with reference to the 6th and 7th lines above:

{"Backup":210.0,"Primary Bilge":0,"Sump":0,"Time":"2022-10-13T01:39:02+0000"},
{"Backup":210.0,"Primary Bilge":61.0,"Sump":0,"Time":"2022-10-13T01:40:03+0000"},

between 1:39:02 and 1:40:03 on October 13, 2022, the Primary Bilge Pump on this vessel ran for 61 seconds.