Technical documentation for Tidelight API

You can use the Tidelight API to run your own RGB lights or include the date and light colour in your own web page.

There is an example web page you can download at /api/tidelight.html which utilises the routines in /api/tidelight.js.

Description Data Example URL JSON Data MQTT Topic
https://api.tidelight.live
ws://api.tidelight.live:8080/mqtt
wss://api.tidelight.live:8443/mqtt
mqtt://mqtt.tidelight.live
RGB light colour
{
  "name": "bristolchannel",
  "rgb": [36,255,0],
  "date": "2022-02-10T10:18:12.596Z"
}
/tidelight/bristolchannel.js
Tidelight.rgbSet(data);
/tidelight/bristolchannel.json
tidedata/rgb/bristolchannel
Hex light color (compatible with Cheerlights interface)
#24ff00
/tidelight/bristolchannel
(like cheerlights)
tidelight/bristolchannel
(like mqtt.cheerlights.com/cheerlightsRGB)
Tide level at Avonmouth Portbury
{
  "name": "avonmouth",
  "date": "2022-02-10T09:45:00.000Z",
  "level": 0.34299999999999997,
  "label": "avon"
}
/tidelevel/avonmouth.js
Tidelight.levelSet(data);
/tidelevel/avonmouth.json
tidedata/level/avonmouth
Raw tide level at Avonmouth Portbury
0.34299999999999997
/tidelevel/avonmouth
Tide turn at Avonmouth Portbury
{
  "name": "avonmouth",
  "date": "2022-02-10T06:45:00.000Z",
  "turn": 1
}
/tideturn/avonmouth.js
Tidelight.turnSet(data);
/tideturn/avonmouth.json
tidedata/turn/avonmouth
Tide level at Newport
{
  "name": "newport",
  "date":"2022-02-10T09:45:00.000Z",
  "level":0.30900000000000016,
  "label":"npor"
}
/tidelevel/newport.js
Tidelight.levelSet(data);
/tidelevel/newport.json
tidedata/level/newport
Raw tide level at Newport
0.30900000000000016
/tidelevel/newport
Tide turn at Newport
{
  "name": "newport",
  "date": "2022-02-10T06:30:00.000Z",
  "turn": 1
}
/tideturn/newport.js
Tidelight.turnSet(data);
/tideturn/newport.json
tidedata/turn/newport