I am not sure whether this topic is allowed. But I thought I share my findings for the v2 API. I have personal use cases for directly calling the API through iOS shortcuts.
In v2, the on and off REST API path has changed to /capability/onoff from /state.
So now to switch on: PUT { "value": true } TO http://<HOMEY_IP>/api/manager/devices/device/<DEVICE_ID>/capability/onoff
and to switch off: PUT { "value": false } TO http://<HOMEY_IP>/api/manager/devices/device/<DEVICE_ID>/capability/onoff
Other than that, the rest of the APIs path rename the same GET http://<HOMEY_IP>/api/manager/devices/device GET http://<HOMEY_IP>/api/manager/devices/device/<DEVICE_ID> GET http://<HOMEY_IP>/api/manager/devices/device/<DEVICE_ID> GET http://<HOMEY_IP>/api/manager/insights/log/homey:device:<DEVICE_ID>/measure_temperature/entry
From previous forums (no idea if they still work):
# Get all zones
GET http://<HOMEY_IP>/api/manager/zones/
# Get all devices
GET http://<HOMEY_IP>/api/manager/devices/
# Get all devices within a zone:
GET http://<HOMEY_IP>/api/manager/devices/?zone=01234567-89ab-cdef-0123-456789abcdef
# Get Device
GET http://<HOMEY_IP>//api/manager/device/01234567-89ab-cdef-0123-456789abcdef
A few examples:
Get data
GET http://<HomeyIP>/api/manager/geolocation/ (read location)
GET http://<HomeyIP>/api/manager/devices/device/ (read all devices)
GET http://<HomeyIP>/api/manager/devices/device/<device_id>/ (read device by id)
GET http://<HomeyIP>/api/manager/flow/flow/ (read all flows)
GET http://<HomeyIP>/api/manager/flow/flow/<flow_id>/ (read all flow by id)
Set data
PUT http://<HomeyIP>/api/manager/devices/device/<device_id>/state/
(update capability of a device via json body, e.g. {'target_temperature': 20} triggers an thermostat to temperature of 20°, {'onoff': 1} switches a plug / switch 'on', etc).
Im guesing : http://<HomeyIP>/api/manager/devices/device/<device_id>/capability/target_temperature
That worked for me, just did a quick test in c# though.
public async Task GetDevicesAsync()
{
using (var client = GetClient())
{
var response = await client.GetStringAsync($“http://{homeyIp}/api/manager/devices/device/”).ConfigureAwait(true);
var result = JArray.Parse(response);
}
}
private static HttpClient GetClient()
{
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken);
return client;
}
Does it have any colon? There should be two colons separating three values. If you see one continuous string of chars without any colon or dash, it is the old v1.5 token.