Hello,
Following conversation in thread: Zone and zoneName of device from driver context
I want my Homey PRO app to be able to modify the name and zone of a device.
To do so, I’m doing:
this.homeyApi = await HomeyAPI.createLocalAPI({
address: "http://127.0.0.1",
token: "<my secret token>"
});
let realDevice = this.getDevices().find(device => device.getData().id === virtualDeviceId);
if (data.name !== realDevice.getName() || data.zoneId !== realDevice.getZone()) {
await this.homeyApi.devices.updateDevice({
id: realDevice.getId(),
device: {
name: data.name,
zone: data.zoneId
}
});
}
When using the createAppApi instead of createLocalAPI:
this.homeyApi = await HomeyAPI.createAppAPI({
homey: this.homey
});
I get the error:
2023-10-01T08:08:17.557Z [err] [ManagerDrivers] [Driver:esphome-wizard] [HomeyAPIError: Vous n'avez pas la possibilité de faire ceci.] {
statusCode: 403,
description: "Vous n'avez pas la possibilité de faire ceci."
}
Even I found a way to make it works, the token requirement is very annoying, it’s not like I want an external application to acces the web api, the code is running insde the homey PRO app…
Any idea?